Question

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. 
Was it helpful?

Solution

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}}%
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top