;; cdlatex.el -- Major Mode for editing LaTeX files ;; ;; CDLaTeX is a minor mode supporting fast insertion of environment ;; templates and math stuff in LaTeX. It comes with an automatic help ;; feature, usefull to learn about math bindings. ;; ;; OVERVIEW ;; ======== ;; ;; CDLaTeX is a minor mode supporting mainly mathematical and scientific ;; text development in LaTeX. It is really about speed. AUCTeX (the major ;; mode I recommend for editing LaTeX files) does have a hook based system ;; for inserting environments and macros. While this is useful to learn, ;; it is slow sometimes. CDLaTeX tries to be quick, with very few and easy ;; to remember keys. ;; ;; 1. ENVIRONMENT TEMPLATES WITH AUTOMATIC LABELS. Typing `C-c {' ;; (cdlatex-environment) reads the name of an environment to insert into ;; the buffer. These environments come with automatic labels where ;; needed (RefTeX is required for this). is a good way to move ;; around in templates. The more common environments are actually ;; available with their own keyword commands (see below), where the ;; keyword usually is the first 3 letters of the environment name: `env' ;; is equivalent to `C-c {', `equ' for equation, `eqn' for eqnarray, ;; `ite' for itemize and `enu' for enumerate, `ali' for align etc. ;; So tying `equ' is probably the fastest way to get an equation ;; environment with label into the buffer. ;; ;; 2. MATHEMATICAL SYMBOLS. This feature is similar to the functionality ;; in the Math minor mode of AUCTeX. It is introduced by the backquote ;; character. Backquote followed by any character inserts a TeX math ;; character into the buffer. If necessary, a pair of '$' is inserted ;; to switch to LaTeX math mode. There are several levels of symbols ;; available. You may cycle through the levels by pressing backquote ;; several times. On all levels, on-thy-fly help will pop up ;; automatically if you hesitate to press the next key. The symbols ;; available are configurable. See documentation of the variable ;; `cdlatex-math-symbol-alist'. For even faster access to the symbols ;; you can bind them in a configurable way to other keys. See the ;; variable `cdlatex-math-symbol-direct-bindings'. By default, level 1 ;; symbols get bound to `A-a', `A-b', etc., unless your ALT key is used ;; as META by Emacs. ;; ;; 3. ACCENTS AND FONTS. Putting accents on mathematical characters and/or ;; changing the font of a character or word is very easy with CDLaTeX. ;; After the character is in the buffer, you press the quote character ;; followed by a key character for the accent. E.g. typing a'~ inserts ;; \tilde{a}, a': inserts \ddot{a}, a'c inserts {\cal a} etc. Typing a't ;; will insert either \texttt{a} or \mathtt{a}, depending on whether ;; point is in math mode or not. If the character before point is white ;; space, a dollar or an opening parenthesis, this command just opens an ;; empty template and positions the cursor inside. In order to insert a ;; normal quote, you need to press the quote character twice. The ;; available accents can be configured - see documentation of the ;; variable cdlatex-math-modify-alist. ;; ;; 4. PAIR INSERTION of () [] {} $$. Dollars and parens can be inserted as ;; pairs when they are mentioned in the configuration variable ;; cdlatex-paired-parens. The cursor is always positioned inside the ;; pair afterwards. is a good way to move out there again. ;; ;; 5. KEYWORD COMMANDS. Some commands in cdlatex are also (or only) ;; available by typing a keyword into the buffer and hitting . The ;; keyword will be removed from the buffer and the associated command ;; executed. A full list of commands is available with the command ;; `C-c ?' (cdlatex-command-help). ;; ;; 6. MATH TEMPLATES. Typing a keyword followed by `' also inserts ;; simple templates into the buffer. The cursor will be positioned ;; properly. For example, typing `fr' will insert `\frac{}{}' with ;; the cursor in the first pair of parenthesis. Typing `lr(' will ;; insert a `\left( \right)' pair and position the cursor in ;; between. Etc. `' is the preferred way to move through the ;; templates. For example in the `\frac{}{}' template, it will move you ;; from the first argument to the second and then out of the second. ;; For a full list of available templates, type `C-c ?' ;; (cdlatex-command-help) in a buffer where CDLaTeX mode is active. ;; ;; 7. Have you noticed that we use TAB all the time here? TAB is your ;; friend. ;; ;; ;; KEY BINDINGS ;; ;; Here is the default set of keybindings from CDLaTeX. Under X, some of ;; these function will also show up in the LaTeX menu. ;; ;; $ cdlatex-dollar ;; ( cdlatex-pbb ;; { cdlatex-pbb ;; [ cdlatex-pbb ;; | cdlatex-pbb ;; < cdlatex-pbb ;; ^ cdlatex-sub-superscript ;; _ cdlatex-sub-superscript ;; ;; TAB cdlatex-tab ;; C-c ? cdlatex-command-help ;; C-c { cdlatex-environment ;; C-c - cdlatex-item ;; ` cdlatex-math-symbol ;; ' cdlatex-math-modify ;; A-CHAR first level of math symbols ;; C-A-CHAR second level of math symbols ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AVAILABLE KEYWORD COMMANDS WITH CDLaTeX -------------------------------------- To execute, type keyword into buffer followed by TAB. pref Make page reference TEXT/MATH ref Make reference TEXT/MATH cmdhelp Show description of commands in help buffer TEXT/MATH lbl Insert automatic label at point TEXT/MATH ct Insert \cite TEXT/ cte Make a citation interactively TEXT/ cite{ Make a citation interactively TEXT/ beg Complete an environment name and insert template TEXT/MATH env Complete an environment name and insert template TEXT/MATH ite Insert an ITEMIZE environment template TEXT/ enu Insert an ENUMERATE environment template TEXT/ equ Insert an EQUATION environment template TEXT/ eqn Insert an EQUATION environment template TEXT/ ali Insert an ALIGN environment template TEXT/ ali* Insert an ALIGN* environment template TEXT/ alit Insert an ALIGNAT environment template TEXT/ alit* Insert an ALIGNAT* environment template TEXT/ xal Insert an XALIGNAT environment template TEXT/ xal* Insert an XALIGNAT* environment template TEXT/ xxa Insert an XXALIGNAT environment template TEXT/ xxa* Insert an XXALIGNAT environment template TEXT/ mul Insert an MULTINE environment template TEXT/ mul* Insert an MULTINE* environment template TEXT/ gat Insert an GATHER environment template TEXT/ gat* Insert an GATHER* environment template TEXT/ fla Insert an FLALIGN environment template TEXT/ fla* Insert an FLALIGN* environment template TEXT/ sn Insert a \section{} statement TEXT/ ss Insert a \subsection{} statement TEXT/ sss Insert a \subsubsection{} statement TEXT/ pf Insert a \paragraph{} statement TEXT/ sp Insert a \subparagraph{} statement TEXT/ ssp Insert a \subsubparagraph{} statement TEXT/ lr( Insert a \left( \right) pair /MATH lr[ Insert a \left[ \right] pair /MATH lr{ Insert a \left{ \right} pair /MATH lr< Insert a \left\langle \right\rangle pair /MATH lr| Insert a \left| \right| pair /MATH caseeq Insert a = { construct /MATH fr Insert \frac{}{} /MATH sq Insert \sqrt{} /MATH intl Insert \int\limits_{}^{} /MATH suml Insert \sum\limits_{}^{} /MATH nonum Insert \nonumber\\ /MATH fn Make a footnote TEXT/ qq Insert \quad TEXT/MATH qqq Insert \qquad TEXT/MATH =============================================================================== Symboly s ` =============================================================================== ` `` ``` =============================================================================== a \alpha A \forall \aleph b \beta B c \cos C \arccos d \delta \partial D \Delta \nabla e \epsilon \varepsilon \exp E \exists \ln f \phi \varphi F g \gamma \lg G \Gamma 10^{} h \eta \hbar H i \in \imath I \Im j \jmath J k \kappa K l \lambda \ell \log L \Lambda m \mu M n \nu \ln N \nabla \exp o \omega O \Omega \mho p \pi \varpi P \Pi q \theta \vartheta Q \Theta r \rho \varrho R \Re s \sigma \varsigma \sin S \Sigma \arcsin t \tau \tan T \arctan u \upsilon U \Upsilon v \vee V \Phi w \xi W \Xi x \chi X y \psi Y \Psi z \zeta Z 0 \emptyset 1 2 3 4 5 6 7 8 \infty 9 ! \neg @ # $ % ^ \uparrow & \wedge \ ~ \approx \simeq _ \downarrow + \cup - \leftrightarrow \longleftrightarrow * \times / \not | \mapsto \longmapsto \ \setminus \ = \Leftrightarrow \Longleftrightarrow \ \langle \ \rangle \[ \Leftarrow \Longleftarrow \] \Rightarrow \Longrightarrow { \subset } \supset < \leftarrow \longleftarrow \min > \rightarrow \longrightarrow \max ` ' \prime . \cdot =============================================================================== Symboly s ' =============================================================================== . \dot : \ddot ~ \tilde N \widetilde ^ \hat H \widehat - \bar T \overline _ \underline { \overbrace } \underbrace > \vec / \grave \ \acute v \check u \breve m \mbox c \mathcal r \mathrm \textrm i \mathit \textit s \textsl b \mathbf \textbf e \mathem \emph t \mathtt \texttt f \mathsf \textsf 0 \textstyle 1 \displaystyle 2 \scriptstyle 3 \scriptscriptstyle