Hot answers tagged

12

It depends on whether you load the listings package in your .emacs file. You can check the contents of the Emacs variable org-latex-default-packages-alist (use the key combo C-h v to see the help and contents of a variable). If the listings package is not loaded, org-mode will use the verbatim LaTeX environment to typeset the code. In that case you can use ...


9

The following worked for me: emacs \ -u "$(id -un)" \ --batch \ --eval '(load user-init-file)' \ foo.org \ -f org-beamer-export-to-pdf Thanks go to @mutbuerger for the hint to pass -u <username> to get user-init-file defined.


8

Beamer export is very similiar to LaTeX export in Org-Mode, all you need to do is hitting M-x org-beamer-export-to-pdf or C-c C-e l p from the Org buffer you're working on. The majority of options are taken from the LaTeX export except for BEAMER_THEME and BEAMER_COLOR_THEME. Other than that there are a few Beamer-specific commands one can use to have ...


7

Instead of #+LaTeX: you should try #+BEAMER_HEADER: for all beamer specific configuration lines. For example: #+BEAMER_HEADER: \setbeamertemplate{navigation symbols}{} removes navigation symbols in all slides including title page and toc.


6

I came up with this recently to solve the problem of export cluttering the current directory, although it is not the solution asked for, I think it belongs here, plus it fixes it for any files org-export generates. (defvar org-export-output-directory-prefix "export_" "prefix of directory used for org-mode export") (defadvice org-export-output-file-name (...


5

As you mention, org-mode does not make use of the echo area to show export errors. Instead, it dumps all output that is produced during LaTeX export to a buffer called *Org PDF LaTeX Output*. If you want to get information about why the export process failed, you can switch to this buffer and search for error (or even warning). Example Contents of .org ...


5

Please change #+options: H:3 to #+options: H:2. This is working for me with Emacs 25.1, Org 9.0.4. Maybe #+beamer_frame_level: became obsolete in Org9, the example is from 2010!


4

Two ways to color text in org-mode come into my mind: 1.) Simply add the usual LaTeX code @@latex:{\color{green}@@This@@latex:}@@ is green. 2.) Use John Kitchin's org-colored-text.el After downloading the file to your load-path directory, put the following in your init.el, which lets you use org-links to color text: (require 'org-colored-text) ;; Taken ...


4

You need to use a "closing" heading: *** :B_ignoreheading: :PROPERTIES: :BEAMER_env: ignoreheading :END: Hence, your example should look like this: * More Complex Example some text *** library.py :B_block: #+begin_src python code #+end_src *** ...


3

If you add the following code at the beginning of your org file: #+BEAMER_HEADER: \AtBeginSection[]{\begin{frame}<beamer>\frametitle{Presentat‌​‌​ion agenda}\tableofcontents[currentsection]\end{frame}} it will generate a toc frame at the beginning of each section, highlighting the upcoming section. You can change the title of the frame (Presentat‌​‌​...


3

You need to make AUCTeX aware of the frame environment, i.e., \frametitle: (add-to-list 'TeX-outline-extra '("\\\\frametitle\\b" 4)) From the documentation on Tex-outline-extra: List of extra TeX outline levels. Each element is a list with two entries. The first entry is the regular expression matching a header, and the second is the level of ...


3

