12.8 LaTeX Export

The LaTeX export backend can handle complex documents, incorporate standard or custom LaTeX document classes, generate documents using alternate LaTeX engines, and produce fully linked PDF files with indexes, bibliographies, and tables of contents, destined for interactive online viewing or high-quality print publication.

By default, the LaTeX output uses the article class. You can change this by adding an option like ‘#+LATEX_CLASS: myclass’ in your file. The class must be listed in org-latex-classes.

C-c C-e l l (org-latex-export-to-latex)

Export to a LaTeX file with a ‘.tex’ extension. For ‘myfile.org’, Org exports to ‘myfile.tex’, overwriting without warning.

C-c C-e l p (org-latex-export-to-pdf)

Export as LaTeX file and convert it to PDF file.

C-c C-e l o (<no corresponding named command>)

Export as LaTeX file and convert it to PDF, then open the PDF using the default viewer.

The LaTeX export backend can insert any arbitrary LaTeX code, see Embedded LaTeX. There are three ways to embed such code in the Org file and they all use different quoting syntax.

Inserting in-line quoted with @ symbols:

Code embedded in-line @@latex:any arbitrary LaTeX code@@ in a paragraph.

Inserting as one or more keyword lines in the Org file:

#+LATEX: any arbitrary LaTeX code

Inserting as an export block in the Org file, where the backend exports any code between begin and end markers:

#+BEGIN_EXPORT latex
  any arbitrary LaTeX code
#+END_EXPORT