Emacs - CDLaTeX

Introduction

CDLaTeX1 is a minor mode for fast LaTeX environment and macro insertion2. In this sense, its functionalities are very similar to AUCTeX3. What's more, some of its convenience provided are also covered by AUCTeX.

Installation

The package of cdlatex is available at melpa, which can be easily installed.

Configuration

If AUCTeX is installed, CDLaTeX can be activated on top of it via

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

Otherwise, CDLaTeX can be directly turned on with latex mode, i.e.,

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

Org

In org mode, instead of CDLaTeX itself, its light version org-cdlatex-mode should be used, which depends on cdlatex.el (in package CDLaTeX) and texmathp (in package AUCTeX). To automatically turn it on in a org file, add the following line in the emacs configuration file, e.g., ~/init.el.

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

Usage

Keybinding

KeybindingFunctionality
C-c ?cdlatex-command-help
C-c {cdlatex-environment
C-c -cdlatex-item
$cdlatex-dollar
(cdlatex-pbb
[cdlatex-pbb
{cdlatex-pbb
|cdlatex-pbb
<cdlatex-pbb
^cdlatex-sub-superscript
_cdlatex-sub-superscript
TABcdlatex-tab
`cdlatex-math-symbol
'cdlatex-math-modify

Backquote (`) + character

By CDLaTeX, mathematical symbols can be easily input by a backquote (`) followed by a character. In order to support more mathematical symbols, CDLaTeX defines 3 different levels, which can be entered by a different number of backquotes before a character.

Prefix + TAB

CDLaTeX can automatically expand a variety of prefix + TAB bindings as follows.

PrefixFunctionality
prefMake page reference
refMake reference
lblInsert automatic label at point
ctInsert \cite
cteMake a citation interactively
cite{Make a citation interactively
begComplete an environment name and insert template
envComplete an environment name and insert template
itNew item in current environment
iteInsert an ITEMIZE environment template
enuInsert an ENUMERATE environment template
equInsert an EQUATION environment template
eqnInsert an EQUATION environment template
aliInsert an ALIGN environment template
ali*Insert an ALIGN* environment template
alitInsert an ALIGNAT environment template
alit*Insert an ALIGNAT* environment template
xalInsert a XALIGNAT environment template
xal*Insert a XALIGNAT* environment template
xxaInsert a XXALIGNAT environment template
xxa*Insert a XXALIGNAT environment template
mulInsert a MULTINE environment template
mul*Insert a MULTINE* environment template
gatInsert a GATHER environment template
gat*Insert a GATHER* environment template
flaInsert a FLALIGN environment template
fla*Insert a FLALIGN* environment template
fgInsert a FIGURE environment template
snInsert a \section{} statement
ssInsert a \subsection{} statement
sssInsert a \subsubsection{} statement
pfInsert a \paragraph{} statement
spInsert a \subparagraph{} statement
sspInsert a \subsubparagraph{} statement
clInsert \centerline
incInsert \includegraphics with file name
lr(Insert a \left( \right) pair
lr[Insert a \left[ \right] pair
lr{Insert a \left{ \right} pair
lr<Insert a \left\langle \right\rangle pair
caseeqInsert a = { construct
frInsert \frac{}{}
sqInsert \sqrt{}
intlInsert \int\limits_{}^{}
sumlInsert \sum\limits_{}^{}
nonumInsert \nonumber\\
fnMake a footnote
qqInsert \quad
qqqInsert \qquad

Footnotes

Table of Contents