Updated: 2023-03-24 Fri 21:42

Org mode customize latex export

Various options can be used to customize the latex output of org mode exported file. Some useful snippets from the documentation are given below.

‘DESCRIPTION’ The document’s description. The description along with author name, keywords, and related file metadata are inserted in the output file by the hyperref package. See ‘org-latex-hyperref-template’ for customizing metadata items. See ‘org-latex-title-command’ for typesetting description into the document’s front matter. Use multiple ‘DESCRIPTION’ keywords for long descriptions.

‘LATEXCLASS’ This is LaTeX document class, such as article, report, book, and so on, which contain predefined preamble and headline level mapping that the LaTeX export back-end needs. The back-end reads the default class name from the ‘org-latex-default-class’ variable. Org has article as the default class. A valid default class must be an element of ‘org-latex-classes’.

‘LATEXCLASSOPTIONS’ Options the LaTeX export back-end uses when calling the LaTeX document class.

‘LATEXHEADER’ ‘LATEXHEADEREXTRA’ Arbitrary lines to add to the document’s preamble, before the hyperref settings. See ‘org-latex-classes’ for adjusting the structure and order of the LaTeX headers.

‘SUBTITLE’ The document’s subtitle. It is typeset as per ‘org-latex-subtitle-format’. If ‘org-latex-subtitle-separate’ is non-‘nil’, it is typed outside of the ‘\title’ macro. See ‘org-latex-hyperref-template’ for customizing metadata items. See ‘org-latex-title-command’ for typesetting description into the document’s front matter.

To float an image without specifying a caption, set the ‘:float’ attribute to one of the following:

‘t’ For a standard ‘figure’ environment; used by default whenever an image has a caption.

‘multicolumn’ To span the image across multiple columns of a page; the back-end wraps the image in a ‘figure*’ environment.

‘wrap’ For text to flow around the image on the right; the figure occupies the left half of the page.

‘sideways’ For a new page with the image sideways, rotated ninety degrees, in a ‘sidewaysfigure’ environment; overrides ‘:placement’ setting.

‘nil’ To avoid a ‘:float’ even if using a caption.

13.10.10 Special blocks in LaTeX export


For other special blocks in the Org file, the LaTeX export back-end makes a special environment of the same name. The back-end also takes ‘:options’, if any, and appends as-is to that environment’s opening string. For example:

We demonstrate how to solve the Syracuse problem.

… Therefore, any even number greater than 2 is the sum of two primes.

exports to

\begin{abstract} We demonstrate how to solve the Syracuse problem. \end{abstract} \begin{proof}[Proof of important theorem] ... Therefore, any even number greater than 2 is the sum of two primes. \end{proof}

If you need to insert a specific caption command, use ‘:caption’ attribute. It overrides standard ‘CAPTION’ value, if any. For example: