Software: org-tex-define – bcwells.net
This is an Org mode Literate Program, which is tangled (by pressing
C-c C-v t
, in the default keymap with the .org
file loaded) to an
Org mode setup file named define.setup
. The program uses Org mode's
builtin macros, which (apparently) have an undocumented feature of
executing any Emacs Lisp code they contain (tested in Emacs 24.5.1,
Org mode 8.2.10), to define a generic macro when-fmt
for including
code in only specified export formats (and any formats derived from
them). It then uses this to define a preamble
macro for inserting
preamble code in HTML and LaTeX formats, and finally several macros
for each definition command supported by both MathJax and (La)TeX.
The program is available in two formats meant for reading:
The source code for the program is also available, either as a downloadable Org mode file or as a GitHub repository, which also includes the generated HTML, LaTeX, and PDF files for comparison. The README file includes brief usage instructions and information about how you can contribute (if you wish).