Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Commands by Topic
      . . .
      Changing Text
         Inserting and Deleting
         Killing Text
         Clipboard Access
         . . .
         Hex Mode
      Language Modes
         . . .
         Shell Mode
         Tcl Mode
         TeX and LaTeX Modes
         VHDL Mode
         Visual Basic Mode
      More Programming Features
         Navigating in Source Code
         Pulling Words
         Accessing Help
         Context-Sensitive Help
         Commenting Commands
      . . .

Previous   Up    Next
Tcl Mode  Commands by Topic   VHDL Mode


Epsilon User's Manual and Reference > Commands by Topic > Language Modes >

TeX and LaTeX Modes

Epsilon automatically enters either TeX or LaTeX mode when you read a file with an extension of .tex, .ltx, .sty, or (in most cases) .cls. (By default it enters LaTeX mode, but see the tex-force-latex command below.) TeX and LaTeX modes are almost identical, and will be described together.

Keys in TeX/LaTeX mode include Alt-i for italic text, Alt-Shift-I for slanted text, Alt-Shift-T for typewriter, Alt-Shift-B for boldface, Alt-Shift-C for small caps, Alt-Shift-F for a footnote, and Alt-s for a centered line.

Alt-Shift-E prompts for the name of a LaTeX environment, then inserts \begin{env} and \end{env} lines for the one you select. You can press ? to select an environment from a list. (The list of environments comes from the file latex.env, which you can edit.) Alt-Shift-Z searches backwards for the last \begin{env} directive without a matching \end{env} directive. Then it inserts the correct \end{env} directive at point.

For most of these commands, you can highlight a block of text first and Epsilon will insert formatting commands to make the text italic, slanted, etc. or you can use the command and then type the text to be italic, slanted, etc.

By default, Epsilon inserts the appropriate LaTeX 2e/3 command (such as \textit for italic text). Set the variable latex-2e-or-3 to 0 if you want Epsilon to use the LaTeX 2.09 equivalent. (In the case of italic text, this would be \it.)

The keys "{" and "$" insert matched pairs of characters (either {} or $$). When you type \( or \[, TeX/LaTeX mode will insert a matching \) or \], respectively. But if you type "{" just before a non-whitespace character, it inserts only a "{". This makes it easier to surround existing text with braces.

The keys <Comma> and <Period> remove a preceding italic correction \/, the " key inserts the appropriate kind of doublequote sequence like `` or '', and Alt-" inserts an actual " character.

Some TeX mode commands are slightly different in LaTeX than in pure TeX. Set tex-force-latex to 1 if all your documents are LaTeX, 0 if all your documents are TeX, or 2 if Epsilon should determine this on a document-by-document basis. In that case, Epsilon will assume a document is LaTeX if it contains a \begin{document} statement or if it's in a file with an .ltx, .sty, or .cls extension. By default, Epsilon assumes all documents use LaTeX.

When the cursor is on a curly brace or square bracket character like {, }, [, or ], Epsilon will try to locate its matching character and highlight them both. If the current character has no match, Epsilon will not highlight it. Set the variable auto-show-tex-delimiters to zero to disable this feature.

Set the variable tex-look-back to a bigger number if you want TeX mode to more accurately syntax highlight very large paragraphs but be slower, or a smaller number if you want recoloring to be faster but perhaps miscolor large paragraphs. You can customize syntax highlighting using the variables latex-display-math-env-pat, latex-math-env-pat, and latex-non-text-argument.

The compile-buffer command uses the compile-tex-cmd variable in TeX mode and the compile-latex-cmd variable in LaTeX mode. You may need to set these if the version of TeX or LaTeX you use takes some different flags. The MiKTeX version of TeX and LaTeX for Windows, for instance, works well with Epsilon if you use the flags "-c-style-errors -interaction=nonstopmode".

If your TeX system uses a compatible DVI previewer, then you can use Epsilon's jump-to-dvi command to see the DVI output resulting from the current line of TeX or LaTeX. This requires some setup so that the DVI file contains TeX source file line number data. See the jump-to-dvi command for details. With such setup, you can also configure your DVI viewer to run Epsilon, showing the source file and line corresponding to a certain spot in your DVI file. The details depend on your DVI viewer, but a command line like epsilon -add +%l %f is typical.

You can use the list-definitions command to see a list of LaTeX labels in the current file and move to one. The tagging commands (see Tags) also work on labels. See the latex-tag-keywords variable if you want to make these work on cite tags too, or make other tagging customizations.

In LaTeX mode, the spell checker uses the latex-spell-options variable. Also see the latex-non-text-argument variable to control how the spell checker treats the parameter of LaTeX commands like \begin that can take keywords. In TeX mode, the spell checker uses the tex-spell-options variable.

Standard bindings:

  Alt-i  tex-italic
 Alt-Shift-I  tex-slant
 Alt-Shift-T  tex-typewriter
 Alt-Shift-B  tex-boldface
 Alt-Shift-C  tex-small-caps
 Alt-Shift-F  tex-footnote
 Alt-s  tex-center-line
 Alt-Shift-E  tex-environment
 Alt-Shift-Z  tex-close-environment
 {  tex-left-brace
 $  tex-math-escape
 <Comma>, <Period>  tex-rm-correction
 "  tex-quote
 Alt-"  tex-force-quote
 \(  tex-inline-math
 \[  tex-display-math
   tex-mode
   latex-mode
 Alt-Shift-J  jump-to-dvi
 



Previous   Up    Next
Tcl Mode  Commands by Topic   VHDL Mode


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.