That certainly is an edge case. Some might argue that you can't have a heading without some content in the heading, but your use case seems like a reasonable use of the outline. org-element-headline-parser isn't written to accommodate your use-case. You can change the regular expression that matches the tag portion from (org-re "[ \t]+\\(:[[:alnum:]_@#%:]...


3

I think it works ok if you remove the :B_block: from your headlines. * Introduction ** A block :PROPERTIES: :BEAMER_env: block :END: Some text in the block. ** :PROPERTIES: :BEAMER_env: block :END: Text in block without title leads to:


3

So it looks like mixed Org installation is to blame. It appears that Org FAQ has something to say on this subject: Is my Orgmode installation mixed? Emacs is distributed with a version of Orgmode bundled with it. A common problem among users who install a newer version of Orgmode separately is a mixed install where Emacs loads some files from the ...


2

The answer that @Lgen gave works as far as the export is concerned, but it breaks visibility cycling (the headline level is lifted). As the thread on the org-mode mailing list suggests, empty headlines are considered evil. So I'd propose to insert something that has no effects export-wise, for example @@latex:@@. With this, you can also keep the tag, which I ...


2

In order not to be prompted anymore for overlay specification in \item like macros, set the variable LaTeX-beamer-item-overlay-flag to nil. You can do it locally or globally, for the latter case customize that variable or add this code to your init file: (setq LaTeX-beamer-item-overlay-flag nil) As most style-specific options, this variable is not ...


2

You can mark headings with tags, and set options for including and excluding tags from export. E.g. #+EXCLUDE_TAGS: slow * My work ** This section takes time :slow: ** This other section is OK


2

In order to ensure that source code formatting is preserved in exports from Org-mode, set the variables org-src-preserve-indentation to 't', and indent-tabs-mode to 'nil' using customize-variable.


2

Try this (push '("frametitle" 2) TeX-outline-extra) See the documentation for TeX-outline-extra. The first element of the list being added is a regexp and the second is the imenu level. You can also see LaTeX-section-list for the default levels that imenu uses for latex. Update: As suggested in the comments, it might be a little safer to use the ...


2

I've learned here that there are two ways to modify an \item: - [@123] will set the counter of enumerations (or "ordered lists") to 123. - [$Rightarrow$] :: bla will generate a "description". Both do not really yield the flexibility that I was hoping for in my question, but it seems that this is as far as one can get. EDIT: I've stumbled over a not so ...


2

First of all, I suggest you create a proper class file beamer-preamble.cls like this: \NeedsTeXFormat{LaTeX2e} \ProvidesClass{beamer-preamble} [2017/04/26 v0.1 My Beamer Preamble] \LoadClass[<beamer-options>]{beamer} Next, you want to have an AUCTeX style file for beamer-preamble.cls. Doing M-x TeX-auto-generate RET in one way. But I recommend ...


2

You have to allow frame breaking by adding the corresponding Beamer option as an Org property to the slide heading: * References :PROPERTIES: :BEAMER_opt: allowframebreaks,label= :END: bibliographystyle:unsrt bibliography:/path/to/my.bib


2

Dang! This line #+ATTR_LATEX: width=0.4\textwidth has got wrong syntax. It should be: #+ATTR_LATEX: :width 0.4\textwidth


2

Here is an example of a slide with a note: * Slide - Item 1 - item 2 ** Note :PROPERTIES: :BEAMER_ENV: note :END: This is a note. IOW, a second level section with a BEAMER_ENV property with a value of "note" becomes a beamer note. Whether this will get printed out properly the way you want, I don't know. EDIT: if you look at the tex file ...


2

Your problem is the structure of org-mode documents. The stuff from a head line up to a head line of at least the same level belongs to the heading. (See the worg-documentation of org-mode syntax.) Try to exploit that structure! For an example introduce a level-3 headline after the definition and before the list. That headline can even be empty! That puts ...


2

It's a pity that it's not mentioned in the manual nor in the tutorial, since it's a more natural mapping of constructs from org to beamer, but you can use special org blocks (avoiding the boilerplate of subsectioning with its drawers and everything) as defined here. For example: Some text... #+BEGIN_theorem ... #+END_theorem ...text continues here Then ...


1

The latex and beamer exporters are invoked differently. If you look at the latex part of the menu after C-c C-e, you will see that under the l latex menu, you have: [L] as latex buffer, [l] as latex file, [p] as PDF, [o] as PDF-and-open but [B] as latex buffer (beamer), [b] as latex file (beamer), [P] as PDF (beamer), [O] as PDF (beamer) and open.


1

I look forward to seeing other answers to this question, because I'm also looking to optimize my workflow. In my current setup I have a single org document used as an article and as chapter of a thesis, call it research.org. The way I manage subtrees is by having :manuscript: and :thesis: tags to control export. For example, in a second file thesis.org I #+...


1

As a complement to @Timm answer, you can define a macro instead of having to write: @@latex:{\color{green}@@This@@latex:}@@ every times. This is slightly more readable and less verbose. Here is a working example (to export to PDF). #+LATEX_HEADER: \usepackage{color} #+MACRO: color @@latex:{\color{$1}@@$2@@latex:}@@ {{{color(red,this text is red)}}} and ...


1

Well after doing quite some research I found this question and this EmacsWiki and finally this question, which is basically asking for what I am looking for. I found the solution puzzle piece in the AUCTeX docs. The solution is adding the following to .emacs (setq TeX-outline-extra '(("\\\\begin{frame}[{\[].+" 5))) The regular expression should match \...


Only top voted, non community-wiki answers of a minimum length are eligible