|
From: | Richard Stanton |
Subject: | Re: Exporting to LaTeX versus Beamer: how to take different actions depending on export format? |
Date: | Sat, 3 Jul 2021 08:57:49 -0700 |
I’ve found a few partial solutions: 1) #+begin_src emacs-lisp :results raw :exports (if (eq org-export-current-backend 'beamer) "results" "none") (eval (concat "#+begin_src python\n print('Hello, world')\n#+end_src")) #+end_src This prints the python code if exporting to Beamer and not if exporting to LaTeX, but the code is not now live, which rather undermines the best feature of org-mode! 2) Include the code twice, with conditional statements around it each time, so you can export one version to LaTeX and another version to Beamer. OK, but inelegant 3) Instead of trying to modify the listing options, surround the code block with some scaling statements that are called only in Beamer, e..g, #+beamer: \begin{adjustbox}{height=0.5\textheight} #+begin_src python print('Hello, world’) #+end_src #+beamer: \end{adjustbox} None of these is quite perfect, but they mostly do what I want, especially #3.
|
[Prev in Thread] | Current Thread | [Next in Thread] |