- publishing free software manuals
 The Org Mode 7 Reference Manual by Carsten Dominik and others Paperback (6"x9"), 282 pagesISBN 9781906966089RRP £9.95 ($14.95) Sales of this book support the Org project! Get a printed copy>>> ### 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 backends. When exporting to LaTeX, the code is obviously left as it is. When exporting to HTML, Org invokes the MathJax library (see section 12.5.6 Math formatting in HTML export) to process and display the math.(100) Finally, it can also process the mathematical expressions into images(101) that can be displayed in a browser or in DocBook documents. LaTeX fragments don't need any special marking at all. The following snippets will be identified as LaTeX source code: • Environments of any kind.(102) The only requirement is that the \begin statement appears on a new line, preceded by only whitespace. • Text within the usual LaTeX math delimiters. To avoid conflicts with currency specifications, single ‘$’ characters are only recognized as math delimiters if the enclosed text contains at most two line breaks, is directly attached to the ‘$’ characters with no whitespace in between, and if the closing ‘$’ is followed by whitespace, punctuation or a dash. For the other delimiters, there is no such restriction, so when in doubt, use ‘$$...$$’ as inline math delimiters.

For example:

$$% arbitrary environments, x=\sqrt{b} % even tables, figures$$              % etc

If $a^2=b$ and $$b=2$$, then the solution must be
either $$a=+\sqrt{2}$$ or $a=-\sqrt{2}$.


If you need any of the delimiter ASCII sequences for other purposes, you can configure the option org-format-latex-options to deselect the ones you do not wish to have interpreted by the LaTeX converter.

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

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

 ISBN 9781906966089 The Org Mode 7 Reference Manual See the print edition