Previous: Previewing LaTeX fragments, Up: Embedded LaTeX [Contents][Index]

#### 11.7.5 Using CDLaTeX to enter math

CDLaTeX mode is a minor mode that is normally used in combination with a major LaTeX mode like AUCTeX in order to speed-up insertion of environments and math templates. Inside Org mode, you can make use of some of the features of CDLaTeX mode. You need to install `cdlatex.el` and `texmathp.el` (the latter comes also with AUCTeX) from http://www.astro.uva.nl/~dominik/Tools/cdlatex. Don’t use CDLaTeX mode itself under Org mode, but use the light version `org-cdlatex-mode` that comes as part of Org mode. Turn it on for the current buffer with `M-x org-cdlatex-mode RET`, or for all Org files with

    (add-hook 'org-mode-hook 'turn-on-org-cdlatex)

When this mode is enabled, the following features are present (for more details see the documentation of CDLaTeX mode):

- Environment templates can be inserted with `C-c {`.
- The `TAB` key will do template expansion if the cursor is inside a LaTeX fragment131. For example, `TAB` will expand `fr` to `\frac{}{}` and position the cursor correctly inside the first brace. Another `TAB` will get you into the second brace. Even outside fragments, `TAB` will expand environment abbreviations at the beginning of a line. For example, if you write ‘`equ`’ at the beginning of a line and press `TAB`, this abbreviation will be expanded to an `equation` environment. To get a list of all abbreviations, type `M-x cdlatex-command-help RET`.
- Pressing `_` and `^` inside a LaTeX fragment will insert these characters together with a pair of braces. If you use `TAB` to move out of the braces, and if the braces surround only a single character or macro, they are removed again (depending on the variable `cdlatex-simplify-sub-super-scripts`).
- Pressing the grave accent ``` followed by a character inserts math macros, also outside LaTeX fragments. If you wait more than 1.5 seconds after the grave accent, a help window will pop up.
- Pressing the apostrophe `'` followed by another character modifies the symbol before point with an accent or a font. If you wait more than 1.5 seconds after the apostrophe, a help window will pop up. Character modification will work only inside LaTeX fragments; outside the quote is normal.

#### Footnotes

### (131)

Org mode has a method to test if the cursor is inside such a fragment, see the documentation of the function `org-inside-LaTeX-fragment-p`.

Previous: Previewing LaTeX fragments, Up: Embedded LaTeX [Contents][Index]