2

I don't get any effect if I put the following line at the start of my Org-mode file:

#+BEAMER_THEME: metropolis

Indeed, whatever theme name I write after #+BEAMER_THEME:, there's not mention of it in the resulting .tex file, and I always get the default theme.

I'm using Org mode 9.5 and Emacs 27.2. Am I missing something here? What's the correct way to change the Beamer theme?

EDIT: I'm using Doom Emacs v2.0.9

5
  • One common error that might be causing this is that you are doing C-c C-e l l (LaTeX export) instead of C-c C-e l b (Beamer export). Does the \documentclass line say beamer?
    – NickD
    Commented Jun 27, 2021 at 21:34
  • @NickD Seems I can't paste a screenshot in the comments, but in my export buffer in Org-mode I don't have any export key specific to Beamer. In the [l] Export to LaTeX section, I only have [L] As LaTeX buffer, [p] As PDF file, [l] As LaTeX file, and [o] As PDF file and open options. Is there any package I should install or is the Beamer export supposed to be available by default? Yes, the first line of the generated LaTeX file is the following: \documentclass[presentation]{beamer}
    – kir0ul
    Commented Jun 29, 2021 at 15:18
  • (require 'ox-beamer) - add this to your init file towards the end.
    – NickD
    Commented Jun 29, 2021 at 15:23
  • 2
    I found M-x org-beamer-export-to-pdf works, and once I ran it, it added the specific Beamer export option in my Org-mode export buffer!
    – kir0ul
    Commented Jun 29, 2021 at 15:44
  • That's because it's an autoloaded function: when it is invoked for the first time, the file where it is defined is loaded (which is what the require form does) and then the function is executed. Do C-h i g (emacs) Lisp libraries to learn more about autoloads, loading libraries, the load-path and more.
    – NickD
    Commented Jun 29, 2021 at 16:13

1 Answer 1

1

beamer export is different from latex export: for latex, you say C-c C-e l l (or similar - this produces a TeX file but does not process it to PDF); for beamer, you say C-c C-e l b (again this produces a TeX file but does not process it - there are other options specific to beamer export for processing to PDF).

If you don't have these entries in the menu, then beamer export is not enabled. To enable it, go to the *scratch* buffer and type (require 'ox-beamer) followed by C-j: that enables it for this session. To enable it permanently, add (require 'ox-beamer) to your init file (I'd add it towards the end, after the rest of Org mode initialization, but that's probably not necessary).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.