[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The most powerful features of AUCTeX may be those allowing you to
run (La)TeX/ConTeXt and other external commands like BibTeX and
makeindex
from within Emacs, viewing and printing the results,
and moreover allowing you to debug your documents.
7.1 Executing Commands | Invoking external commands. | |
7.2 Viewing the formatted output | Invoking external viewers. | |
7.3 Catching the errors | Debugging TeX and LaTeX output. | |
7.4 Checking for problems | Checking the document. | |
7.5 Controlling the output | Controlling the processes. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Formatting the document with TeX, LaTeX or ConTeXt, viewing
with a previewer, printing the document, running BibTeX, making an
index, or checking the document with lacheck
or
chktex
all require running an external command.
There are two ways to run an external command, you can either run it on
all of the current documents with TeX-command-master
, or on the
current region with TeX-command-region
. A special case of
running TeX on a region is TeX-command-buffer
which differs
from TeX-command-master
if the current buffer is not its own
master file.
TeX-master
. The available commands are
controlled by the variable TeX-command-list
.
See section 2. Installing AUCTeX, for a discussion about TeX-command-list
and
8. Multifile Documents for a discussion about TeX-master
.
transient-mark-mode
), use the old region. The name
of the region file is controlled by the variable TeX-region
. The
name of the master file is controlled by the variable TeX-master
.
The header is all text up to the line matching the regular expression
TeX-header-end
. The trailer is all text from the line matching
the regular expression TeX-trailer-start
. The available commands
are controlled by the variable TeX-command-list
.
transient-mark-mode
active, where marks get disabled
automatically, the region would need to get properly set before each
call to TeX-command-region
. If you fix the current region with
C-c C-t C-r, then it will get used for more commands even though
mark and point may change. An explicitly activated mark, however, will
always define a new region when calling TeX-command-region
.
AUCTeX will allow one process for each document, plus one process for the region file to be active at the same time. Thus, if you are editing n different documents, you can have n plus one processes running at the same time. If the last process you started was on the region, the commands described in 7.3 Catching the errors and 7.5 Controlling the output will work on that process, otherwise they will work on the process associated with the current document.
AUCTeX will try to guess what command you want to invoke, but by
default it will assume that you want to run TeX in TeX mode and
LaTeX in LaTeX mode. You can overwrite this by setting the
variable TeX-command-default
.
TeX-command-list
.
If you want to overwrite the values of TeX-header-end
,
TeX-trailer-start
, or TeX-command-default
, you can do that
for all files by setting them in either TeX-mode-hook
,
plain-TeX-mode-hook
, or LaTeX-mode-hook
. To overwrite
them for a single file, define them as file variables (see section `File Variables' in The Emacs Editor). You do this by putting special
formatted text near the end of the file.
%%% Local Variables: %%% TeX-header-end: "% End-Of-Header" %%% TeX-trailer-start: "% Start-Of-Trailer" %%% TeX-command-default: "SliTeX" %%% End: |
AUCTeX will try to save any buffers related to the document, and
check if the document needs to be reformatted. If the variable
TeX-save-query
is non-nil, AUCTeX will query before saving
each file. By default AUCTeX will check emacs buffers associated
with files in the current directory, in one of the
TeX-macro-private
directories, and in the TeX-macro-global
directories. You can change this by setting the variable
TeX-check-path
.
If nil, just check the current file. Used when checking if any files have changed.
TeX-PDF-mode
to give it a
different default. The default is used when AUCTeX does not have
additional clue about what a document might want. This option usually
results in calling either PDFTeX or ordinary TeX.
\pdfoutput=0
. This makes it possible to use
packages like `pdfcprot' even when producing DVI
files. Some modern TeX distributions, e.g. teTeX 3.0, do this
anyway, so that you need not enable it within AUCTeX.
TeX-interactive-mode
to give it a different default. In
interactive mode, TeX will pause with an error prompt when errors are
encountered and wait for the user to type something.
You can permanently activate TeX-source-specials-mode
with
(TeX-source-specials-mode 1) |
TeX-source-specials-mode
.
There is a bunch of customization options, use customize-group
on
the group `TeX-source-specials' to find out more.
It has to be stressed very strongly however, that Source Specials can cause differences in page breaks, in spacing, can seriously interfere with various packages and should thus never be used for the final version of a document. In particular, fine-tuning the page breaks should be done with Source Specials switched off.
omega
will be used instead of tex
, and
lambda
instead of latex
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
AUCTeX allows you to start external programs for previewing your document. These are normally invoked by pressing C-c C-c once the document is formatted or via the respective entry in the Command menu.
AUCTeX will try to guess which type of viewer (DVI, PostScript or PDF) has to be used and what options are to be passed over to it. This decision is based on the output files present in the working directory as well as the class and style options used in the document. For example, if there is a DVI file in your working directory, a DVI viewer will be invoked. In case of a PDF file it will be a PDF viewer. If you specified a special paper format like `a5paper' or use the `landscape' option, this will be passed to the viewer by the appropriate options. Especially some DVI viewers depend on this kind of information in order to display your document correctly. In case you are using `pstricks' or `psfrag' in your document, a DVI viewer cannot display the contents correctly and a PostScript viewer will be invoked instead.
The information about which file types and style options are
associated with which viewers and options for them is stored in the
variables TeX-output-view-style
and TeX-view-style
.
TeX-view
, bound to C-c C-v, starts a viewer
without confirmation. The viewer is started either on a region or the
master file, depending on the last command issued. This is especially
useful for jumping to the location corresponding to point in the
DVI viewer when using TeX-source-specials-mode
.
TeX-output-view-style
which does not allow the specification of
output file extensions. It is used as a fallback in case none of the
alternatives specified in TeX-output-view-style
match. In case
none of the entries in TeX-view-style
match either, no suggestion
for a viewer will be made.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can make use of forward and inverse searching if this is supported
by your DVI viewer and you enabled
TeX-source-specials-mode
as described in 7.1 Executing Commands.
AUCTeX will automatically pass the
necessary command line options to the viewer in order to display the
page containing the content you are currently editing (forward search).
Upon opening the viewer you will be asked if you want to start a server
process (Gnuserv or Emacs server) which is necessary for inverse search.
This happens only if there is no server running already. You can
customize the variable TeX-source-specials-view-start-server
to
inhibit the question and always or never start the server respectively.
Once the server and the viewer are running you can use a mouse click in
the viewer to jump to the corresponding part of your document in Emacs
(inverse search). Refer to the documentation of your viewer to find out
what you have to do exactly. In xdvi you usually have to use
C-down-mouse-1.
TeX-source-specials-mode
is active and a DVI viewer
is invoked, the default behavior is to ask if a server process should be
started. Set this variable to t
if the question should be
inhibited and the server should be started always. Set it to nil
if the server should never be started. Inverse search will not be
available in the latter case.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Once you've formatted your document you may `debug' it, i.e. browse through the errors (La)TeX reported.
Normally AUCTeX will only report real errors, but you may as well ask it to report `bad boxes' as well.
As default, AUCTeX will display that special `*help*' buffer containing the error reported by TeX along with the documentation. There is however an `expert' option, which allows you to display the real TeX output.
TeX-next-error
(C-c `).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Running TeX or LaTeX will only find regular errors in the
document, not examples of bad style. Furthermore, description of the
errors may often be confusing. The utility lacheck
can be used
to find style errors, such as forgetting to escape the space after an
abbreviation or using `...' instead of `\ldots' and many other
problems like that. You start lacheck
with C-c C-c Check
RET. The result will be a list of errors in the
`*compilation*' buffer. You can go through the errors with
C-x ` (next-error
, see section `Compilation' in The Emacs Editor), which will move point to the location of the next error.
Another newer program which can be used to find errors is chktex
.
It is much more configurable than lacheck
, but doesn't find all
the problems lacheck
does, at least in its default configuration.
You must install the programs before using them, and for chktex
you must also modify TeX-command-list
. You can get
lacheck
from
`<URL:ftp://ftp.ctan.org/tex-archive/support/lacheck/>' or
alternatively chktex
from
`<URL:ftp://ftp.ctan.org/tex-archive/support/chktex/>'. Search for
`chktex' in `tex.el' to see how to switch between them.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A number of commands are available for controlling the output of an application running under AUCTeX
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by XEmacs shared group account on December, 19 2009
using texi2html 1.65.