问题
I want to use one package if I compile with beamer or another one if I compile with pdflatex (org-latex-pdf-process):
if compile-with-beamer:
\usepackage{my_beamer_package}
else:
\usepackage{my_article_package}
NB:
C-c C-e l P (org-beamer-export-to-pdf)
Export as LaTeX and then process to PDF.
回答1:
A possible starting point: use the LaTeX macro \@ifclassloaded. More precisely, in your org
file use a local package
#+LATEX_HEADER: \usepackage{myPackage}
and in this package have the following code:
\@ifclassloaded{beamer}
{\usepackage{my_beamer_package}}
{\usepackage{my_article_package}}%
来源:https://stackoverflow.com/questions/22708353/configure-org-mode-to-use-one-package-if-compile-with-beamer-another-else-artic