This is the official manual for the latest Org-mode release.

Table of Contents

Next: , Previous: Subscripts and superscripts, Up: Embedded LaTeX


11.7.3 LaTeX fragments

Going beyond symbols and sub- and superscripts, a full formula language is needed. Org mode can contain LaTeX math fragments, and it supports ways to process these for several export back-ends. When exporting to LaTeX, the code is left as it is. When exporting to HTML, Org can use either MathJax (see Math formatting in HTML export) or transcode the math into images (see see Previewing LaTeX fragments).

LaTeX fragments don't need any special marking at all. The following snippets will be identified as LaTeX source code:

For example:

     \begin{equation}
     x=\sqrt{b}
     \end{equation}
     
     If $a^2=b$ and \( b=2 \), then the solution must be
     either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].

LaTeX processing can be configured with the variable org-export-with-latex. The default setting is t which means MathJax for HTML, and no processing for ASCII and LaTeX back-ends. You can also set this variable on a per-file basis using one of these lines:

     #+OPTIONS: tex:t          Do the right thing automatically (MathJax)
     #+OPTIONS: tex:nil        Do not process LaTeX fragments at all
     #+OPTIONS: tex:verbatim   Verbatim export, for jsMath or so

Footnotes

[1] When MathJax is used, only the environments recognized by MathJax will be processed. When dvipng program or imagemagick suite is used to create images, any LaTeX environment will be handled.