Lugaru's Epsilon Programmer's Editor 14.00
Context:
|
Epsilon User's Manual and Reference > Commands by Topic > Language Modes > TeX and LaTeX ModesEpsilon 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 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 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
Some TeX mode commands are slightly different in LaTeX than in pure
TeX. Set tex-force-latex to
When the cursor is on a delimiter character like 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. 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. Running TeX The compile-buffer command (normally on Alt-F3) uses the compile-tex-cmd variable in TeX mode and the compile-latex-cmd variable in LaTeX mode. (We'll just say "TeX" from now on, but we mean either TeX or LaTeX or any comparable program like pdfLaTeX or XeTeX.) You may need to set these if the version of TeX you use takes some different flags. By default Epsilon uses flags that keep TeX from prompting for input on errors, display error messages in a format other programs can read, and enable SyncTeX and source specials for integrating a viewer with Epsilon. You could also use a definition that runs TeX and then displays the resulting output file, but the details depend on which viewer you want to use. If your TeX system uses a compatible DVI previewer, or you have a PDF viewer that works with the SyncTeX system, then you can configure your viewer and Epsilon to work together, jumping from any line in your .tex source file to the resulting TeX output in your viewer (forward sync), or jumping from a spot in your viewer back to the .tex code that produced it (reverse sync). This requires some setup. We'll describe reverse sync first.
For SyncTeX, add the flag
EnableTeXEnhancements = true The above setting lets you double-click on text in your PDF and have Epsilon display the corresponding TeX file and line that produced it.
Similarly, to link a DVI previewer to Epsilon, you
must first instruct TeX or LaTeX to include "source specials" in
your DVI file; these let your DVI viewer know which parts of the DVI
file correspond to particular .tex file names and line numbers. Most
versions of TeX understand flags like
Once you've set up TeX to use source specials, as above, you can
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 For yap, use the View/Options/Inverse Search command to set the command line as above. You may need to include the full path to Epsilon. Double-click in yap to have Epsilon display the source file that generated the DVI text you're viewing.
For xdvi, you can run it with its
In Epsilon, forward sync (jumping from your .tex source file to the
corresponding TeX output in your DVI or PDF viewer) uses the
jump-to-dvi command on Alt-Shift-J. Or you can hold down Ctrl
and left-click the mouse on your TeX source. First, enable source
specials or SyncTeX support, respectively, as explained above. Then
you'll need to configure Epsilon. Set the jump-to-dvi-extension
variable to either "
Once both those Epsilon variables have been set appropriately, you can use TeX mode's jump-to-dvi command via Alt-Shift-J or Ctrl-left-click to view the DVI or PDF output resulting from the current line of TeX or LaTeX. (Under Windows, Epsilon can also communicate with Y&Y's old "DVIWindo" previewer, version 2.1.4 and later, using DDE. For this option, jump-to-dvi-command must be empty. When jump-to-dvi uses DVIWindo, it doesn't prompt; instead, it assumes that if the current TeX source file has no corresponding DVI file, the DVI file is already loaded in DVIWindo.)
For documents made from multiple TeX files, Epsilon can't always
determine the ultimate DVI or PDF file name by examining one of the
component TeX files. You can add a line like " If this command displays the wrong DVI or PDF file, run jump-to-dvi with a numeric prefix argument, which forces it to ask for the correct file name again. An empty response makes Epsilon return to checking separately for each .tex file, as above.
|