[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex dfd6585 33/34: Merge remote-track
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex dfd6585 33/34: Merge remote-tracking branch 'origin/master' into externals/auctex |
Date: |
Sun, 6 Jun 2021 11:40:07 -0400 (EDT) |
branch: externals/auctex
commit dfd6585ad8420da1b29eac0171de38a4df6f6c6a
Merge: 3e163e5 cd63c11
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>
Merge remote-tracking branch 'origin/master' into externals/auctex
---
Makefile.in | 6 +-
doc/auctex.texi | 822 ++++++++++++++++++++++++-----------------
doc/changes.texi | 175 ++++-----
doc/faq.texi | 19 +-
doc/install.texi | 128 ++++---
doc/preview-faq.texi | 25 +-
doc/preview-latex.texi | 88 ++---
doc/preview-problems.texi | 7 +-
doc/preview-readme.texi | 13 +-
doc/preview-todo.texi | 12 +-
doc/quickstart.texi | 57 +--
doc/todo.texi | 39 +-
doc/wininstall.texi | 51 +--
font-latex.el | 41 +-
latex.el | 478 +++++++++++++++++++++++-
preview.el | 3 +-
style/algorithm.el | 33 +-
style/beamer.el | 7 +-
style/bicaption.el | 4 +-
style/brazil.el | 37 ++
style/brazilian.el | 77 ++++
style/caption.el | 4 +-
style/currvita.el | 3 +-
style/doc.el | 2 +-
style/enumitem.el | 3 +-
style/graphicx.el | 3 +
style/kpfonts.el | 4 +-
style/latexinfo.el | 183 ---------
style/longtable.el | 2 +-
style/moodle.el | 5 +-
style/pdfpages.el | 3 +-
style/portuges.el | 37 ++
style/portuguese.el | 78 ++++
style/subcaption.el | 4 +-
style/tcolorboxlib-raster.el | 3 +-
style/thmtools.el | 4 +-
style/xltabular.el | 2 +-
tests/latex/font-latex-test.el | 17 +
tex-buf.el | 511 ++++---------------------
tex-fold.el | 4 +-
tex-info.el | 8 +-
tex-jp.el | 2 +-
tex.el | 51 +--
43 files changed, 1675 insertions(+), 1380 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 1eda319..5b5a49d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -91,7 +91,7 @@ STYLESRC = style/prosper.el \
style/slides.el style/foils.el style/amstex.el \
style/article.el style/book.el style/letter.el \
style/report.el style/amsart.el style/amsbook.el \
- style/epsf.el style/psfig.el style/latexinfo.el \
+ style/epsf.el style/psfig.el \
style/dutch.el style/german.el style/dk.el \
style/j-article.el style/j-book.el style/j-report.el \
style/jarticle.el style/jbook.el style/jreport.el \
@@ -174,7 +174,9 @@ STYLESRC = style/prosper.el \
style/ltxguide.el style/revtex4-2.el style/overpic.el \
style/tex-live.el style/algorithm.el style/algpseudocode.el \
style/appendix.el style/scholax.el style/extramarks.el \
- style/truncate.el style/changes.el style/footnotehyper.el
+ style/truncate.el style/changes.el style/footnotehyper.el \
+ style/brazil.el style/brazilian.el style/portuguese.el \
+ style/portuges.el
STYLEELC = $(STYLESRC:.el=.elc)
diff --git a/doc/auctex.texi b/doc/auctex.texi
index fbd64cb..5f01ba1 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -10,9 +10,9 @@
@copying
This manual is for @AUCTeX{}
(version @value{VERSION} from @value{UPDATED}),
-a sophisticated TeX environment for Emacs.
+a sophisticated @TeX{} environment for Emacs.
-Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2020
+Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2021
Free Software Foundation, Inc.
@quotation
@@ -88,7 +88,8 @@ It is a good idea to make a printout of @AUCTeX{}'s reference
card
@file{tex-ref.tex} or one of its typeset versions.
If you want to make @AUCTeX{} aware of style files and multi-file
-documents right away, insert the following in your @file{.emacs} file.
+documents right away, insert the following in your init file (usually
+@file{~/.emacs.d/init.el}).
@lisp
(setq TeX-auto-save t)
@@ -98,8 +99,8 @@ documents right away, insert the following in your
@file{.emacs} file.
Another thing you should enable is Ref@TeX{}, a comprehensive solution
for managing cross references, bibliographies, indices, document
-navigation and a few other things. (@pxref{Installation,,,reftex,The
-Ref@TeX{} manual})
+navigation and a few other things. (@xref{Installation,,,reftex,The
+Ref@TeX{} manual}.)
For detailed information about the @previewlatex{} subsystem of
@AUCTeX{}, see @ref{Top,,Introduction,preview-latex,The @previewlatex{}
@@ -114,7 +115,7 @@ Bug reports should go to @email{bug-auctex@@gnu.org},
suggestions for
new features, and pleas for help should go to either
@email{auctex-devel@@gnu.org} (the @AUCTeX{} developers), or to
@email{auctex@@gnu.org} if they might have general interest. Please use
-the command @kbd{M-x TeX-submit-bug-report RET} to report bugs if
+the command @kbd{M-x TeX-submit-bug-report @key{RET}} to report bugs if
possible. You can subscribe to a low-volume announcement list by
sending ``subscribe'' in the subject of a mail to
@email{info-auctex-request@@gnu.org}.
@@ -219,7 +220,7 @@ Writing Your Own Style Support
* Simple Style:: A Simple Style File
* Adding Macros:: Adding Support for Macros
* Adding Environments:: Adding Support for Environments
-* Adding Other:: Adding Other Information
+* Adding Other:: Adding or Examining Other Information
* Hacking the Parser:: Automatic Extraction of New Things
Copying, Changes, Development, FAQ
@@ -460,13 +461,16 @@ and @samp{\(...\)} in @LaTeX{} files by pressing @kbd{$},
add the
following to your init file
@lisp
(add-hook 'plain-TeX-mode-hook
- (lambda () (set (make-local-variable 'TeX-electric-math)
- (cons "$" "$"))))
+ (lambda () (set (make-local-variable 'TeX-electric-math)
+ (cons "$" "$"))))
(add-hook 'LaTeX-mode-hook
- (lambda () (set (make-local-variable 'TeX-electric-math)
- (cons "\\(" "\\)"))))
+ (lambda () (set (make-local-variable 'TeX-electric-math)
+ (cons "\\(" "\\)"))))
@end lisp
+Note that Texinfo mode does nothing special for @kbd{$}. It inserts
+dollar sign(s) just in the same way as the other normal keys do.
+
@subheading Braces
To avoid unbalanced braces, it is useful to insert them pairwise. You
@@ -485,9 +489,9 @@ sometimes need to adjust the size of braces with pairs of
macros like
can avoid unbalanced pairs with the help of @code{TeX-insert-macro},
bound to @kbd{C-c C-m} or @kbd{C-c @key{RET}} (@pxref{Completion}).
If you insert left size adjusting macros such as @samp{\left},
-@samp{\bigl} etc. with @code{TeX-insert-macro}, it asks for left brace
+@samp{\bigl} etc.@: with @code{TeX-insert-macro}, it asks for left brace
to use and supplies automatically right size adjusting macros such as
-@samp{\right}, @samp{\bigr} etc. and corresponding right brace in
+@samp{\right}, @samp{\bigr} etc.@: and corresponding right brace in
addtion to the intended left macro and left brace.
The completion by @code{TeX-insert-macro} also applies when entering
@@ -496,7 +500,7 @@ produce the left part of the paired braces. For example,
inserting
@samp{\lfloor} by @kbd{C-c C-m} is immediately followed by the
insertion of @samp{\rfloor}. In addition, if the point was located
just after @samp{\left} or its friends, the corresponding
-@samp{\right} etc. will be inserted in front of @samp{\rfloor}.
+@samp{\right} etc.@: will be inserted in front of @samp{\rfloor}.
In both cases, active region is honored.
As a side effect, when @code{LaTeX-math-mode} (@pxref{Mathematics}) is
@@ -511,6 +515,9 @@ If this option is turned off, the automatic supply of the
right macros
and braces is suppressed.
@end defopt
+@kindex (
+@kindex @{
+@kindex [
When you edit @LaTeX{} documents, you can enable automatic brace
pairing when typing @kbd{(}, @kbd{@{} and @kbd{[}.
@@ -595,7 +602,7 @@ Perhaps the most used keyboard commands of @AUCTeX{} are
the short-cuts
available for easy insertion of font changing macros.
If you give an argument (that is, type @kbd{C-u}) to the font command,
-the innermost font will be replaced, i.e. the font in the @TeX{} group
+the innermost font will be replaced, i.e.@: the font in the @TeX{} group
around point will be changed. The following table shows the available
commands, with @code{@point{}} indicating the position where the text
will be inserted.
@@ -619,17 +626,17 @@ Insert @i{italics} @samp{\textit@{@point{}@}} text.
@item C-c C-f C-e
@kindex C-c C-f C-e
@cindex @code{\emph}
-Insert @i{emphasized} @samp{\emph@{@point{}@}} text.
+Insert @emph{emphasized} @samp{\emph@{@point{}@}} text.
@item C-c C-f C-s
@kindex C-c C-f C-s
@cindex @code{\textsl}
-Insert @i{slanted} @samp{\textsl@{@point{}@}} text.
+Insert @slanted{slanted} @samp{\textsl@{@point{}@}} text.
@item C-c C-f C-r
@kindex C-c C-f C-r
@cindex @code{\textrm}
-Insert roman @samp{\textrm@{@point{}@}} text.
+Insert @r{roman} @samp{\textrm@{@point{}@}} text.
@item C-c C-f C-f
@kindex C-c C-f C-f
@@ -668,7 +675,7 @@ Delete the innermost font specification containing point.
@end table
-@deffn Command TeX-font replace what
+@deffn Command TeX-font @var{replace} @var{what}
@kindex C-c C-f
(@kbd{C-c C-f}) Insert template for font change command.
@@ -701,7 +708,7 @@ structure as @code{TeX-font-list}.
@cindex @code{\label}
Insertion of sectioning macros, that is @samp{\chapter},
-@samp{\section}, @samp{\subsection}, etc. and accompanying
+@samp{\section}, @samp{\subsection}, etc.@: and accompanying
@samp{\label}'s may be eased by using @kbd{C-c C-s}. This command is
highly customizable, the following describes the default behavior.
@@ -769,12 +776,12 @@ List of hooks to run when a new section is inserted.
The following variables are set before the hooks are run
-@table @var
+@vtable @code
@item LaTeX-level
Numeric section level, default set by prefix arg to
@code{LaTeX-section}.
@item LaTeX-name
-Name of the sectioning command, derived from @var{level}.
+Name of the sectioning command, derived from @code{LaTeX-level}.
@item LaTeX-title
The title of the section, default to an empty string.
@item LaTeX-toc
@@ -782,7 +789,7 @@ Entry for the table of contents list, default nil.
@item LaTeX-done-mark
Position of point afterwards, default nil meaning after the inserted
text.
-@end table
+@end vtable
A number of hooks are already defined. Most likely, you will be able to
get the desired functionality by choosing from these hooks.
@@ -790,16 +797,16 @@ get the desired functionality by choosing from these
hooks.
@ftable @code
@item LaTeX-section-heading
Query the user about the name of the sectioning command. Modifies
-@var{LaTeX-level} and @var{LaTeX-name}.
+@code{LaTeX-level} and @code{LaTeX-name}.
@item LaTeX-section-title
-Query the user about the title of the section. Modifies @var{LaTeX-title}.
+Query the user about the title of the section. Modifies @code{LaTeX-title}.
@item LaTeX-section-toc
-Query the user for the toc entry. Modifies @var{LaTeX-toc}.
+Query the user for the toc entry. Modifies @code{LaTeX-toc}.
@item LaTeX-section-section
-Insert @LaTeX{} section command according to @var{LaTeX-name},
-@var{LaTeX-title}, and @var{LaTeX-toc}. If @var{LaTeX-toc} is nil, no
-toc entry is inserted. If @var{LaTeX-toc} or @var{LaTeX-title} are
-empty strings, @var{LaTeX-done-mark} will be placed at the point they
+Insert @LaTeX{} section command according to @code{LaTeX-name},
+@code{LaTeX-title}, and @code{LaTeX-toc}. If @code{LaTeX-toc} is nil, no
+toc entry is inserted. If @code{LaTeX-toc} or @code{LaTeX-title} are
+empty strings, @code{LaTeX-done-mark} will be placed at the point they
should be inserted.
@item LaTeX-section-label
Insert a label after the section command. Controlled by the variable
@@ -811,13 +818,13 @@ To get a full featured @code{LaTeX-section} command,
insert
@lisp
(setq LaTeX-section-hook
'(LaTeX-section-heading
- LaTeX-section-title
- LaTeX-section-toc
- LaTeX-section-section
- LaTeX-section-label))
+ LaTeX-section-title
+ LaTeX-section-toc
+ LaTeX-section-section
+ LaTeX-section-label))
@end lisp
-in your @file{.emacs} file.
+in your init file such as @file{init.el} or @file{.emacs}.
@end defopt
The behavior of @code{LaTeX-section-label} is determined by the
@@ -871,7 +878,7 @@ complete a partially written name, and/or to get a list of
available
environments. After selection of a specific environment @AUCTeX{} may
prompt you for further specifications.
-If the optional argument @var{arg} is not-nil (i.e. you have given a
+If the optional argument @var{arg} is non-nil (i.e.@: you have given a
prefix argument), the current environment is modified and no new
environment is inserted.
@end deffn
@@ -901,7 +908,7 @@ inserted or, as the first choice the value of the variable
@code{LaTeX-default-environment}.
@defopt LaTeX-default-environment
-Default environment to insert when invoking @samp{LaTeX-environment}
+Default environment to insert when invoking @code{LaTeX-environment}
first time. When the current environment is @samp{document}, it is
overriden by @code{LaTeX-default-document-environment}.
@end defopt
@@ -935,8 +942,8 @@ Possible values are nil, t, or a list of style names.
Don't complete expert commands (default).
@item t
Always complete expert commands.
-@item (STYLES @dots{})
-Only complete expert commands of STYLES.
+@item (@var{styles} @dots{})
+Only complete expert commands of @var{styles}.
@end table
@end defopt
@@ -1087,9 +1094,9 @@ inserted using @kbd{C-c @key{LFD}}.
@deffn Command LaTeX-insert-item
@kindex C-c @key{LFD}
(@kbd{C-c @key{LFD}}) Close the current item, move to the next line and
-insert an appropriate @samp{\item} for the current environment. That is,
+insert an appropriate @samp{\item} for the current environment. That is,
`itemize' and `enumerate' will have @samp{\item } inserted, while
-`description' will have @samp{\item[]} inserted.
+`description' will have @samp{\item[] } inserted.
@end deffn
@defopt TeX-arg-item-label-p
@@ -1154,6 +1161,7 @@ environments.
@cindex Mathematics
@cindex Symbols
@cindex Abbreviations
+@vindex LaTeX-math-default
@TeX{} is written by a mathematician, and has always contained good
support for formatting mathematical text. @AUCTeX{} supports this
@@ -1163,7 +1171,7 @@ mathematical symbols. You can enter this mode by typing
@kbd{C-c
@deffn Command LaTeX-math-mode
@kindex C-c ~
-(@kbd{C-c ~}) Toggle LaTeX Math mode. This is a minor mode rebinding
+(@kbd{C-c ~}) Toggle @LaTeX{} Math mode. This is a minor mode rebinding
the key @code{LaTeX-math-abbrev-prefix} to allow easy typing of
mathematical symbols. @kbd{`} will read a character from the keyboard,
and insert the symbol as specified in @code{LaTeX-math-default} and
@@ -1174,8 +1182,8 @@ surrounded by dollar signs.
You can use another prefix key (instead of @kbd{`}) by setting the
variable @code{LaTeX-math-abbrev-prefix}.
-To enable LaTeX Math mode by default, add the following in your
-@file{.emacs} file:
+To enable @LaTeX{} Math mode by default, add the following in your
+init file such as @file{init.el} or @file{.emacs}:
@lisp
(add-hook 'LaTeX-mode-hook #'LaTeX-math-mode)
@end lisp
@@ -1186,13 +1194,13 @@ value defaults to @kbd{`}.
The string has to be a key or key sequence in a format understood by the
@code{kbd} macro. This corresponds to the syntax usually used in the
-manuals for Emacs Emacs Lisp.
+manuals for Emacs Lisp.
@end defopt
The variable @code{LaTeX-math-list} allows you to add your own mappings.
@defopt LaTeX-math-list
-A list containing user-defined keys and commands to be used in LaTeX
+A list containing user-defined keys and commands to be used in @LaTeX{}
Math mode. Each entry should be a list of two to four elements.
First, the key to be used after @code{LaTeX-math-abbrev-prefix} for
@@ -1210,7 +1218,7 @@ alongside the macro name. This is an integer value.
@end defopt
@defopt LaTeX-math-menu-unicode
-Whether the LaTeX menu should try using Unicode for effect. Your Emacs
+Whether the @LaTeX{} Math menu should try using Unicode for effect. Your Emacs
built must be able to display include Unicode characters in menus for
this feature.
@end defopt
@@ -1218,6 +1226,10 @@ this feature.
@AUCTeX{}'s reference card @file{tex-ref.tex} includes a list of all
math mode commands.
+@cindex subscript
+@cindex superscript
+@kindex _
+@kindex ^
@AUCTeX{} can help you write subscripts and superscripts in math
constructs by automatically inserting a pair of braces after typing
@key{_} or @key{^} respectively and putting point between the braces.
@@ -1228,6 +1240,7 @@ In order to enable this feature, set the variable
If non-nil, insert braces after typing @key{^} and @key{_} in math mode.
@end defopt
+@cindex input method
You can automatically turn off input methods, used to input non-ascii
characters, when you begin to enter math constructs.
@@ -1252,7 +1265,7 @@ became the new standard completion facility (see below).
Users of the
wonderful ispell mode know and love the @code{ispell-complete-word}
command from that package. Similarly, @AUCTeX{} has a
@code{TeX-complete-symbol} command, by default bound to
-@kbd{M-@key{TAB}} which is equivalent to @kbd{M-C-i}. Using
+@kbd{M-@key{TAB}} which is equivalent to @kbd{C-M-i}. Using
@code{TeX-complete-symbol} makes it easier to type and remember the
names of long @LaTeX{} macros.
@@ -1297,7 +1310,7 @@ Function to do the actual completion.
@end defvar
More recent Emacs versions have a new completion mechanism. Modes may
-define and register custom completion-at-point functions and when the
+define and register custom @code{completion-at-point} functions and when the
user invokes @code{completion-at-point} (usually bound to
@kbd{M-@key{TAB}}), all such registered functions are consulted for
checking for possible completions. Modern completion UIs like
@@ -1332,6 +1345,10 @@ As a default selection, @AUCTeX{} will suggest the macro
last inserted
or, as the first choice the value of the variable
@code{TeX-default-macro}.
+@defopt TeX-default-macro
+Default macro to insert when invoking @code{TeX-insert-macro} first time.
+@end defopt
+
@defopt TeX-insert-macro-default-style
Specifies whether @code{TeX-insert-macro} will ask for all optional
arguments.
@@ -1343,17 +1360,15 @@ optional argument has been rejected. If set to
optional arguments. @code{mandatory-args-only}, @code{TeX-insert-macro}
asks only for mandatory arguments. When @code{TeX-insert-macro} is
called with prefix argument (@kbd{C-u}), it's the other way round.
+@c FIXME: Now that the option has 3 candidates, it isn't clear what "the
+@c other way round" means.
-Note that for some macros, there are special mechanisms, e.g.
+Note that for some macros, there are special mechanisms, e.g.@:
@code{LaTeX-includegraphics-options-alist} and
@code{TeX-arg-cite-note-p}.
@end defopt
-@defopt TeX-default-macro
-Default macro to insert when invoking @code{TeX-insert-macro} first time.
-@end defopt
-
A faster alternative is to enable the option
@code{TeX-electric-escape}.
@@ -1365,14 +1380,14 @@ In Texinfo mode, the command is invoked by @kbd{@@}
instead.
@end defopt
The difference between @code{TeX-insert-macro} and
-@code{TeX-electric-macro} is that space will complete and exit from the
+@code{TeX-electric-macro} is that space key @key{SPC} will complete and exit
from the
minibuffer in @code{TeX-electric-macro}. Use @key{TAB} if you merely
want to complete.
@deffn Command TeX-electric-macro
Prompt (with completion) for the name of a @TeX{} macro,
and if @AUCTeX{} knows the macro, prompt for each argument.
-Space will complete and exit.
+Space (@key{SPC}) will complete and exit.
@end deffn
By default @AUCTeX{} will put an empty set braces @samp{@{@}} after a
@@ -1393,7 +1408,7 @@ This variable is an alist. Each element is a cons cell,
whose car is
the macro name, and the cdr is non-nil or nil, depending on whether a
pair of braces should be, respectively, appended or not to the macro.
-If a macro has an element in this variable, @code{TeX-parse-macro} will
+If a macro has an element in this variable, @AUCTeX{} will
use its value to decide what to do, whatever the value of the variable
@code{TeX-insert-braces}.
@end defopt
@@ -1416,8 +1431,8 @@ Possible values are nil, t, or a list of style names.
Don't complete expert commands (default).
@item t
Always complete expert commands.
-@item (STYLES @dots{})
-Only complete expert commands of STYLES.
+@item (@var{styles} @dots{})
+Only complete expert commands of @var{styles}.
@end table
@end defopt
@@ -1435,7 +1450,7 @@ example existing labels when you enter a @samp{\ref}
macro with
@code{TeX-insert-macro} or @code{TeX-electric-macro}, and Bib@TeX{}
entries when you enter a @samp{\cite} macro. For this kind of
completion to work, parsing must be enabled as described in
-@pxref{Parsing Files}. For @samp{\cite} you must also make sure that
+@ref{Parsing Files}. For @samp{\cite} you must also make sure that
the Bib@TeX{} files have been saved at least once after you enabled
automatic parsing on save, and that the basename of the Bib@TeX{} file
does not conflict with the basename of one of @TeX{} files.
@@ -1446,18 +1461,18 @@ does not conflict with the basename of one of @TeX{}
files.
You can mark the current environment by typing @kbd{C-c .}, or the
current section by typing @kbd{C-c *}.
-In Texinfo documents you can type @kbd{M-C-h} to mark the current node.
+In Texinfo documents you can type @kbd{C-M-h} to mark the current node.
When the region is set, the point is moved to its beginning and the mark
to its end.
@menu
-* Marking (LaTeX):: LaTeX Commands for Marking Environments and Sections
+* Marking (LaTeX):: @LaTeX{} Commands for Marking Environments and Sections
* Marking (Texinfo):: Texinfo Commands for Marking Environments, Sections, and
Nodes
@end menu
@node Marking (LaTeX)
-@subsection LaTeX Commands for Marking Environments and Sections
+@subsection @LaTeX{} Commands for Marking Environments and Sections
@deffn Command LaTeX-mark-section
@kindex C-c *
@@ -1488,6 +1503,8 @@ unbalanced begin-end pairs in comments and verbatim
environments.
(@kbd{C-c *}) Mark the current section, with inclusion of any containing
node.
+@vindex outline-regexp
+@vindex texinfo-section-list
The current section is detected as starting by any of the structuring
commands matched by the regular expression in the variable
@code{outline-regexp} which in turn is a regular expression matching any
@@ -1495,7 +1512,7 @@ element of the variable @code{texinfo-section-list}.
With a non-nil prefix argument, mark only the region from the current
section start to the next sectioning command. Thereby subsections are
-not being marked. Otherwise, any included subsections are also marked
+not being marked. Otherwise, any included subsections are also marked.
Note that when the current section is starting immediately after a node
command, then the node command is also marked as part of the section.
@@ -1512,8 +1529,8 @@ unbalanced begin-end pairs in comments and verbatim
environments.
@end deffn
@deffn Command Texinfo-mark-node
-@kindex M-C-h
-(@kbd{M-C-h}) Mark the current node. This is the node in which point is
+@kindex C-M-h
+(@kbd{C-M-h}) Mark the current node. This is the node in which point is
located. It is starting at the previous occurrence of the keyword
@code{@@node} and ending at next occurrence of the keywords
@code{@@node} or @code{@@bye}.
@@ -1585,6 +1602,8 @@ default of @code{newline} which does no indentation to
@code{reindent-then-newline-and-indent} which indents both the current
and the new line.
@vindex TeX-newline-function
+@findex indent-region
+@cindex auto-fill-mode
There are certain @LaTeX{} environments which should be indented in a
special way, like @samp{tabular} or @samp{verbatim}. Those environments
@@ -1604,14 +1623,16 @@ This shall prevent the source code from being messed up
by accidently
filling those environments with the standard filling routine. If you
think that providing special filling routines for such environments
would be an appropriate and challenging task for you, you are invited to
-contribute. (@xref{Filling}, for further information about the filling
-functionality)
+contribute. (@xref{Filling}, for further information about the filling
+functionality.)
@vindex LaTeX-indent-environment-list
The check for the indentation function may be enabled or disabled by
customizing the variable @code{LaTeX-indent-environment-check}.
@vindex LaTeX-indent-environment-check
+@cindex align.el
+@findex align-current
As a side note with regard to formatting special environments: Newer
Emacsen include @file{align.el} and therefore provide some support for
formatting @samp{tabular} and @samp{tabbing} environments with the
@@ -1636,7 +1657,9 @@ to indenting with a small summary in each case:
@code{LaTeX-indent-line} will indent the current line.
@item @key{LFD}
+@itemx C-j
@kindex @key{LFD}
+@kindex C-j
@code{newline-and-indent} inserts a new line (much like @key{RET}) and
moves the cursor to an appropriate position by the left margin.
@@ -1644,10 +1667,6 @@ Most keyboards nowadays lack a linefeed key and
@kbd{C-j} may be tedious
to type. Therefore you can customize @AUCTeX{} to perform indentation
upon typing @key{RET} as well. The respective option is called
@code{TeX-newline-function}.
-
-@item C-j
-@kindex C-j
-Alias for @key{LFD}
@end table
@defopt LaTeX-indent-environment-list
@@ -1655,6 +1674,7 @@ List of environments with special indentation. The
second element in
each entry is the function to calculate the indentation level in
columns.
+@c FIXME: The situation has changed, hasn't it?
The filling code currently cannot handle tabular-like environments
which will be completely messed-up if you try to format them. This is
why most of these environments are included in this customization
@@ -1688,13 +1708,15 @@ This will normally be @code{newline} which simply
inserts a new line.
In case you want to have @AUCTeX{} do indentation as well when you press
@key{RET}, use the built-in functions @code{newline-and-indent} or
@code{reindent-then-newline-and-indent}. The former inserts a new line
-and indents the following line, i.e. it moves the cursor to the right
+and indents the following line, i.e.@: it moves the cursor to the right
position and therefore acts as if you pressed @key{LFD}. The latter
function additionally indents the current line. If you choose
@samp{Other}, you can specify your own fancy function to be called when
@key{RET} is pressed.
@end defopt
+@vindex LaTeX-begin-regexp
+@vindex LaTeX-end-regexp
@AUCTeX{} treats by default @samp{\[...\]} math mode as a regular
environment and indents it accordingly. If you do not like such
behavior you only need to remove @code{\|\[} and @code{\|\]} from
@@ -1707,6 +1729,9 @@ respectively.
@cindex Formatting
@cindex Reformatting
@cindex Refilling
+@findex auto-fill-mode
+@findex turn-on-auto-fill
+@vindex fill-column
Filling deals with the insertion of line breaks to prevent lines from
becoming wider than what is specified in @code{fill-column}. The
@@ -1730,8 +1755,8 @@ filling in @AUCTeX{} will indent the start of the region
to be filled in
contrast to many other Emacs modes.)
There are some syntactical constructs which are handled specially with
-regard to filling. These are so-called code comments and paragraph
-commands.
+regard to filling. These are so-called @dfn{code comments} and
+@dfn{paragraph commands}.
Code comments are comments preceded by code or text in the same line.
Upon filling a region, code comments themselves will not get filled.
@@ -1748,7 +1773,7 @@ of the code comment. In this special case @kbd{M-q} only
acts on the
current line and not on the whole paragraph.
Lines with @samp{\par} are treated similarly to code comments,
-i.e. @samp{\par} will be treated as paragraph boundary which should not
+i.e.@: @samp{\par} will be treated as paragraph boundary which should not
be followed by other code or text. But it is not treated as a real
paragraph boundary like an empty line where filling a paragraph would
stop.
@@ -1782,7 +1807,7 @@ change. But if you write
\begin@{quote@} text
text text text text
@end example
-
+@noindent
and press @kbd{M-q}, you will get
@example
@@ -1814,7 +1839,7 @@ Alias for @kbd{C-c C-q C-p}
@kindex C-c C-q C-e
@findex LaTeX-fill-environment
@code{LaTeX-fill-environment} will fill and indent the current
-environment. This may e.g. be the `document' environment, in which case
+environment. This may e.g.@: be the `document' environment, in which case
the entire document will be formatted.
@item C-c C-q C-s
@@ -1958,7 +1983,7 @@ your font locking patterns. If you want to disable
fontification in
@end defopt
@fontlatex{} provides many options for customization which are
-accessible with @kbd{M-x customize-group RET font-latex RET}. For this
+accessible with @kbd{M-x customize-group @key{RET} font-latex @key{RET}}. For
this
description the various options are explained in conceptional groups.
@menu
@@ -2061,7 +2086,7 @@ Type: @samp{\macro[...]@{...@}}@*
Face: @code{font-lock-variable-name-face}
@item font-latex-match-warning-keywords
-Keywords for important macros, e.g. affecting line or page break, like
+Keywords for important macros, e.g.@: affecting line or page break, like
@samp{\clearpage}.@*
Type: @samp{\macro}@*
Face: @code{font-latex-warning-face}
@@ -2075,7 +2100,7 @@ For these commands there are two fontification schemes
which may be
selected by customizing the variable @code{font-latex-fontify-sectioning}.
@defopt font-latex-fontify-sectioning
-@c Is @vindex correct?
+@c FIXME: Is @vindex correct?
@vindex font-latex-sectioning-0-face
@vindex font-latex-sectioning-1-face
@vindex font-latex-sectioning-2-face
@@ -2084,7 +2109,7 @@ selected by customizing the variable
@code{font-latex-fontify-sectioning}.
@vindex font-latex-sectioning-5-face
Per default sectioning commands will be shown in a larger, proportional
font, which corresponds to a number for this variable. The font size
-varies with the sectioning level, e.g. @samp{\part}
+varies with the sectioning level, e.g.@: @samp{\part}
(@code{font-latex-sectioning-0-face}) has a larger font than
@samp{\paragraph} (@code{font-latex-sectioning-5-face}). Typically,
values from 1.05 to 1.3 for @code{font-latex-fontify-sectioning} give
@@ -2204,7 +2229,7 @@ Every keyword class consists of four parts, a name, a
list of keywords,
a face and a specifier for the type of macros to be highlighted.
When adding new entries, you have to use unique values for the class
-names, i.e. they must not clash with names of the built-in keyword
+names, i.e.@: they must not clash with names of the built-in keyword
classes or other names given by you. Additionally the names must not
contain spaces.
@@ -2245,7 +2270,7 @@ style you can set it to a specific language-dependent
value as well.
Set the value to @samp{german} if you are using >>German quotes<< and to
@samp{french} if you are using << French quotes >>. @fontlatex{} will
recognize the different ways these quotes can be given in your source
-code, i.e. (@samp{"<}, @samp{">}), (@samp{<<}, @samp{>>}) and the
+code, i.e.@: (@samp{"<}, @samp{">}), (@samp{<<}, @samp{>>}) and the
respective 8-bit variants.
If you set @code{font-latex-quotes} to nil, quoted content will not be
@@ -2270,14 +2295,14 @@ constructs known by @fontlatex{} are displayed with the
face
like @samp{\(...\)} or @samp{\[...\]} is built-in and not customizable.
Support for other math macros and environments can be adapted by
customizing the variables @code{font-latex-match-math-command-keywords}
-and @code{texmathp-tex-commands} respectively. It is no longer
+and @code{texmathp-tex-commands} respectively. It is no longer
recommended to customize @code{font-latex-math-environments}.
To convert your customization in @code{font-latex-math-environments}
into @code{texmathp-tex-commands}, please register your own math
environments, together with starred variants if any, as entries of
@code{env-on} type in @code{texmathp-tex-commands}, then clear out
-@code{font-latex-math-environments}. You have to restart Emacs for this
+@code{font-latex-math-environments}. You have to restart Emacs for this
new customization to take effect for fontification.
In order to make math constructs more readable, @fontlatex{} displays
@@ -2302,7 +2327,8 @@ like @code{multi-level}, and in addition the
super-/subscript characters
@i{^} and @i{_} are not displayed.
@end defopt
-
+@vindex font-latex-superscript-face
+@vindex font-latex-subscript-face
@defopt font-latex-fontify-script-max-level
Maximum scriptification level for which script faces are applied.
@@ -2325,6 +2351,7 @@ and @i{b} would have the same font size. If it was 3 or
more, then
smaller than @i{y} and @i{y} is smaller than @i{x}.
@end defopt
+@vindex font-latex-script-char-face
The script characters @samp{^} and @samp{_} themselves are also
fontified with an own face named @code{font-latex-script-char-face}.
@@ -2361,9 +2388,9 @@ environments are recognized is controlled by the variables
In case you want to change the colors and fonts used by @fontlatex{}
please refer to the faces mentioned in the explanations above and use
-@kbd{M-x customize-face RET <face> RET}. All faces defined by
+@kbd{M-x customize-face @key{RET} <face> @key{RET}}. All faces defined by
@fontlatex{} are accessible through a customization group by typing
-@kbd{M-x customize-group RET font-latex-highlighting-faces RET}.
+@kbd{M-x customize-group @key{RET} font-latex-highlighting-faces @key{RET}}.
@node Known problems
@subsection Known fontification problems
@@ -2371,7 +2398,7 @@ please refer to the faces mentioned in the explanations
above and use
@cindex Math, fontification problems with
In certain cases the fontification machinery fails to interpret buffer
-contents correctly. This can lead to color bleed, i.e. large parts of a
+contents correctly. This can lead to color bleed, i.e.@: large parts of a
buffer get fontified with an inappropriate face. A typical situation
for this to happen is the use of a dollar sign (@samp{$}) in a verbatim
macro or environment. If @fontlatex{} is not aware of the verbatim
@@ -2379,8 +2406,8 @@ construct, it assumes the dollar sign to be a toggle for
mathematics and
fontifies the following buffer content with the respective face until it
finds a closing dollar sign or till the end of the buffer.
-As a remedy you can make the verbatim construct known to @fontlatex{},
-@pxref{Verbatim content}. If this is not possible, you can insert a
+As a remedy you can make the verbatim construct known to @fontlatex{}
+(@pxref{Verbatim content}). If this is not possible, you can insert a
commented dollar sign (@samp{%$}) at the next suitable end of line as a
quick workaround. In docTeX documents, @samp{^^A$} is also available
for similar purpose.
@@ -2408,7 +2435,7 @@ replace them by a fixed string, the content of one of
their arguments,
or a mixture of both. If you want to make the original text visible
again in order to view or edit it, move point sideways onto the
placeholder (also called display string) or left-click with the mouse
-pointer on it. (The latter is currently only supported on Emacs.) The
+pointer on it. The
macro or environment will unfold automatically, stay open as long as
point is inside of it and collapse again once you move point out of it.
(Note that folding of environments currently does not work in every
@@ -2417,7 +2444,7 @@ point is inside of it and collapse again once you move
point out of it.
In order to use this feature, you have to activate @code{TeX-fold-mode}
which will activate the auto-reveal feature and the necessary commands
to hide and show macros and environments. You can activate the mode in
-a certain buffer by typing the command @kbd{M-x TeX-fold-mode RET} or
+a certain buffer by typing the command @kbd{M-x TeX-fold-mode @key{RET}} or
using the keyboard shortcut @kbd{C-c C-o C-f}. If you want to use it
every time you edit a @LaTeX{} document, add it to a hook:
@findex TeX-fold-mode
@@ -2601,8 +2628,8 @@ with all mandatory arguments of the macro and the result
of the function
call will be used as a replacement for the macro.
The placeholder is made by copying the text from the buffer together with
-its properties, i.e. its face as well. If fontification has not
-happened when this is done (e.g. because of lazy font locking) the
+its properties, i.e.@: its face as well. If fontification has not
+happened when this is done (e.g.@: because of lazy font locking) the
intended fontification will not show up. As a workaround you can leave
Emacs idle a few seconds and wait for stealth font locking to finish
before you fold the buffer. Or you just re-fold the buffer with
@@ -2612,7 +2639,7 @@ before you fold the buffer. Or you just re-fold the
buffer with
@defopt TeX-fold-env-spec-list
List of display strings or argument numbers and environments to fold.
Argument numbers refer to the @samp{\begin} statement. That means if
-you have e.g. @samp{\begin@{tabularx@}@{\linewidth@}@{XXX@} ...
+you have e.g.@: @samp{\begin@{tabularx@}@{\linewidth@}@{XXX@} ...
\end@{tabularx@}} and specify 3 as the argument number, the resulting
display string will be ``XXX''.
@end defopt
@@ -2695,9 +2722,10 @@ and @samp{\item} being below @samp{\subparagraph}.
@lisp
(setq TeX-outline-extra
'(("[ \t]*\\\\\\(bib\\)?item\\b" 7)
- ("\\\\bibliography\\b" 2)))
+ ("\\\\bibliography\\b" 2)))
@end lisp
+@c FIXME: Isn't this much outdated?
You may want to check out the unbundled @file{out-xtra} package for even
better outline support. It is available from your favorite emacs lisp
archive.
@@ -2708,9 +2736,9 @@ archive.
Sometimes you want to focus your attention to a limited region of the
code. You can do that by restricting the text addressable by editing
commands and hiding the rest of the buffer with the narrowing functions,
-@pxref{Narrowing,,,emacs,GNU Emacs Manual}. In addition, AUCTeX
+@pxref{Narrowing,,,emacs,GNU Emacs Manual}. In addition, @AUCTeX{}
provides a couple of other commands to narrow the buffer to a group,
-i.e. a region enclosed in a pair of curly braces, and to @LaTeX{}
+i.e.@: a region enclosed in a pair of curly braces, and to @LaTeX{}
environments.
@deffn Command TeX-narrow-to-group
@@ -2762,17 +2790,24 @@ by that and @AUCTeX{}.
The most powerful features of @AUCTeX{} may be those allowing you to run
@TeX{}, @LaTeX{}, @ConTeXt{} and other external commands like Bib@TeX{}
-and @code{makeindex} from within Emacs, viewing and printing the
+and @command{makeindex} from within Emacs, viewing and printing the
results, and moreover allowing you to @emph{debug} your documents.
@cindex tool bar, toolbar
@vindex LaTeX-enable-toolbar
@vindex plain-TeX-enable-toolbar
+@vindex TeX-bar-TeX-buttons
+@vindex TeX-bar-TeX-all-button-alists
+@vindex TeX-bar-LaTeX-buttons
+@vindex TeX-bar-LaTeX-button-alist
@AUCTeX{} comes with a special tool bar for @TeX{} and @LaTeX{} which
provides buttons for the most important commands. You can enable or
disable it by customizing the options @code{plain-TeX-enable-toolbar}
and @code{LaTeX-enable-toolbar} in the @code{TeX-tool-bar} customization
-group.
+group. You can also customize the buttons by the options
+@code{TeX-bar-TeX-buttons}, @code{TeX-bar-TeX-all-button-alists},
+@code{TeX-bar-LaTeX-buttons} and @code{TeX-bar-LaTeX-button-alist}.
+@c FIXME: Write details about customizing tool bar.
@menu
* Commands:: Invoking external commands.
@@ -2804,8 +2839,8 @@ group.
@cindex External Commands
@cindex Indexing
@cindex Making an index
-@cindex Running @code{makeindex}
-@cindex @code{makeindex}
+@cindex Running @command{makeindex}
+@cindex @command{makeindex}
@cindex Bib@TeX{}
@cindex Bibliography
@cindex Literature
@@ -2913,13 +2948,13 @@ the current region.
@defopt TeX-header-end
A regular expression matching the end of the header. By default, this
is @samp{\begin@{document@}} in @LaTeX{} mode and @samp{%**end of
-header} in @TeX{} mode.
+header} in plain @TeX{} mode.
@end defopt
@defopt TeX-trailer-start
A regular expression matching the start of the trailer. By default,
this is @samp{\end@{document@}} in @LaTeX{} mode and @samp{\bye} in
-@TeX{} mode.
+plain @TeX{} mode.
@end defopt
If you want to change the values of @code{TeX-header-end} and
@@ -2938,6 +2973,13 @@ activated mark, however, will always define a new region
when calling
@code{TeX-command-region}.
@end deffn
+@c FIXME: The former half of this paragraph is incorrect.
+@c - `TeX-(La)TeX-sentinel' depends on `TeX-active-*', which act
+@c according to the value of `TeX-current-process-region-p'.
+@c - Both C-c C-c and C-c C-r overwrite `TeX-current-process-region-p'.
+@c Therefore, if the user types C-c C-r before the process invoked by
+@c C-c C-c finishes, the sentinel for the latter process doesn't work
+@c as expected.
@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 @var{n} different documents, you can have @var{n} plus one
@@ -2961,7 +3003,7 @@ minibuffer with completion support by typing @key{TAB}.
@vindex TeX-expand-list
The available commands are defined by the variable
@code{TeX-command-list}. Per default it includes commands for
-typesetting the document (e.g. @samp{LaTeX}), for viewing the output
+typesetting the document (e.g.@: @samp{LaTeX}), for viewing the output
(@samp{View}), for printing (@samp{Print}), for generating an index
(@samp{Index}) or for spell checking (@samp{Spell}) to name but a few.
You can also add your own commands by adding entries to
@@ -2979,7 +3021,7 @@ following form.
@lisp
(eval-after-load "tex"
'(add-to-list 'TeX-command-list
- '("Foo" "foo %s" TeX-run-command t t :help "Run foo") t))
+ '("Foo" "foo %s" TeX-run-command t t :help "Run foo") t))
@end lisp
As mentioned before, @AUCTeX{} will try to guess what command you want
@@ -3028,7 +3070,7 @@ Used when checking if any files have changed.
@cindex ispell
When performing spell checking on a document or a region (invoked
-through @AUCTeX{}'s @samp{Spell} command or @kbd{M-x ispell RET}), you
+through @AUCTeX{}'s @samp{Spell} command or @kbd{M-x ispell @key{RET}}), you
want the spell checking program to skip certain macro arguments and
environments, most notably the arguments of referencing macros and the
contents of verbatim environments. The skipped parts are controlled by
@@ -3050,16 +3092,16 @@ and private macro names within your init file or on a
file local basis.
@code{ispell-tex-skip-alists} has the following structure:
@lisp
(defvar ispell-tex-skip-alists
- '((;; First list
+ '((;; @r{First list}
("\\\\addcontentsline" ispell-tex-arg-end 2)
("\\\\\\([aA]lph\\|arabic\\)" ispell-tex-arg-end)
("\\\\makebox" ispell-tex-arg-end 0)
("\\\\documentclass" . "\\\\begin@{document@}"))
- (;; Second list
+ (;; @r{Second list}
("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0)
("list" ispell-tex-arg-end 2)
("verbatim\\*?" . "\\\\end@{verbatim\\*?@}")))
- "*Lists of regions to be skipped in TeX mode.
+ "Lists of regions to be skipped in TeX mode.
First list is used raw.
Second list has key placed inside \\begin@{@}.")
@end lisp
@@ -3116,6 +3158,8 @@ ensures that the entire preamble of a document is
discarded. Second
list works the same; it is more convenient for environments since
@code{KEY} is wrapped inside @code{\begin@{@}}.
+@findex TeX-ispell-skip-setcar
+@findex TeX-ispell-skip-setcdr
@AUCTeX{} provides two functions to add items to car and cdr of
@code{ispell-tex-arg-end}, namely @code{TeX-ispell-skip-setcar} and
@code{TeX-ispell-skip-setcdr}. The argument of these functions is
@@ -3129,6 +3173,7 @@ init file, e.g.:
(TeX-ispell-skip-setcdr
'(("myverbatim" . "\\\\end@{myverbatim@}")))))
@end lisp
+
Another possibility is to use file local additions at the end of your
@TeX{} file, e.g.:
@example
@@ -3153,7 +3198,7 @@ verbatim text are stored in
@code{TeX-ispell-verb-delimiters}.
@defopt TeX-ispell-verb-delimiters
String with delimiters recognized for in-line verbatim macros. This
-variable is initialized to @samp{!|#~\"*/+^-}. Since this string is
+variable is initialized to @samp{!|#~"*/+^-}. Since this string is
used to build a character alternative inside a regular expression,
special characters @samp{^} and @samp{-} should come last. Other
characters like opening brace @samp{@{}, asterisk @samp{*} or at sign
@@ -3204,7 +3249,7 @@ encountered and wait for the user to type something.
@end deffn
@cindex I/O correlation
-@cindex SyncTeX
+@cindex Sync@TeX{}
@cindex Source specials
@cindex PDFSync
@deffn Command TeX-source-correlate-mode
@@ -3256,7 +3301,7 @@ non-nil too the document is compiled to @acronym{DVI}
instead of
@acronym{PDF}. When the document is ready, @kbd{C-c C-c} will suggest
to run the converter to @acronym{PDF} or an intermediate format.
-If non-nil, @code{TeX-PDF-from-DVI} should be the name of the command,
+If non-nil, @code{TeX-PDF-from-DVI} should be the name of the command in
@code{TeX-command-list},
as a string, used to convert the @acronym{DVI} file to @acronym{PDF} or
to an intermediate format. Values currently supported are:
@itemize
@@ -3269,14 +3314,14 @@ be the default command to convert the @acronym{PS} file
to
@code{"Dvipdfmx"}: the @acronym{DVI} file is converted to @acronym{PDF}
with @command{dvipdfmx}.
@end itemize
-(case is significant; note the uppercase ``D'' in both strings)
+(case is significant; note the uppercase @samp{D} in both strings)
When the @acronym{PDF} file is finally ready, the next suggested command
-will be to open the viewer.
+will be @samp{View} to open the viewer.
This option can also be set as a file local variable, in order to use
this conversion on a per-document basis.
-Recall the whole sequence of @kbd{C-c C-c} commands can be replace by
+Recall the whole sequence of @kbd{C-c C-c} commands can be replaced by
the single @kbd{C-c C-a}.
@end defopt
@@ -3288,7 +3333,7 @@ submenu below the @samp{Command} menu or by calling the
function
@defopt TeX-engine
This variable allows you to choose which @TeX{} engine should be used
-for typesetting the document, i.e. the executables which will be used
+for typesetting the document, i.e.@: the executables which will be used
when you invoke the @samp{TeX} or @samp{LaTeX} commands. The value
should be one of the symbols defined in @code{TeX-engine-alist-builtin}
or @code{TeX-engine-alist}. The symbols @samp{default}, @samp{xetex},
@@ -3298,8 +3343,8 @@ or @code{TeX-engine-alist}. The symbols @samp{default},
@samp{xetex},
Note that @code{TeX-engine} is buffer-local, so setting the variable
directly or via the above mentioned menu or function will not take
effect in other buffers. If you want to activate an engine for all
-@AUCTeX{} modes, set @code{TeX-engine} in your init file, e.g. by using
-@kbd{M-x customize-variable <RET>}. If you want to activate it for a
+@AUCTeX{} modes, set @code{TeX-engine} in your init file, e.g.@: by using
+@kbd{M-x customize-option @key{RET}}. If you want to activate it for a
certain @AUCTeX{} mode only, set the variable in the respective mode
hook. If you want to activate it for certain files, set it through file
variables (@pxref{File Variables,,,emacs,The Emacs Editor}).
@@ -3325,19 +3370,19 @@ the executables you want to use instead. You can also
add entries to
per default.
@defopt TeX-engine-alist
-Alist of TeX engines and associated commands. Each entry is a list with
+Alist of @TeX{} engines and associated commands. Each entry is a list with
a maximum of five elements. The first element is a symbol used to
identify the engine. The second is a string describing the engine. The
-third is the command to be used for plain TeX. The fourth is the
-command to be used for LaTeX. The fifth is the command to be used for
-the @samp{--engine} parameter of ConTeXt's @samp{texexec} program. Each
+third is the command to be used for plain @TeX{}. The fourth is the
+command to be used for @LaTeX{}. The fifth is the command to be used for
+the @option{--engine} parameter of @ConTeXt{}'s @samp{texexec} program. Each
command can either be a variable or a string. An empty string or nil
means there is no command available.
@end defopt
-In some systems, Emacs cannot inherit the PATH environment variable from
+In some systems, Emacs cannot inherit the @env{PATH} environment variable from
the shell and thus @AUCTeX{} may not be able to run @TeX{} commands.
-Before running them, @AUCTeX{} checks if it able to find those commands
+Before running them, @AUCTeX{} checks if it is able to find those commands
and will warn you in case it fails. You can skip this test by changing
the option @code{TeX-check-TeX}.
@@ -3353,7 +3398,7 @@ option.
@end defopt
Some @LaTeX{} packages requires the document to be compiled with a
-specific engine. Notable examples are fontspec and polyglossia
+specific engine. Notable examples are @samp{fontspec} and @samp{polyglossia}
packages, which require Lua@TeX{} and Xe@TeX{} engines. If you try to
compile a document which loads one of such packages and the set engine
is not one of those allowed you will be asked to select a different
@@ -3391,10 +3436,10 @@ If non-nil, the output of @TeX{} compilation is shown
in another window.
@end defopt
You can instruct @TeX{} to print error messages in the form
-file:line:error which is similar to the way many compilers format them.
+@samp{file:line:error} which is similar to the way many compilers format them.
@defopt TeX-file-line-error
-If non-nil, @TeX{} will produce file:line:error style error messages.
+If non-nil, @TeX{} will produce @samp{file:line:error} style error messages.
@end defopt
@ConTeXt{} users can choose between Mark II and Mark IV versions. This
@@ -3425,7 +3470,7 @@ formatted output of your document.
@subsection Starting Viewers
Viewers are normally invoked by pressing @kbd{C-c C-c} once the document
-is formatted, which will propose the View command, or by activating the
+is formatted, which will propose the @samp{View} command, or by activating the
respective entry in the Command menu. Alternatively you can type
@kbd{C-c C-v} which calls the function @code{TeX-view}.
@@ -3511,7 +3556,7 @@ A built-in viewer spec from
@code{TeX-view-program-list-builtin} can be
overwritten by defining a new viewer spec with the same name.
@end defopt
-After the viewer is called via either the View command or the key stroke
+After the viewer is called via either the @samp{View} command or the key stroke
@kbd{C-c C-v}, the window system focus goes and stays on the viewer. If
you prefer that the focus is pulled back to Emacs immediately after that
and you are using evince-compatible viewer, customize the option
@@ -3529,7 +3574,7 @@ the whole viewer selection machinery will only be
triggered if there is
no @samp{%V} expander in @code{TeX-expand-list}. So if you have trouble
with the viewer invocation you might check if there is an older
customization of the variable in place. In addition, the use of a
-function in @code{TeX-view-program-list} only works if the View command
+function in @code{TeX-view-program-list} only works if the @samp{View} command
in @code{TeX-command-list} makes use of the hook
@code{TeX-run-discard-or-function}.
@@ -3539,7 +3584,7 @@ in @code{TeX-command-list} makes use of the hook
@cindex Forward search
@cindex I/O correlation
@cindex Source specials
-@cindex SyncTeX
+@cindex Sync@TeX{}
@cindex PDFSync
Forward and inverse search refer to the correlation between the document
@@ -3550,7 +3595,7 @@ search vice versa.
@findex TeX-source-correlate-mode
@AUCTeX{} supports three methods for forward and inverse search: source
-specials (only DVI output), the pdfsync @LaTeX{} package (only PDF
+specials (only @acronym{DVI} output), the pdfsync @LaTeX{} package (only
@acronym{PDF}
output) and Sync@TeX{} (any type of output). If you want to make use of
forward and inverse searching with source specials or Sync@TeX{}, switch
on @code{TeX-source-correlate-mode}. @xref{Processor Options}, on how
@@ -3561,18 +3606,18 @@ document parsing is enabled. Customize the variable
@defopt TeX-source-correlate-method
Method to use for enabling forward and inverse search. This can be
@samp{source-specials} if source specials should be used, @samp{synctex}
-if SyncTeX should be used, or @samp{auto} if @AUCTeX{} should decide.
+if Sync@TeX{} should be used, or @samp{auto} if @AUCTeX{} should decide.
When the variable is set to @samp{auto}, @AUCTeX{} will always use
-SyncTeX if your @code{latex} processor supports it, source specials
+Sync@TeX{} if your @command{latex} processor supports it, source specials
otherwise. You must make sure your viewer supports the same method.
It is also possible to specify a different method depending on the
-output, either DVI or PDF, by setting the variable to an alist of the
+output, either @acronym{DVI} or @acronym{PDF}, by setting the variable to an
alist of the
kind
@lisp
-((dvi . <source-specials or synctex>)
- (pdf . <source-specials or synctex>))
+((dvi . @samp{<source-specials or synctex>})
+ (pdf . @samp{<source-specials or synctex>}))
@end lisp
in which the CDR of each entry is a symbol specifying the method to be
used in the corresponding mode. The default value of the variable is
@@ -3584,7 +3629,7 @@ which is compatible with the majority of viewers.
@end defopt
@findex TeX-view
-Forward search happens automatically upon calling the viewer, e.g. by
+Forward search happens automatically upon calling the viewer, e.g.@: by
typing @kbd{C-c C-v} (@code{TeX-view}). This will open the viewer or
bring it to front and display the output page corresponding to the
position of point in the source file. @AUCTeX{} will automatically pass
@@ -3606,14 +3651,14 @@ should never be started. Inverse search will not be
available in the
latter case.
@end defopt
-Inverse search, i.e. jumping to the part of your document source in
+Inverse search, i.e.@: jumping to the part of your document source in
Emacs corresponding to a certain position in the viewer, is triggered
from the viewer, typically by a mouse click. Refer to the documentation
of your viewer to find out how it has to be configured and what you have
to do exactly. In xdvi you normally have to use @kbd{C-down-mouse-1}.
@vindex TeX-source-correlate-start-server
-Note that inverse search with the Evince PDF viewer or its MATE fork
+Note that inverse search with the Evince @acronym{PDF} viewer or its MATE fork
Atril might fail in raising the Emacs frame after updating point in your
document's buffer. There is simply no way to raise the Emacs frame
reliably accross different operating systems and different window
@@ -3631,25 +3676,25 @@ leave this variable set to its default value
settings that work for some users.
@lisp
-;; Alternative 1: For some users, `x-focus-frame' works.
+;; @r{Alternative 1: For some users, @t{`x-focus-frame'} works.}
(setq TeX-raise-frame-function #'x-focus-frame)
-;; Alternative 2: Under GNOME 3.20 (and probably others), it
-;; seems some focus stealing prevention policy prohibits that
-;; some window gets the focus immediately after the user has
-;; clicked in some other window. Here waiting a bit before
-;; issuing the request seems to work.
+;; @r{Alternative 2: Under GNOME 3.20 (and probably others), it}
+;; @r{seems some focus stealing prevention policy prohibits that}
+;; @r{some window gets the focus immediately after the user has}
+;; @r{clicked in some other window. Here waiting a bit before}
+;; @r{issuing the request seems to work.}
(setq TeX-raise-frame-function
(lambda ()
- (run-at-time 0.5 nil #'x-focus-frame)))
+ (run-at-time 0.5 nil #'x-focus-frame)))
-;; Alternative 3: Use the external wmctrl tool in order to
-;; force Emacs into the focus.
+;; @r{Alternative 3: Use the external @t{wmctrl} tool in order to}
+;; @r{force Emacs into the focus.}
(setq TeX-raise-frame-function
(lambda ()
- (call-process
- "wmctrl" nil nil nil "-i" "-R"
- (frame-parameter (selected-frame) 'outer-window-id))))
+ (call-process
+ "wmctrl" nil nil nil "-i" "-R"
+ (frame-parameter (selected-frame) 'outer-window-id))))
@end lisp
@end defopt
@@ -3659,14 +3704,14 @@ settings that work for some users.
@cindex Debugging
@cindex Errors
@cindex Parsing errors
-@cindex Parsing TeX output
+@cindex Parsing @TeX{} output
@cindex Next error
@cindex Parsing @LaTeX{} errors
@cindex Overfull boxes
@cindex Bad boxes
@cindex Underfull boxes
-Once you've formatted your document you may `debug' it, i.e. browse
+Once you've formatted your document you may `debug' it, i.e.@: browse
through the errors (La)@TeX{} reported. You may also have a look at a
nicely formatted list of all errors and warnings reported by the
compiler.
@@ -3736,7 +3781,7 @@ ask it to report `bad boxes' and warnings as well.
@kindex C-c C-t C-b
@vindex TeX-debug-bad-boxes
(@kbd{C-c C-t C-b}) Toggle whether @AUCTeX{} should stop at bad boxes
-(i.e. overfull and underfull boxes) as well as normal errors. The
+(i.e.@: overfull and underfull boxes) as well as normal errors. The
boolean option @code{TeX-debug-bad-boxes} is set accordingly.
@end deffn
@@ -3784,11 +3829,11 @@ all warnings are hidden in any case.
@subsection List of all errors and warnings
When the option @code{TeX-parse-all-errors} is non-nil, you will be also
-able to open an overview of all errors and warnings reported by the TeX
+able to open an overview of all errors and warnings reported by the @TeX{}
compiler.
@deffn Command TeX-error-overview
-Show an overview of the errors and warnings occurred in the last TeX
+Show an overview of the errors and warnings occurred in the last @TeX{}
run.
In this window you can visit the error on which point is by pressing
@@ -3805,7 +3850,7 @@ overview.
@defopt TeX-error-overview-open-after-TeX-run
When this boolean variable is non-nil, the error overview will be
-automatically opened after running TeX if there are errors or warnings
+automatically opened after running @TeX{} if there are errors or warnings
to show.
@end defopt
@@ -3853,8 +3898,8 @@ Editor}), which will move point to the location of the
next error.
Alternatively, you may want in-buffer notation. @AUCTeX{} provides
support for this using the Flymake package in Emacs 26 or newer
-(@xref{Using Flymake,,,Flymake,GNU Flymake} for details). To enable,
-call @kbd{M-x flymake-mode RET} in the buffer or enable it in all
+(@pxref{Using Flymake,,,Flymake,GNU Flymake} for details). To enable,
+call @kbd{M-x flymake-mode @key{RET}} in the buffer or enable it in all
buffers by adding this to your init file:
@lisp
(add-hook 'LaTeX-mode-hook #'flymake-mode)
@@ -3866,9 +3911,10 @@ Each of the two utilities @code{lacheck} and
@code{chktex} will find
some errors the other doesn't, but @code{chktex} is more configurable,
allowing you to create your own errors. You may need to install the
programs before using them. You can get @code{lacheck} from
-@file{<URL:https://www.ctan.org/pkg/lacheck>} and
+URL:@url{https://www.ctan.org/pkg/lacheck} and
@code{chktex} from
-@file{<URL:https://www.ctan.org/pkg/chktex>}.
+URL:@url{https://www.ctan.org/pkg/chktex}. @w{@TeX{} Live} contains
+both.
@node Control
@section Controlling the output
@@ -3910,13 +3956,13 @@ separate directory.
@defopt TeX-output-dir
Set this option to the path of a directory where output files will be
-placed. The output files include those that are produced by applications
+placed. The output files include those that are produced by applications
running under @AUCTeX{}, temporary files related to region processing and
-the @previewlatex{} files. If a relative path is specified, it is
+the @previewlatex{} files. If a relative path is specified, it is
interpreted as being relative to the master file in a mutlifile document.
This is a buffer local variable and must be set separately for all
-documents and all files in a multifile document. For example,
+documents and all files in a multifile document. For example,
@example
%%% Local Variables:
@@ -3926,16 +3972,16 @@ documents and all files in a multifile document. For
example,
@end example
Alternatively, you may use @code{setq-default} to set the default value of
-this option or set it as a directory local variable (see
-@code{add-dir-local-variable}).
+this option or set it as a directory local variable (@pxref{Directory
+Variables,,, emacs, The Emacs Editor}).
Note that a non-nil value of @code{TeX-output-dir} might be incompatible
-with some @TeX{} commands and macros. In particular, the @LaTeX{} macro
-@samp{\include} is known to not work with this option. Some @TeX{}
-packages which produce intermediary files might also be incompatible. A
+with some @TeX{} commands and macros. In particular, the @LaTeX{} macro
+@samp{\include} is known to not work with this option. Some @TeX{}
+packages which produce intermediary files might also be incompatible. A
possible workaround for those packages is to append the value of
-@code{TeX-output-dir} to the environment variables @samp{TEXINPUTS} and
-@samp{BIBINPUTS}.
+@code{TeX-output-dir} to the environment variables @env{TEXINPUTS} and
+@env{BIBINPUTS}.
@end defopt
@node Cleaning
@@ -3963,19 +4009,34 @@ Canonical access to the function is provided by the
@samp{Clean} and
@kbd{C-c C-c} or the Command menu.
The patterns governing which files to remove can be adapted separately
-for each @AUCTeX{} mode by means of the variables
-@code{plain-TeX-clean-intermediate-suffixes},
-@code{plain-TeX-clean-output-suffixes},
-@code{LaTeX-clean-intermediate-suffixes},
-@code{LaTeX-clean-output-suffixes},
-@code{docTeX-clean-intermediate-suffixes},
-@code{docTeX-clean-output-suffixes},
-@code{Texinfo-clean-intermediate-suffixes},
-@code{Texinfo-clean-output-suffixes},
-@code{ConTeXt-clean-intermediate-suffixes},
-@code{ConTeXt-clean-output-suffixes},
-@code{AmSTeX-clean-intermediate-suffixes} and
-@code{AmSTeX-clean-output-suffixes}.
+for each @AUCTeX{} mode by means of the following variables:
+@itemize
+@item
+@code{plain-TeX-clean-intermediate-suffixes}
+@item
+@code{plain-TeX-clean-output-suffixes}
+@item
+@code{LaTeX-clean-intermediate-suffixes}
+@item
+@code{LaTeX-clean-output-suffixes}
+@item
+@code{docTeX-clean-intermediate-suffixes}
+@item
+@code{docTeX-clean-output-suffixes}
+@item
+@code{Texinfo-clean-intermediate-suffixes}
+@item
+@code{Texinfo-clean-output-suffixes}
+@item
+@code{ConTeXt-clean-intermediate-suffixes}
+@item
+@code{ConTeXt-clean-output-suffixes}
+@item
+@code{AmSTeX-clean-intermediate-suffixes}
+@item
+@code{AmSTeX-clean-output-suffixes}
+@end itemize
+
@end deffn
@defopt TeX-clean-confirm
@@ -3990,7 +4051,7 @@ before it is actually done. If non-nil, ask before
deleting files.
@deffn Command TeX-documentation-texdoc
@kindex C-c ?
(@kbd{C-c ?}) Get documentation about the packages installed on your
-system, using @samp{texdoc} to find the manuals. The function will
+system, using @command{texdoc} to find the manuals. The function will
prompt for the name of packages. If point is on a word, this will be
suggested as default.
@@ -4021,29 +4082,30 @@ the @samp{Find Documentation...} entry in the mode menu.
@ConTeXt{}, Texinfo and doc@TeX{}. For each of them there is a separate
major mode in @AUCTeX{} and each major mode runs @code{text-mode-hook},
@code{TeX-mode-hook} as well as a hook special to the mode in this
-order. The following table provides an overview of the respective mode
+order. (As an exception, Texinfo mode does not run @code{TeX-mode-hook}.)
+The following table provides an overview of the respective mode
functions and hooks.
-@multitable {Plain @TeX{}} {@code{plain-TeX-mode}} {@code{plain-TeX-mode-hook}}
+@multitable {Plain @TeX{}} {@code{plain-tex-mode}} {@code{plain-TeX-mode-hook}}
@headitem Type @tab Mode function @tab Hook
-@item Plain @TeX{} @tab @code{plain-TeX-mode} @tab @code{plain-TeX-mode-hook}
-@item @LaTeX{} @tab @code{LaTeX-mode} @tab @code{LaTeX-mode-hook}
+@item Plain @TeX{} @tab @code{plain-tex-mode} @tab @code{plain-TeX-mode-hook}
+@item @LaTeX{} @tab @code{latex-mode} @tab @code{LaTeX-mode-hook}
@item AMS-@TeX{} @tab @code{ams-tex-mode} @tab @code{AmS-TeX-mode-hook}
-@item @ConTeXt{} @tab @code{ConTeXt-mode} @tab @code{ConTeXt-mode-hook}
-@item Texinfo @tab @code{Texinfo-mode} @tab @code{Texinfo-mode-hook}
-@item Doc@TeX{} @tab @code{docTeX-mode} @tab @code{docTeX-mode-hook}
+@item @ConTeXt{} @tab @code{context-mode} @tab @code{ConTeXt-mode-hook}
+@item Texinfo @tab @code{texinfo-mode} @tab @code{Texinfo-mode-hook}
+@item Doc@TeX{} @tab @code{doctex-mode} @tab @code{docTeX-mode-hook}
@end multitable
-@findex plain-TeX-mode
+@findex plain-tex-mode
@vindex plain-TeX-mode-hook
-@findex LaTeX-mode
+@findex latex-mode
@vindex LaTeX-mode-hook
-@findex AmS-TeX-mode
+@findex ams-tex-mode
@vindex AmS-TeX-mode-hook
@findex ConTeXt-mode
@vindex ConTeXt-mode-hook
-@findex Texinfo-mode
+@findex texinfo-mode
@vindex Texinfo-mode-hook
-@findex docTeX-mode
+@findex doctex-mode
@vindex docTeX-mode-hook
If you need to make a customization via a hook which is only relevant
@@ -4057,7 +4119,7 @@ Other useful hooks are listed below.
@defvr Variable TeX-after-compilation-finished-hook
Hook which is run after the @TeX{}/@LaTeX{} processor has successfully
finished compiling your document. (@xref{Processing}, for finding out
-how to compile your document). Each function in the hook is run with
+how to compile your document.) Each function in the hook is run with
the compiled output document as its argument.
This is useful for automatically refreshing the viewer after
@@ -4092,13 +4154,15 @@ document you must run the commands on the top level
master file.
When you, for example, ask @AUCTeX{} to run a command on the master file,
it has no way of knowing the name of the master file. By default,
it will assume that the current file is the master file. If you insert
-the following in your @file{.emacs} file @AUCTeX{} will use a more
+the following in your init file (@file{init.el} or @file{.emacs}), @AUCTeX{}
will use a more
advanced algorithm.
@lisp
-(setq-default TeX-master nil) ; Query for master file.
+(setq-default TeX-master nil) ; @r{Query for master file.}
@end lisp
+@c FIXME: It doesn't seem that current implementation has this
+@c TeX-header-end aware feature.
If @AUCTeX{} finds the line indicating the end of the header in a master
file (@code{TeX-header-end}), it can figure out for itself that this is
a master file. Otherwise, it will ask for the name of the master file
@@ -4107,7 +4171,7 @@ automatically insert the name of the master file as a
file variable
(@pxref{File Variables,,,emacs,The Emacs Editor}). You can also insert
the file variable yourself, by putting the following text at the end of
your files.
-@findex TeX-header-end
+@vindex TeX-header-end
@example
%%% Local Variables:
@@ -4117,10 +4181,10 @@ your files.
You should always set this variable to the name of the top level document. If
you always use the same name for your top level documents, you can set
-@code{TeX-master} in your @file{.emacs} file.
+@code{TeX-master} in your init file such as @file{init.el} or @file{.emacs}.
@lisp
-(setq-default TeX-master "master") ; All master files called "master".
+(setq-default TeX-master "master") ; @r{All master files called @t{"master"}.}
@end lisp
@defopt TeX-master
@@ -4152,7 +4216,7 @@ file variable, it does not need to ask next time you edit
the file.
If you dislike @AUCTeX{} automatically modifying your files, you can
set this variable to @samp{"<none>"}. By default, @AUCTeX{} will modify
-any file with an extension of @samp{.tex}.
+any file with an extension of @samp{.tex}, @samp{.texi} or @samp{.dtx}.
@end defopt
@deffn Command TeX-master-file-ask
@@ -4207,11 +4271,11 @@ If non-nil, then query the user before saving each file
with
@AUCTeX{} depends heavily on being able to extract information from the
buffers by parsing them. Since parsing the buffer can be somewhat slow,
the parsing is initially disabled. You are encouraged to enable them by
-adding the following lines to your @file{.emacs} file.
+adding the following lines to your init file such as @file{init.el} or
@file{.emacs}.
@lisp
-(setq TeX-parse-self t) ; Enable parse on load.
-(setq TeX-auto-save t) ; Enable parse on save.
+(setq TeX-parse-self t) ; @r{Enable parse on load.}
+(setq TeX-auto-save t) ; @r{Enable parse on save.}
@end lisp
The latter command will make @AUCTeX{} store the parsed information in
@@ -4225,7 +4289,7 @@ This is done by first reading the information from the
master file, and
then recursively the information from each file stored in the master
file.
-The variables can also be done on a per file basis, by changing the file
+The variables can also be set on a per file basis, by changing the file
local variables.
@example
@@ -4261,7 +4325,7 @@ Tabs confuse @AUCTeX{}'s error message parsing and so
should generally be
avoided. However, tabs are significant in some environments, and so by
default @AUCTeX{} does not remove them.
To convert tabs to spaces when saving a buffer, insert the
-following in your @file{.emacs} file:
+following in your init file such as @file{init.el} or @file{.emacs}:
@lisp
(setq TeX-auto-untabify t)
@@ -4275,12 +4339,12 @@ Instead of disabling the parsing entirely, you can also
speed it
significantly up by limiting the information it will search for (and
store) when parsing the buffer. You can do this by setting the default
values for the buffer local variables @code{TeX-auto-regexp-list} and
-@code{TeX-auto-parse-length} in your @file{.emacs} file.
+@code{TeX-auto-parse-length} in your init file such as @file{init.el} or
@file{.emacs}.
@lisp
-;; Only parse LaTeX class and package information.
+;; @r{Only parse LaTeX class and package information.}
(setq-default TeX-auto-regexp-list 'LaTeX-auto-minimal-regexp-list)
-;; The class and package information is usually near the beginning.
+;; @r{The class and package information is usually near the beginning.}
(setq-default TeX-auto-parse-length 2000)
@end lisp
@@ -4362,21 +4426,17 @@ Parse all @TeX{} and @LaTeX{} commands that @AUCTeX{}
can use.
@section Language Support
@cindex Internationalization
@cindex Language Support
-@cindex Character set
-@cindex National letters
@cindex CJK language
-@cindex MULE
@cindex C@TeX{}
@cindex China@TeX{}
@cindex p@TeX{}
+@cindex up@TeX{}
@cindex ASCII p@TeX{}
@cindex j@TeX{}
@cindex NTT j@TeX{}
@cindex k@TeX{}
@cindex H@LaTeX{}
-@cindex CJK-@LaTeX{}
-@cindex UNICODE
-@cindex MULE-UCS
+@cindex @acronym{CJK}-@LaTeX{}
@TeX{} and Emacs are usable for European (Latin, Cyrillic, Greek) based
languages. Some @LaTeX{} and EmacsLisp packages are available for easy
@@ -4390,23 +4450,23 @@ typesetting and editing documents in European languages.
@c -> @acronym{CJK, Chinese@comma{} Japanese@comma{} and Korean}
All Emacs versions supported by current @AUCTeX{} can handle
-@acronym{CJK} languages by default.
+@acronym{CJK} (Chinese, Japanese, and Korean) languages by default.
In most cases, special versions of @TeX{} engines are needed for
high-quality typesetting of @acronym{CJK} languages: C@TeX{} and
China@TeX{} for Chinese, ASCII p@TeX{}, up@TeX{} and NTT j@TeX{} for
Japanese, H@LaTeX{} and k@TeX{} for Korean. They are necessary as well
when you want to typeset documents saved in their domestic encodings
-such as @acronym{Shift-JIS}. Currently, @AUCTeX{} offers native support
+such as @samp{Shift-JIS}. Currently, @AUCTeX{} offers native support
for p@TeX{}, up@TeX{} and j@TeX{} only.
@c FIXME: We need more information for CTeX, ChinaTeX, KTeX, and HLaTeX.
If you don't need fine tuning in the result with respect to the
typesetting rules of their respective national standards, most unicode
-based @TeX{} engines e.g. Lua@TeX{} and Xe@TeX{} can handle
+based @TeX{} engines, e.g.@: Lua@TeX{} and Xe@TeX{}, can handle
@acronym{CJK} languages by default if they are encoded in
-@acronym{UTF-8}. The @acronym{CJK}-@LaTeX{} package is provided for
+@acronym{UTF}-8. The @acronym{CJK}-@LaTeX{} package is provided for
supporting @acronym{CJK} scripts in a standard @LaTeX{} document.
@menu
@@ -4418,28 +4478,29 @@ supporting @acronym{CJK} scripts in a standard @LaTeX{}
document.
@subsection Using @AUCTeX{} with European Languages
@cindex Europe
@cindex European Characters
-@cindex ISO 8859 Latin 1
+@cindex @acronym{ISO} Character set
+@cindex @acronym{ISO} 8859 Latin 1
@cindex Latin 1
-@cindex ISO 8859 Latin 2
-@cindex Latin 2
-@cindex ANSI
@subsubsection Typing and Displaying Non-ASCII Characters
First you will need a way to write non-ASCII characters. You can either
-use macros, or teach @TeX{} about the ISO character sets. I prefer the
+use macros, or teach @TeX{} about the @acronym{ISO} character sets. I prefer
the
latter, it has the advantage that the usual standard emacs word
movement and case change commands will work.
-With @LaTeX{}2e, just add @samp{\usepackage[latin1]@{inputenc@}}. Other
-languages than Western European ones will probably have other encoding
-needs.
+Recommended encoding for @LaTeX{} document is @acronym{UTF}-8. Recent
+@LaTeX{}2e has native support for @acronym{UTF}-8. If your @LaTeX{}2e is
+not recent enough, just add @samp{\usepackage[utf8]@{inputenc@}}.
+
+You can still use @acronym{ISO} 8859 Latin 1 encoding with
+@samp{\usepackage[latin1]@{inputenc@}}.
To be able to display non-ASCII characters you will need an appropriate
-font and a version of GNU Emacs capable of displaying 8-bit characters.
-The manner in which this is supported differs between Emacsen, so you
-need to take a look at your respective documentation.
+font. All Emacs versions supported by current @AUCTeX{} can display 8-bit
+characters, provided that suitable fonts are installed.
+@c FIXME: These are considered as kind of obsolete, aren't they?
A compromise is to use an European character set when editing the file,
and convert to @TeX{} macros when reading and writing the files.
@@ -4467,7 +4528,7 @@ This requires parsing to be enabled, @pxref{Parsing
Files}.
@lisp
(add-hook 'TeX-language-dk-hook
- (lambda () (ispell-change-dictionary "danish")))
+ (lambda () (ispell-change-dictionary "danish")))
@end lisp
The following style files are recognized:
@@ -4482,8 +4543,11 @@ The following style files are recognized:
@vindex TeX-language-it-hook
@vindex TeX-language-is-hook
@vindex TeX-language-pl-hook
+@vindex TeX-language-pt-br-hook
+@vindex TeX-language-pt-hook
@vindex TeX-language-sk-hook
@vindex TeX-language-sv-hook
+@cindex Brazilian Portuguese
@cindex Bulgarian
@cindex Czech
@cindex Italian
@@ -4492,24 +4556,32 @@ The following style files are recognized:
@cindex English
@cindex German
@cindex Polish
+@cindex Portuguese
@cindex Slovak
@cindex Swedish
@table @file
+@item brazilian
+@itemx brazil
+Runs style hook @code{TeX-language-pt-br-hook}. Gives @samp{"} word
+syntax, makes the @key{"} key inserts @samp{``} or @samp{''} depending on
+context. Typing @key{"} twice will insert a literal @samp{"}. Typing
+@key{-} twice will insert @samp{"=}, three times @samp{--}.
+
@item bulgarian
-Runs style hook @code{TeX-language-bg-hook}. Gives @samp{"} word
-syntax, makes the @key{"} key insert a literal @samp{"}. Typing @key{"}
-twice will insert insert @samp{"`} or @samp{"'} depending on context.
-Typing @key{-} twice will insert @samp{"=}, three times @samp{--}.
+Runs style hook @code{TeX-language-bg-hook}. Gives @samp{"} word syntax,
+makes the @key{"} key insert a literal @samp{"}. Typing @key{"} twice
+will insert @samp{"`} or @samp{"'} depending on context. Typing @key{-}
+twice will insert @samp{"=}, three times @samp{--}.
@item czech
Runs style hook @code{TeX-language-cz-hook}. Pressing @key{"} will
insert @samp{\uv@{} and @samp{@}} depending on context.
-@c Is the difference between dk and danish really intented?
+@c FIXME: Is the difference between dk and danish really intented?
@item danish
Runs style hook @code{TeX-language-dk-hook}. Pressing @key{"} will
insert @samp{"`} and @samp{"'} depending on context. Typing @key{-}
-twice will insert @samp{"=}, i.e. a hyphen string allowing hyphenation
+twice will insert @samp{"=}, i.e.@: a hyphen string allowing hyphenation
in the composing words.
@c dk.sty seems to be obsolete, so we don't want to encourage using it.
@c @item dk
@@ -4527,7 +4599,7 @@ Runs style hook @code{TeX-language-en-hook}.
@item frenchb
@itemx francais
Runs style hook @code{TeX-language-fr-hook}. Pressing @key{"} will
-insert @samp{\\og} and @samp{\\fg} depending on context. Note that the
+insert @samp{\og} and @samp{\fg} depending on context. Note that the
language name for customizing @code{TeX-quote-language-alist} is
@samp{french}.
@@ -4540,10 +4612,10 @@ key twice will give you opening or closing German
quotes (@samp{"`} or
@samp{--}.
@item icelandic
-Runs style hook @code{TeX-language-is-hook}. Gives @samp{"} word
-syntax, makes the @key{"} key insert a literal @samp{"}. Typing @key{"}
-twice will insert insert @samp{"`} or @samp{"'} depending on context.
-Typing @key{-} twice will insert @samp{"=}, three times @samp{--}.
+Runs style hook @code{TeX-language-is-hook}. Gives @samp{"} word syntax,
+makes the @key{"} key insert a literal @samp{"}. Typing @key{"} twice
+will insert @samp{"`} or @samp{"'} depending on context. Typing @key{-}
+twice will insert @samp{"=}, three times @samp{--}.
@item italian
Runs style hook @code{TeX-language-it-hook}. Pressing @key{"} will
@@ -4559,6 +4631,14 @@ Runs style hook @code{TeX-language-pl-hook}. Makes the
@key{"} key
insert a literal @samp{"}. Pressing @key{"} twice will insert @samp{,,}
or @samp{''} depending on context.
+@item portuguese
+@itemx portuges
+Runs style hook @code{TeX-language-pt-hook}. Gives @samp{"} word syntax,
+makes the @key{"} key inserts @samp{"<} or @samp{">} depending on context.
+Typing @key{"} twice will insert a literal @samp{"}. Typing @key{-} twice
+will insert @samp{"=}, three times @samp{--}. Note that the language name
+for customizing @code{TeX-quote-language-alist} is @samp{portuguese}.
+
@item slovak
Runs style hook @code{TeX-language-sk-hook}. Pressing @key{"} will
insert @samp{\uv@{} and @samp{@}} depending on context.
@@ -4589,7 +4669,7 @@ mark. Opening and closing quotation marks can be
specified directly as
strings or as functions returning a string. The fourth item is a
boolean controlling quote insertion. It should be non-nil if if the
special quotes should only be used after inserting a literal @samp{"}
-character first, i.e. on second key press.
+character first, i.e.@: on second key press.
@end defopt
@defopt LaTeX-babel-hyphen-language-alist
@@ -4599,7 +4679,7 @@ first item should specify the affected language as a
string. The second
item denotes the hyphen string to be used as a string. The third item,
a boolean, controls the behavior of hyphen insertion and should be
non-nil if the special hyphen should be inserted after inserting a
-literal @samp{-} character, i.e. on second key press.
+literal @samp{-} character, i.e.@: on second key press.
@end defopt
The defaults of hyphen insertion are defined by the variables
@@ -4627,7 +4707,6 @@ If nil do it the other way round.
@cindex Japan
@cindex Japanese
@cindex Nippon
-@cindex MULE
@cindex NTT j@TeX{}
@cindex j@TeX{}
@cindex j@LaTeX{}
@@ -4641,38 +4720,35 @@ If nil do it the other way round.
@vindex TeX-parse-self
@vindex TeX-engine
@vindex TeX-engine-alist
-@vindex japanese-TeX-engine-default
-@vindex japanese-LaTeX-default-style
-@vindex japanese-TeX-use-kanji-opt-flag
-@vindex TeX-japanese-process-input-coding-system
-@vindex TeX-japanese-process-output-coding-system
+@vindex japanese-TeX-mode
+@findex japanese-plain-tex-mode
+@findex japanese-latex-mode
To write Japanese text with @AUCTeX{}, you need the versions of
@TeX{} and Emacs that support Japanese. @AUCTeX{} supports three
Japanese @TeX{} engines by default: NTT j@TeX{}, ASCII p@TeX{} and
up@TeX{}.
-To use the Japanese @TeX{} engines, activate
-@code{japanese-plain-tex-mode} or @code{japanese-latex-mode}. If it
-doesn't work, send mail to Masayuki Ataka
-@samp{<masayuki.ataka@@gmail.com>} or Ikumi Keita
-@samp{<ikumikeita@@jcom.home.ne.jp>}, who currently concern with
-stuff related to Japanese in @AUCTeX{}. None of the primary @AUCTeX{}
+Activate @code{japanese-plain-tex-mode} or @code{japanese-latex-mode} to
+use the Japanese @TeX{} engines. If it doesn't work, send mail to
+Masayuki Ataka @email{masayuki.ataka@@gmail.com} or Ikumi Keita
+@email{ikumikeita@@jcom.home.ne.jp}, who currently concern with stuff
+related to Japanese in @AUCTeX{}. None of the primary @AUCTeX{}
maintainers understand Japanese, so they cannot help you.
It is recommended to enable @code{TeX-parse-self} for typical Japanese
@LaTeX{} users. When enabled, @code{japanese-latex-mode} selects the
suitable Japanese @TeX{} engine automatically based on the class file
name (such as @code{jbook}, @code{jsarticle} and @code{tjreport}) and
-its option. @pxref{Parsing Files}.
+its option. @xref{Parsing Files}.
It is important to select the suitable Japanese @TeX{} engine because
-the selected engine determines the command name such as @samp{platex}
-and @samp{uptex} to typeset the document. If you find that wrong
+the selected engine determines the command name such as @command{platex}
+and @command{uptex} to typeset the document. If you find that wrong
command is used, check the value of @code{TeX-engine} on that buffer.
If the value does not suit the current document, change the value by the
@samp{TeXing Options} submenu below the @samp{Command} menu.
-@pxref{Processor Options}.
+@xref{Processor Options}.
To make the selected engine to persist across Emacs sessions, there are
two ways from which you can choose one according to your needs:
@@ -4683,7 +4759,7 @@ If you use a specific engine (almost) exclusively,
customize the option
@code{japanese-TeX-engine-default}.
@defopt japanese-TeX-engine-default
-The default TeX engine in Japanese @TeX{} mode.
+The default @code{TeX-engine} in Japanese @TeX{} mode.
The default value is @samp{ptex}.
@end defopt
@@ -4737,13 +4813,13 @@ The default value is @samp{"jarticle"}.
@end defopt
It is recommended also for Japanese users to customize the option
-@code{TeX-PDF-from-DVI} to @code{"Dvipdfmx"}. @xref{Processor Options}
+@code{TeX-PDF-from-DVI} to @samp{"Dvipdfmx"}. @xref{Processor Options}.
There are three customize options with regard to the encoding of
Japanese text.
@defopt japanese-TeX-use-kanji-opt-flag
-If non-nil, @AUCTeX{} adds @code{-kanji} option to the typesetting
+If non-nil, @AUCTeX{} adds @option{-kanji} option to the typesetting
command when @code{TeX-engine} is @samp{ptex}.
@end defopt
@@ -4776,7 +4852,7 @@ The following two additional font commands are available
in
@kindex C-c C-f g
@cindex @code{\textgt}
@cindex @code{\mathgt}
-Insert @b{gothic face} font command @samp{\textgt@{@point{}@}} or
+Insert @b{gothic font} command @samp{\textgt@{@point{}@}} or
@samp{\mathgt@{@point{}@}} depending on the context.
@item C-c C-f m
@@ -4817,7 +4893,7 @@ useful style files for your own use. The local level is
for a specific
directory, and deals with writing customization for the files for your
normal @TeX{} documents.
-If compared with the environment variable @code{TEXINPUTS}, the
+If compared with the environment variable @env{TEXINPUTS}, the
global level corresponds to the directories built into @TeX{}. The
private level corresponds to the directories you add yourself, except for
@file{.}, which is the local level.
@@ -4913,9 +4989,9 @@ Use @kbd{M-x TeX-auto-generate @key{RET}} to extract the
information.
@defopt TeX-macro-private
Directories where you store your personal @TeX{} macros. The value
-defaults to the directories listed in the @samp{TEXINPUTS} and
-@samp{BIBINPUTS} environment variables or to the respective directories
-in @code{$TEXMFHOME} if no results can be obtained from the environment
+defaults to the directories listed in the @env{TEXINPUTS} and
+@env{BIBINPUTS} environment variables or to the respective directories
+in @code{$TEXMFHOME} of @command{kpsewhich} setting if no results can be
obtained from the environment
variables.
@end defopt
@@ -4924,9 +5000,9 @@ List of directories containing automatically generated
@AUCTeX{} style
files. These correspond to the personal @TeX{} macros.
@end defopt
-@deffn Command TeX-auto-generate @var{TEX} @var{AUTO}
+@deffn Command TeX-auto-generate @var{tex} @var{auto}
(@kbd{M-x TeX-auto-generate @key{RET}}) Generate style hook for
-@var{TEX} and store it in @var{AUTO}. If @var{TEX} is a directory,
+@var{tex} and store it in @var{auto}. If @var{tex} is a directory,
generate style hooks for all files in the directory.
@end deffn
@@ -4945,11 +5021,11 @@ These correspond to the personal @TeX{} macros.
@AUCTeX{} can update the style information about a file each time you
save it, and it will do this if the directory @code{TeX-auto-local}
-exists. @code{TeX-auto-local} is by default set to @samp{"auto"}, so
+exists. @code{TeX-auto-local} is by default set to @samp{"auto"}, so
simply creating an @file{auto} directory will enable automatic saving of
style information.
-The advantage of doing this is that macros, labels, etc. defined in any
+The advantage of doing this is that macros, labels, etc.@: defined in any
file in a multifile document will be known in all the files in the
document. The disadvantage is that saving will be slower. To disable,
set @code{TeX-auto-local} to nil.
@@ -4981,7 +5057,7 @@ directories instead of @file{auto} directories.
* Simple Style:: A Simple Style File
* Adding Macros:: Adding Support for Macros
* Adding Environments:: Adding Support for Environments
-* Adding Other:: Adding Other Information
+* Adding Other:: Adding or Examining Other Information
* Hacking the Parser:: Automatic Extraction of New Things
@end menu
@@ -5005,14 +5081,15 @@ Here is a simple example of a style file.
(TeX-add-style-hook
"book"
(lambda ()
- (LaTeX-largest-level-set "chapter"))
+ (LaTeX-largest-level-set "part"))
TeX-dialect)
@end lisp
The example is from the @AUCTeX{} sources and is loaded for any @LaTeX{}
document using the book document class (or style before @LaTeX{}2e).
+(Note that the above code is much simplified for explanatory purpose.)
The file specifies that the largest kind of section in such a document
-is chapter. The interesting thing to notice is that the style file
+is @samp{part}. The interesting thing to notice is that the style file
defines an (anonymous) function, and adds it to the list of loaded style
hooks by calling @code{TeX-add-style-hook}.
@@ -5028,7 +5105,7 @@ should usually be identical.
@defun TeX-add-style-hook @var{style} @var{hook} &optional @var{dialect-expr}
Add @var{hook} to the list of functions to run when we use the @TeX{}
file @var{style} and the current dialect is one in the set derived from
-@var{dialect-expr}. When @var{dialect-expr} is omitted, then @var{hook}
+@var{dialect-expr}. When @var{dialect-expr} is omitted, then @var{hook}
is allowed to be run whatever the current dialect is.
@var{dialect-expr} may be one of:
@@ -5043,7 +5120,7 @@ For all files in @LaTeX{} mode, or any mode derived
thereof.
@item :bibtex
For all files in Bib@TeX{} mode, or any mode derived thereof.
@item :texinfo
-For all files in @acronym{Texinfo} mode.
+For all files in Texinfo mode.
@item :plain-tex
For all files in plain-@TeX{} mode, or any mode derived thereof.
@item :context
@@ -5080,7 +5157,7 @@ defined to @code{:latex}, rather than passing
@code{:latex} directly.
@defvr Constant TeX-dialect
Default dialect for use with function @code{TeX-add-style-hook} for
-argument @var{dialect-expr} when the hook is to be run only on LaTeX
+argument @var{dialect-expr} when the hook is to be run only on @LaTeX{}
file, or any mode derived thereof.
@end defvr
@@ -5125,15 +5202,15 @@ match an argument of the @TeX{} macro. What is done
depends on the argument
type.
If a macro is defined multiple times, @AUCTeX{} will choose the one with
-the longest definition (i.e. the one with the most arguments).
+the longest definition (i.e.@: the one with the most arguments).
Thus, to overwrite
@example
- '("tref" 1) ; one argument
+ '("tref" 1) ; @r{one argument}
@end example
you can specify
@example
- '("tref" TeX-arg-ref ignore) ; two arguments
+ '("tref" TeX-arg-ref ignore) ; @r{two arguments}
@end example
@code{ignore} is a function that does not do anything, so when you
@@ -5148,7 +5225,7 @@ Use the string as a prompt to prompt for the argument.
@item number
Insert that many braces, leave point inside the first. 0 and -1 are
special. 0 means that no braces are inserted. -1 means that braces are
-inserted around the macro and an active region (e.g. @samp{@{\tiny
+inserted around the macro and an active region (e.g.@: @samp{@{\tiny
foo@}}). If there is no active region, no braces are inserted.
@item nil
@@ -5181,8 +5258,8 @@ prompt.
@ftable @code
@item TeX-arg-conditional
-Implements if EXPR THEN ELSE. If EXPR evaluates to true, parse THEN as an
-argument list, else parse ELSE as an argument list.
+Implements if @var{expr} @var{then} @var{else}. If @var{expr} evaluates to
true, parse @var{then} as an
+argument list, else parse @var{else} as an argument list.
@item TeX-arg-literal
Insert its arguments into the buffer. Used for specifying extra syntax
@@ -5221,7 +5298,7 @@ Prompt for a date, defaulting to the current date. The
format of the
date is specified by the @code{TeX-date-format} option. If you want to
change the format when the @samp{babel} package is loaded with a
specific language, set @code{TeX-date-format} inside the appropriate
-language hook, for details @pxref{European}.
+language hook (for details @pxref{European}).
@item TeX-arg-version
Prompt for the version of a file, using as initial input the current
@@ -5310,7 +5387,7 @@ Prompt for a Bib@TeX{} style file completing with all
style available on
your system.
@item TeX-arg-bibliography
-Prompt for BibTeX database files completing with all databases available
+Prompt for Bib@TeX{} database files completing with all databases available
on your system.
@item TeX-arg-corner
@@ -5334,7 +5411,7 @@ Prompt for delimiter and text. This function is similar
to
argument enclosed in delimiters or in braces.
@item TeX-arg-pair
-Insert a pair of numbers, use arguments for prompt. The numbers are
+Insert a pair of numbers, use arguments for prompt. The numbers are
surrounded by parentheses and separated with a comma.
@item TeX-arg-size
@@ -5349,10 +5426,10 @@ Prompt for document author, using
@code{LaTeX-default-author} as initial
input.
@item TeX-read-key-val
-Prompt for a key=value list of options and return them.
+Prompt for a @samp{key=value} list of options and return them.
@item TeX-arg-key-val
-Prompt for a key=value list of options and insert it as a @TeX{} macro
+Prompt for a @samp{key=value} list of options and insert it as a @TeX{} macro
argument.
@end ftable
@@ -5368,9 +5445,9 @@ Those should be marked as expert macros using
@code{TeX-declare-expert-macros}.
@defun TeX-declare-expert-macros @var{style} @var{macros}...
-Declare MACROS as expert macros of STYLE.
+Declare @var{macros} as expert macros of @var{style}.
-Expert macros are completed depending on `TeX-complete-expert-commands'.
+Expert macros are completed depending on @code{TeX-complete-expert-commands}.
@end defun
@@ -5441,7 +5518,7 @@ the appropriate style directory.
(LaTeX-add-environments
'("enumerate" LaTeX-env-enumerate foo))))
-(defun LaTeX-env-enumerate (environment &optional ignore) ...)
+(defun LaTeX-env-enumerate (environment &optional _ignore) ...)
@end lisp
The symbol @code{foo} will be passed to @code{LaTeX-env-enumerate} as
@@ -5502,7 +5579,7 @@ specification of arguments to be prompted for with
strings and strings
wrapped in a vector as described above is too limited.
Here is an example from @file{listings.el} which calls a function with
-one argument in order to prompt for a key=value list to be inserted as
+one argument in order to prompt for a @samp{key=value} list to be inserted as
an optional argument of the @samp{lstlisting} environment:
@lisp
@@ -5516,17 +5593,20 @@ Some packages provide environments that are rarely
useful to non-expert
users. Those should be marked as expert environments using
@code{LaTeX-declare-expert-environments}.
-@defun LaTeX-declare-expert-environments @var{style} @var{ENVIRONMENTS}...
-Declare ENVIRONMENTS as expert environments of STYLE.
+@defun LaTeX-declare-expert-environments @var{style} @var{environments}...
+Declare @var{environments} as expert environments of @var{style}.
-Expert environments are completed depending on `TeX-complete-expert-commands'.
+Expert environments are completed depending on
@code{TeX-complete-expert-commands}.
@end defun
@node Adding Other
-@subsection Adding Other Information
+@subsection Adding or Examining Other Information
@cindex Adding bibliographies
@cindex Bibliographies, adding
+@cindex Examining package/class options
+@cindex package/class options, Examining
+@cindex Viewer predicates
@cindex Defining bibliographies in style hooks
@cindex Adding labels
@cindex Labels, adding
@@ -5535,6 +5615,8 @@ Expert environments are completed depending on
`TeX-complete-expert-commands'.
@cindex Other information, adding
@cindex Defining other information in style hooks
+@subsubsection Adding bibliographies in style hooks
+
You can also specify bibliographical databases and labels in the style
file. This is probably of little use, since this information will
usually be automatically generated from the @TeX{} file anyway.
@@ -5547,6 +5629,58 @@ Add each @var{bibliography} to list of loaded
bibliographies.
Add each @var{label} to the list of known labels.
@end defun
+@subsubsection Examining package/class options
+
+In @LaTeX{} documents, style hooks can find the package names and those
+options given as optional argument(s) of @code{\usepackage} in
+@code{LaTeX-provided-package-options}.
+
+@defvar LaTeX-provided-package-options
+Buffer local variable holding alist of options provided to @LaTeX{}
+packages. Each element is a cons cell @code{(@var{package}
+. @var{option-list})}. For example, its value will be
+@lisp
+ (("babel" . ("german"))
+ ("geometry" . ("a4paper" "top=2cm" "bottom=2cm" "left=2.5cm" "right=2.5cm"))
+ ...)
+@end lisp
+@end defvar
+
+You can examine whether there is a specific package-option pair by
+@code{LaTeX-provided-package-options-member}.
+
+@defun LaTeX-provided-package-options-member @var{package} @var{option}
+Return non-@code{nil} if @var{option} has been given to @var{package}.
+The value is actually the tail of the list of options given to
+@var{package}.
+@end defun
+
+There are similar facilities for class names and those options given in
+@code{\documentclass} declaration.
+
+@defvar LaTeX-provided-class-options
+Buffer local variable holding alist of options provided to @LaTeX{}
+classes. Each element is a cons cell @code{(@var{class}
+. @var{option-list})}. For example, its value will be
+@lisp
+ (("book" . ("a4paper" "11pt" "openany" "fleqn"))
+ ...)
+@end lisp
+@end defvar
+
+@defun LaTeX-provided-class-options-member @var{class} @var{option}
+Return non-@code{nil} if @var{option} has been given to @var{class}. The
+value is actually the tail of the list of options given to @var{class}.
+@end defun
+
+@defun LaTeX-match-class-option @var{regexp}
+Check if a documentclass option matching @var{regexp} is active. Return
+first found class option matching @var{regexp}, or nil if not found.
+@end defun
+
+These functions are also useful to implement customized predicate(s) in
+@code{TeX-view-predicate-list}. @xref{Starting Viewers}.
+
@node Hacking the Parser
@subsection Automatic Extraction of New Things
@cindex Parsing new macros
@@ -5581,19 +5715,19 @@ defined. We can specify this information in a style
hook file.
(defvar TeX-newmacro-regexp
'("\\\\newmacro@{\\\\\\([a-zA-Z]+\\)@}@{\\\\\\([a-zA-Z]+\\)@}"
(1 2) TeX-auto-multi)
- "Matches \newmacro definitions.")
+ "Matches \\newmacro definitions.")
(defvar TeX-auto-multi nil
"Temporary for parsing \\newmacro definitions.")
(defun TeX-macro-cleanup ()
"Move symbols from `TeX-auto-multi' to `TeX-auto-symbol'."
- (mapcar (lambda (list)
- (mapcar (lambda (symbol)
- (setq TeX-auto-symbol
- (cons symbol TeX-auto-symbol)))
- list))
- TeX-auto-multi))
+ (mapc (lambda (list)
+ (mapc (lambda (symbol)
+ (setq TeX-auto-symbol
+ (cons symbol TeX-auto-symbol)))
+ list))
+ TeX-auto-multi))
(defun TeX-macro-prepare ()
"Clear `Tex-auto-multi' before use."
@@ -5607,11 +5741,11 @@ defined. We can specify this information in a style
hook file.
(lambda ()
(TeX-auto-add-regexp TeX-newmacro-regexp)
(TeX-add-symbols '("newmacro"
- TeX-arg-macro
- (TeX-arg-macro "Capitalized macro: \\")
- t
- "BibTeX entry: "
- nil))))
+ TeX-arg-macro
+ (TeX-arg-macro "Capitalized macro: \\")
+ t
+ "BibTeX entry: "
+ nil))))
;;; macro.el ends here
@end lisp
@@ -5633,20 +5767,20 @@ found.
@defvar TeX-auto-regexp-list
List of regular expressions matching @TeX{} macro definitions.
-The list has the following format ((REGEXP MATCH TABLE) @dots{}), that
+The list has the following format ((@var{regexp} @var{match} @var{table})
@dots{}), that
is, each entry is a list with three elements.
-REGEXP. Regular expression matching the macro we want to parse.
+@var{regexp}. Regular expression matching the macro we want to parse.
-MATCH. A number or list of numbers, each representing one
-parenthesized subexpression matched by REGEXP.
+@var{match}. A number or list of numbers, each representing one
+parenthesized subexpression matched by @var{regexp}.
-TABLE. The symbol table to store the data. This can be a function, in
-which case the function is called with the argument MATCH. Use
+@var{table}. The symbol table to store the data. This can be a function, in
+which case the function is called with the argument @var{match}. Use
@code{TeX-match-buffer} to get match data. If it is not a function, it
is presumed to be the name of a variable containing a list of match
-data. The matched data (a string if MATCH is a number, a list of
-strings if MATCH is a list of numbers) is put in front of the table.
+data. The matched data (a string if @var{match} is a number, a list of
+strings if @var{match} is a list of numbers) is put in front of the table.
@end defvar
@defvar TeX-auto-prepare-hook nil
@@ -5715,8 +5849,8 @@ See the file @file{history.texi} for older changes.
@appendixsec Features specific to @AUCTeX{}'s Texinfo major mode
@AUCTeX{} includes a major mode for editting Texinfo files. This major
-mode is not the same mode as the native Texinfo mode (@pxref{(texinfo)
-Texinfo Mode}) of Emacs, although they have the same name. However,
+mode is not the same mode as the native Texinfo mode (@pxref{Texinfo Mode,,,
+texinfo,Texinfo}) of Emacs, although they have the same name. However,
@AUCTeX{} still relies on a number of functions from the native Texinfo
mode.
@@ -5743,12 +5877,12 @@ Texinfo mode is as follows:
@itemize
@item
Most of the editing (environment creation, commenting, font command
-insertions) and/or processing commands (e.g. compiling or printing)
+insertions) and/or processing commands (e.g.@: compiling or printing)
which are available in other @AUCTeX{} modes are also handled by
@AUCTeX{} in Texinfo mode.
@item
-Texinfo-related features (e.g. info node linkage or menu creation) rely
+Texinfo-related features (e.g.@: info node linkage or menu creation) rely
on the commands provided by the native Texinfo mode. @AUCTeX{} provides
the key bindings to reach these functions, keeping the same keys as in
native Texinfo whenever possible, or similar ones otherwise.
@@ -5759,21 +5893,21 @@ native Texinfo whenever possible, or similar ones
otherwise.
This section is directed to users of the native Texinfo mode switching
to @AUCTeX{}. It follows the summary of the native mode
-(@pxref{(texinfo) Texinfo Mode Summary}) and lists which of its commands
+(@pxref{Texinfo Mode Summary,,,texinfo,Texinfo}) and lists which of its
commands
are no longer of use.
@table @asis
@item Insert commands
In the native Texinfo mode, frequently used Texinfo commands can be
inserted with key bindings of the form @kbd{C-c C-c @var{k}} where
-@var{k} differs for each Texinfo command; @kbd{c} inserts @@code,
-@kbd{d} inserts @@dfn, @kbd{k} @@kbd, etc.
+@var{k} differs for each Texinfo command; @kbd{c} inserts @code{@@code},
+@kbd{d} inserts @code{@@dfn}, @kbd{k} @code{@@kbd}, etc.
In @AUCTeX{} commands are inserted with the key binding @kbd{C-c C-m}
instead which prompts for the macro to be inserted. For font selection
-commands (like @@b, @@i, or @@emph) and a few related ones (like @@var,
-@@key or @@code) there are bindings which insert the respective macros
-directly. They have the form @code{C-c C-f @var{k}} or @code{C-c C-f
+commands (like @code{@@b}, @code{@@i}, or @code{@@emph}) and a few related
ones (like @code{@@var},
+@code{@@key} or @code{@@code}) there are bindings which insert the respective
macros
+directly. They have the form @kbd{C-c C-f @var{k}} or @kbd{C-c C-f
C-@var{k}} and call the function @code{TeX-font}. Type @kbd{C-c C-f
@key{RET}} to get a list of supported commands.
@@ -5790,9 +5924,9 @@ for the feature: @code{TeX-insert-braces}.
@item Insert environments
The native Texinfo mode does not insert full environments. Instead, it
provides the function @code{texinfo-insert-@@end} (mapped to @kbd{C-c
-C-c e}) for closing an open environment with a matching @@end statement.
+C-c e}) for closing an open environment with a matching @code{@@end} statement.
-In @AUCTeX{} you can insert full environments, i.e. both the opening and
+In @AUCTeX{} you can insert full environments, i.e.@: both the opening and
closing statements, with the function @code{Texinfo-environment} (mapped
to @kbd{C-c C-e}).
@@ -5835,8 +5969,10 @@ The native Texinfo mode provides the binding @kbd{C-c
C-t C-i}
@kbd{C-c C-t C-p} (@code{texinfo-tex-print}) and @kbd{C-c C-t C-q}
(@code{tex-show-print-queue}) for printing and showing the printer
queue. These are superseded by the respective commands available
-through @kbd{C-c C-c} (@code{TeX-command-master}) in @AUCTeX{}: Index,
-Print, and Queue.
+through @kbd{C-c C-c} (@code{TeX-command-master}) in @AUCTeX{}: @samp{Index},
+@samp{Print}, and @samp{Queue}.
+@c FIXME: "Index" runs makeindex, not texindex. No entry in
+@c TeX-command-list runs texindex.
@item Kill jobs
The command @kbd{C-c C-t C-k} (@code{tex-kill-job}) in the native mode
@@ -5846,8 +5982,8 @@ is superseded by @kbd{C-c C-k} (@code{TeX-kill-job}) in
@AUCTeX{}.
@node Mapping
@appendixsubsec Where key bindings are mapped to the native mode
-This node follows the native Texinfo mode summary (@pxref{(texinfo)
-Texinfo Mode Summary}) and lists only those commands to which @AUCTeX{}
+This node follows the native Texinfo mode summary (@pxref{Texinfo Mode
+Summary,,,texinfo,Texinfo}) and lists only those commands to which @AUCTeX{}
provides a keybinding.
Basically all commands of the native mode related to producing menus and
@@ -5864,13 +6000,13 @@ native mode is mapped to @kbd{M-@key{RET}} or @kbd{C-c
C-j} in
@item @code{@@end} insertion
The binding @kbd{C-c C-c e} for closing a @code{@@@var{foo}} command by
a corresponding @code{@@end @var{foo}} statement in the native mode is
-mapped to @kbd{C-c C-]} in @AUCTeX{}, similar to other @AUCTeX{} modes.
+mapped to @kbd{C-c ]} in @AUCTeX{}, similar to other @AUCTeX{} modes.
@item Move out of balanced braces
-The binding @kbd{C-@}} (@code{up-list}) is available both in the native
+The binding @kbd{C-c @}} (@code{up-list}) is available both in the native
mode and in @AUCTeX{}. (This is because the command is not implemented
in either mode but a native Emacs command.) However, in @AUCTeX{}, you
-cannot use @kbd{C-]} for this, as it is used for @code{@@end} insertion.
+cannot use @kbd{C-c ]} for this, as it is used for @code{@@end} insertion.
@item Update pointers
The bindings @kbd{C-c C-u C-n} (@code{texinfo-update-node}) and @kbd{C-c
diff --git a/doc/changes.texi b/doc/changes.texi
index 109c4da..a24ff5b 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -8,10 +8,22 @@
@end ifset
-@heading News in 13.0
+@heading News in 13.1
@itemize @bullet
@item
+@AUCTeX{}'s own help messages for @LaTeX{} errors are now shown only for
+@LaTeX{} runs. @AUCTeX{} shows raw error/warning messages found in
+@file{.log} files for runs of formats other than @LaTeX{}, such as plain
+@TeX{}, @ConTeXt{} and Texinfo, as it does even for @LaTeX{} runs when it
+can't find a matching entry in its own help message catalogue.
+
+Due to this change, customize option @code{TeX-error-description-list} can
+no longer have a fallback entry that matches any error. If your
+customized value includes such entry, typically @samp{(".*" . "No help
+available")}, please remove it.
+
+@item
Two functions @code{TeX-split-string} and @code{TeX-assoc} are now
obsolete and will be removed in future release. If your personal code
uses these functions, use @code{split-string} and @code{assoc-string}
@@ -36,7 +48,7 @@ no effect now. The former placeholders @samp{%v} and
@samp{%vv} in
24. This change should have no user-visible effect and require no
manual adaptions except in the following cases.
-@itemize @bullet
+@itemize @minus
@item
Entries added to the customization variable @code{TeX-expand-list} also
had access to variables @code{command} and @code{pos}. Those are now
@@ -65,7 +77,7 @@ have been read. This variable is now named
@code{TeX-exit-mark}.
The functions in @code{LaTeX-section-hook} had access or modified the
previously undeclared variables @code{title}, @code{name}, @code{level},
@code{done-mark}, and @code{toc}. These variables are now properly
-declared and have the @code{LaTeX-} prefix, e.g.,
+declared and have the @samp{LaTeX-} prefix, e.g.,
@code{LaTeX-done-mark}.
@item
@@ -73,14 +85,14 @@ The functions in @code{ConTeXt-numbered-section-hook} and
@code{ConTeXt-unnumbered-section-hook} had access or modified the
previously undeclared variables @code{title}, @code{name}, @code{level},
@code{done-mark}, and @code{reference}. These variables are now
-properly declared and have the @code{ConTeXt-} prefix, e.g.,
+properly declared and have the @samp{ConTeXt-} prefix, e.g.,
@code{ConTeXt-title}.
@item
The functions in @code{TeX-translate-location-hook} could access and
modify the free variables @code{file}, @code{line}, @code{error},
@code{offset}, @code{context}, and @code{string}. Those are now properly
-declared variables with the prefix @code{TeX-translate-location-}, e.g.,
+declared variables with the prefix @samp{TeX-translate-location-}, e.g.,
@code{TeX-translate-location-file}.
@end itemize
@@ -88,17 +100,22 @@ declared variables with the prefix
@code{TeX-translate-location-}, e.g.,
The constant @code{LaTeX-dialect} has been renamed to @code{TeX-dialect}
and moved from @file{latex.el} to @file{tex.el}. @code{LaTeX-dialect}
now is an obsolete alias.
+
+@item
+The style @file{latexinfo.el} is removed from @AUCTeX{}.
+@file{latexinfo.el} was meant to support latexinfo which in return was a
+@LaTeX{}-2.09 extension of Texinfo, but didn't manage to replace Texinfo.
@end itemize
@heading News in 12.3
@itemize @bullet
@item
-Support for @samp{PSTricks} is now @acronym{PDF}-oriented. @AUCTeX{} no
+Support for @samp{PSTricks} is now @acronym{PDF}-oriented. @AUCTeX{} no
longer turns off PDF mode for @samp{PSTricks} documents even without
-@samp{pst-pdf}. It now sets up @code{TeX-PDF-from-DVI} option so that
+@samp{pst-pdf}. It now sets up @code{TeX-PDF-from-DVI} option so that
@acronym{PDF} output is generated when @code{TeX-PDF-mode} is enabled
-(default). Users who want @acronym{DVI} output should disable PDF mode
+(default). Users who want @acronym{DVI} output should disable PDF mode
explicitly by file local variable, or customize @code{TeX-PDF-mode} to
@code{nil}.
@@ -113,20 +130,12 @@ no-op which only shows a warning explaining how to update
font-lock as
mentioned above.
@item
-Math expression highlighting was improved. Highlighting for documents
+Math expression highlighting was improved. Highlighting for documents
with a lot of inline math expressions @samp{$...$} won't get scrambled
now (@samp{bug#33139}).
-There is small incompatibility due to this fix. When odd number of
-dollar signs are in a comment, the subsequent lines are highlighted as
-math until another @samp{$} appears. You can insert a commented dollar
-sign (@samp{%$}) at the next suitable end of line as a workaround.
-@ifclear rawfile
-@xref{Known problems}.
-@end ifclear
-
In addition, it is no longer recommended to customize
-@code{font-latex-math-environments}. Use @code{texmathp-tex-commands}
+@code{font-latex-math-environments}. Use @code{texmathp-tex-commands}
instead.
@ifclear rawfile
@xref{Fontification of math}.
@@ -143,7 +152,7 @@ See the section for inserting font specifiers for details.
@ifclear rawfile
@xref{Font Specifiers}, for details.
@end ifclear
-Further, the entries in the menu LaTeX, Insert Font are reorganized and
+Further, the entries in the menu @samp{LaTeX}, @samp{Insert Font} are
reorganized and
adjusted accordingly.
Macros previously provided by @file{textcomp.sty} are now part of
@@ -151,7 +160,7 @@ Macros previously provided by @file{textcomp.sty} are now
part of
the new macro @samp{\legacyoldstylenums} is added.
@item
-Insertion of environments in @LaTeX{} documents (i.e. @kbd{C-c C-e}) was
+Insertion of environments in @LaTeX{} documents (i.e.@: @kbd{C-c C-e}) was
improved. The former code had a few bugs, which sometimes resulted in
either spurious empty line or spurious comment prefix, or both,
especially when the region is active. Those bugs are now fixed.
@@ -184,7 +193,7 @@ option among the three: new, traditional and fallback
method.
@item
@AUCTeX{} has support for the Flymake package in Emacs 26 or newer. To
-enable, call @kbd{M-x flymake-mode RET} or add this to your
+enable, call @kbd{M-x flymake-mode @key{RET}} or add this to your
@file{.emacs} file:
@lisp
(add-hook 'LaTeX-mode-hook #'flymake-mode)
@@ -205,7 +214,7 @@ used to carry is required.
@item
Support for standard @LaTeX{} without e-@TeX{} extension is now very
limited. It doesn't work if raw @TeX{} code is put on the command line
-to invoke latex command. It also fails for region compilation (@kbd{C-c
+to invoke @command{latex} command. It also fails for region compilation
(@kbd{C-c
C-r} and so on) with documents of non-ascii file name. In addition, it
no longer works with @previewlatex{}. We consider this incompatibility
is permissible because e-@TeX{} extension is enabled for standard
@@ -299,7 +308,7 @@ Add support for @command{upmendex}, an extension of
@command{makeindex}
capable of sorting indexes by unicode based ICU.
@item
-Fix preview-latex to interact correctly with Japanese @LaTeX{}. The
+Fix @previewlatex{} to interact correctly with Japanese @LaTeX{}. The
parsing routine was made robust not to be confused by the 7-bit encoding
of Japanese text and the necessary option to @LaTeX{} command is kept
even when preamble caching is enabled.
@@ -341,7 +350,7 @@ correctly.
Inserting labels is done by new function
@code{LaTeX-env-label-as-keyval}. A new customize option
@code{LaTeX-listing-label} is available as prefix to labels in code
-typesetting environments, e.g. @samp{lstlisting} environment provided by
+typesetting environments, e.g.@: @samp{lstlisting} environment provided by
@samp{listings} package. @code{LaTeX-listing-label} defaults to
@code{lst:}. Parsing of labels for later referencing relies on two
requirements:
@@ -501,8 +510,8 @@ still available but now @kbd{C-c ?} runs
@item
@AUCTeX{} has a new custom option
@code{LaTeX-reftex-cite-format-auto-activate} which controls the
-automatic activation of citation formats provided by RefTeX when a style
-file is loaded and RefTeX is enabled. Currently, @file{biblatex.el},
+automatic activation of citation formats provided by Ref@TeX{} when a style
+file is loaded and Ref@TeX{} is enabled. Currently, @file{biblatex.el},
@file{harvard.el}, @file{jurabib.el} and @file{natbib.el} use this
feature. If you have customized @code{reftex-cite-format} and want to
use your settings, you should set this variable to @code{nil}.
@@ -540,7 +549,7 @@ the viewer with a single command:
@code{TeX-command-run-all}, bound to
@kbd{C-c C-a}.
@item
-Commands such as LaTeX and View can now be executed conveniently on the
+Commands such as @samp{LaTeX} and @samp{View} can now be executed conveniently
on the
current section (or part, chapter, subsection, etc). See
@code{LaTeX-command-section} and
@code{LaTeX-command-section-change-level}.
@@ -615,7 +624,7 @@ Numbers of bugs have been fixed, many minor features have
been added.
Now @code{TeX-previous-error} works with @TeX{} commands if the new
option @code{TeX-parse-all-errors} is non-nil, which is the default.
When this option is non-nil, an overview of errors and warnings reported
-by the TeX compiler can be opened with @kbd{M-x TeX-error-overview
+by the @TeX{} compiler can be opened with @kbd{M-x TeX-error-overview
@key{RET}}.
@ifclear rawfile
@xref{Debugging}, for details.
@@ -661,7 +670,7 @@ New user options @code{LaTeX-default-author},
@item
@samp{biblatex} support was greatly expanded. If parsing is enabled,
@AUCTeX{} looks at @samp{backend} option to decide whether to use Biber
-or BibTeX. The @code{LaTeX-biblatex-use-Biber} variable was changed to
+or Bib@TeX{}. The @code{LaTeX-biblatex-use-Biber} variable was changed to
be file local only and is no more customizable.
@item
@@ -693,19 +702,19 @@ the left part of the paired braces, are treated similarly
as @samp{(},
Support for dozens of @LaTeX{} packages was added.
@item
-Tabular-like environments (tabular, tabular*, tabularx, tabulary, array,
-align, ...) are indented in a nicer and more informative way when the
+Tabular-like environments (@samp{tabular}, @samp{tabular*}, @samp{tabularx},
@samp{tabulary}, @samp{array},
+@samp{align}, ...) are indented in a nicer and more informative way when the
column values of a table line are written across multiple lines in the
tex file.
@item
-The suitable number of ampersands are inserted when you insert array,
-tabular and tabular* environments with @kbd{C-c C-e}. Similar
+The suitable number of ampersands are inserted when you insert @samp{array},
+@samp{tabular} and @samp{tabular*} environments with @kbd{C-c C-e}. Similar
experience is obtained if you terminate rows in these environments with
@kbd{C-c @key{LFD}}. It supplies line break macro @samp{\\} and inserts
the suitable number of ampersands on the next line.
-Similar supports are provided for various amsmath environments.
+Similar supports are provided for various @samp{amsmath} environments.
@ifclear rawfile
@xref{Tabular-like}, for details.
@@ -727,8 +736,8 @@ Now @kbd{C-c C-e document @key{RET}}, in an empty document,
prompts for
@samp{\usepackage} macros in addition to @samp{\documentclass}.
@item
-@code{TeX-add-style-hook} has now a third argument to tell AUCTeX for
-which dialect (LaTeX, Texinfo or BibTeX) the style hook is
+@code{TeX-add-style-hook} has now a third argument to tell @AUCTeX{} for
+which dialect (@LaTeX{}, Texinfo or Bib@TeX{}) the style hook is
registers. Labelling style hook by dialect will avoid applying them not
in the right context.
@@ -741,7 +750,7 @@ There have been lots of bug fixes and feature additions.
@itemize @bullet
@item
@AUCTeX{} now supports Biber in conjunction with biblatex in addition to
-BibTeX.
+Bib@TeX{}.
@item
Each @AUCTeX{} mode now has its own abbrev table. On Emacsen which
@@ -760,7 +769,7 @@ command line, resulting in more accurate positioning of
point in Emacs
and highlighting of the target paragraph in Evince.
@item
-A problem where Ghostscript threw an /invalidfileaccess error when
+A problem where Ghostscript threw an @samp{/invalidfileaccess} error when
running @previewlatex{} was fixed.
@item
@@ -792,7 +801,7 @@ See the section on viewers in the manual for details.
Comprehensive editing support for PSTricks was added.
@item
-Support for various @LaTeX{} packages was added, e.g. @samp{tabularx},
+Support for various @LaTeX{} packages was added, e.g.@: @samp{tabularx},
@samp{CJK}, and @samp{hyperref}.
@item
@@ -843,13 +852,13 @@ Lots of minor bugs in features and documentation fixed.
@itemize @bullet
@item
-There have been problems with the @samp{-without-texmf-dir} option to
-@samp{configure} when the value of @samp{-with-kpathsea-sep} was set or
+There have been problems with the @option{-without-texmf-dir} option to
+@samp{configure} when the value of @option{-with-kpathsea-sep} was set or
determined for an installation system with a default different from that
of the runtime system. @code{with-kpathsea-sep} has been removed; the
setting is now usually determined at runtime.
-Due to this and other problems, preview-latex in the released XEmacs
+Due to this and other problems, @previewlatex{} in the released XEmacs
package failed under Windows or with anything except recent 21.5
XEmacsen.
@@ -866,10 +875,10 @@ specials.
Support for folding of comments was added.
@item
-The @code{polish} language option of the babel LaTeX package as well as
-the polski LaTeX package are now supported. Most notably this means
-that AUCTeX will help to insert quotation marks as defined by polish.sty
-(@code{"`..."'}) and polski.sty (@code{,,...''}).
+The @code{polish} language option of the babel @LaTeX{} package as well as
+the polski @LaTeX{} package are now supported. Most notably this means
+that @AUCTeX{} will help to insert quotation marks as defined by
@file{polish.sty}
+(@code{"`..."'}) and @file{polski.sty} (@code{,,...''}).
@item
The @TeX{} tool bar is now available and enabled by default in plain
@@ -933,7 +942,7 @@ incorporate the changes into your customizations if you
want to use this
feature.
@item
-@TeX{} error messages of the @code{-file-line-error} kind are now
+@TeX{} error messages of the @option{-file-line-error} kind are now
understood in @AUCTeX{} and @previewlatex{} (parsers are still
separate).
@@ -952,7 +961,7 @@ The @LaTeX{} tool bar is now enabled by default.
@itemize @bullet
@item
-Support for the MinionPro LaTeX package was added.
+Support for the MinionPro @LaTeX{} package was added.
@item
Warnings and underfull/overfull boxes are now being indicated in the
@@ -975,11 +984,11 @@ deprecated.
Some language-specific support for French was added. There now is
completion support for the commands provided by the @samp{frenchb} (and
@samp{francais}) options of the babel @LaTeX{} package and easier input
-of French quotation marks (@code{\\og ...\\fg}) which can now be
+of French quotation marks (@code{\og ...\fg}) which can now be
inserted by typing @key{"}.
@item
-Completion support for options of some LaTeX packages was added.
+Completion support for options of some @LaTeX{} packages was added.
@item
@cindex @file{auctex.el}
@@ -993,14 +1002,14 @@ means if you used only @code{(require 'tex-mik)} in
order to activate
latter statement.
@ifset rawfile
More detailed information can be found in the installation instructions
-(file INSTALL).
+(file @file{INSTALL}).
@end ifset
@ifclear rawfile
@xref{Loading the package}.
@end ifclear
@item
-Handling of verbatim constructs was consolidated across AUCTeX. This
+Handling of verbatim constructs was consolidated across @AUCTeX{}. This
resulted in the @fontlatex{}-specific variables
@code{font-latex-verb-like-commands}, @code{font-latex-verbatim-macros},
and @code{font-latex-verbatim-environments} being removed and the more
@@ -1122,7 +1131,7 @@ during filling. In particular extra spaces were added to
sentence
endings at the end of lines. You can make this whitespace visible by
setting the variable @code{show-trailing-whitespace} to @code{t}. If
you want to delete all trailing whitespace in a buffer, type @kbd{M-x
-delete-trailing-whitespace RET}.
+delete-trailing-whitespace @key{RET}}.
@item
A bug was fixed which lead to a @samp{*Compile-Log*} buffer popping up
@@ -1138,7 +1147,7 @@ upgrade or uninstall the outdated Emacspeak package.
@item
The value of @code{TeX-macro-global} is not determined during
configuration anymore but at load time of @AUCTeX{}. Consequently the
-associated configuration option @samp{--with-tex-input-dirs} was
+associated configuration option @option{--with-tex-input-dirs} was
removed.
@item
@@ -1150,7 +1159,7 @@ Support for the @LaTeX{} Japanese classes
@samp{jsarticle} and
@itemize @bullet
@item
-The parser (used e.g. for @code{TeX-auto-generate-global}) was extended
+The parser (used e.g.@: for @code{TeX-auto-generate-global}) was extended
to recognize keywords common in @LaTeX{} packages and classes, like
``\DeclareRobustCommand'' or ``\RequirePackage''. Additionally a bug
was fixed which led to duplicate entries in @AUCTeX{} style files.
@@ -1189,9 +1198,9 @@ the new chapter ``Display''.
Keywords for syntax highlighting of @LaTeX{} constructs to be typeset in
bold, italic or typewriter fonts may now be customized. Besides the
built-in classes, new keyword classes may be added by customizing the
-variable @samp{font-latex-user-keyword-classes}. The customization
+variable @code{font-latex-user-keyword-classes}. The customization
options can be found in the customization group
-@samp{font-latex-keywords}.
+@code{font-latex-keywords}.
@item
Verbatim content is now displayed with the @samp{fixed-pitch} face. (GNU
@@ -1225,7 +1234,7 @@ node names.
Setting the variable @code{LaTeX-float} to @code{nil} now means that you
will not be prompted for the float position of figures and tables. You
can get the old behaviour of @code{nil} by setting the variable to
-@code{""}, i.e. an empty string.
+@code{""}, i.e.@: an empty string.
@ifclear rawfile
See also @ref{Floats}.
@end ifclear
@@ -1255,7 +1264,7 @@ Bug fixes for XEmacs.
@c The following items weren't present at release time of 11.53:
@item
-Completion for graphic files in the TeX search path has been added.
+Completion for graphic files in the @TeX{} search path has been added.
@item
@command{start} is used for the viewer for MiK@TeX{} and fp@TeX{}.
@@ -1286,7 +1295,7 @@ Bug fixes in the build process.
@itemize @bullet
@item
-PDFTeX and Source Special support did not work with ConTeXt,
+PDF@TeX{} and Source Special support did not work with @ConTeXt{},
this has been fixed. Similar for Source Special support under Windows.
@item
@@ -1309,7 +1318,7 @@ which can be toggled via an entry in the Command menu or
the key binding
@kbd{C-c C-t C-s}. If you have customized the variable
@code{TeX-command-list}, you have to re-initialize it for this to work.
This means to open a customization buffer for the variable by typing
-@code{M-x customize-variable RET TeX-command-list RET}, selecting
+@kbd{M-x customize-variable @key{RET} TeX-command-list @key{RET}}, selecting
``Erase Customization'' and do your customization again with the new
default.
@@ -1320,7 +1329,7 @@ The content of the command menu now depends on the mode
(plain @TeX{},
and the customization will not work correctly.
@item
-Support for hiding and auto-revealing macros, e.g. footnotes or
+Support for hiding and auto-revealing macros, e.g.@: footnotes or
citations, and environments in a buffer was
@ifset rawfile
added.
@@ -1366,7 +1375,7 @@ available functionality and customization options are
explained in the
manual.
@item
-Filling and indentation in XEmacs with preview-latex and activated
+Filling and indentation in XEmacs with @previewlatex{} and activated
previews lead to the insertion of whitespace before multi-line previews.
@AUCTeX{} now contains facilities to prevent this problem.
@@ -1380,7 +1389,7 @@ _} is provided for adding the variable manually.
Sectioning commands are now shown in a larger font on display devices
which support such fontification. The variable
@code{font-latex-title-fontify} can be customized to restore the old
-appearance, i.e. the usage of a different color instead of a change in
+appearance, i.e.@: the usage of a different color instead of a change in
size.
@item
@@ -1391,7 +1400,7 @@ Credits go to the authors mentioned in the respective
@AUCTeX{} style
files.
@item
-Inserting graphics with @kbd{C-c RET \includegraphics RET} was improved.
+Inserting graphics with @kbd{C-c @key{RET} includegraphics @key{RET}} was
improved.
See the variable @code{LaTeX-includegraphics-options-alist}.
@c FIXME: Document this in the main part of the manual
@@ -1406,8 +1415,8 @@ environments, see @ref{Tabular-like}.
@end ifclear
@item
-Completion for available packages when using @kbd{C-c RET \usepackage
-RET} was improved on systems using the kpathsea library.
+Completion for available packages when using @kbd{C-c @key{RET} usepackage
+@key{RET}} was improved on systems using the kpathsea library.
@item
The commenting functionality was fixed. The separate functions for
@@ -1445,7 +1454,7 @@ behavior can be adapted or extended respectively by
customizing the
variable @code{TeX-output-view-style}.
@item
-You can control whether @code{TeX-insert-macro} (@kbd{C-c RET}) ask for
+You can control whether @code{TeX-insert-macro} (@kbd{C-c @key{RET}}) ask for
all optional arguments by customizing the variable
@ifset rawfile
@code{TeX-insert-macro-default-style}.
@@ -1460,7 +1469,7 @@ it started.
@item
The build process was enhanced and is now based on @code{autoconf}
-making installing AUC@TeX{} a mostly automatic process. See
+making installing @AUCTeX{} a mostly automatic process. See
@ifset rawfile
the files @file{INSTALL} and @file{INSTALL.windows}
@end ifset
@@ -1474,8 +1483,8 @@ for details.
@itemize @bullet
@item
-Many more LaTeX and LaTeX2e commands are supported.
-Done by Masayuki Ataka <ataka@@milk.freemail.ne.jp>
+Many more @LaTeX{} and @LaTeX{}2e commands are supported.
+Done by Masayuki Ataka @email{ataka@@milk.freemail.ne.jp}
@end itemize
@heading News in 11.12
@@ -1483,7 +1492,7 @@ Done by Masayuki Ataka <ataka@@milk.freemail.ne.jp>
@itemize @bullet
@item
Support for the KOMA-Script classes.
-Contributed by Mark Trettin <Mark.Trettin@@gmx.de>.
+Contributed by Mark Trettin @email{Mark.Trettin@@gmx.de}.
@end itemize
@heading News in 11.11
@@ -1491,7 +1500,7 @@ Contributed by Mark Trettin <Mark.Trettin@@gmx.de>.
@itemize @bullet
@item
Support for @file{prosper.sty}, see @url{http://prosper.sourceforge.net/}.
-Contributed by Phillip Lord <p.lord@@russet.org.uk>.
+Contributed by Phillip Lord @email{p.lord@@russet.org.uk}.
@end itemize
@heading News in 11.10
@@ -1499,7 +1508,7 @@ Contributed by Phillip Lord <p.lord@@russet.org.uk>.
@itemize @bullet
@item
@code{comment-region} now inserts @t{%%} by default.
-Suggested by "Davide G. M. Salvetti" <salve@@debian.org>.
+Suggested by "Davide G. M. Salvetti" @email{salve@@debian.org>}.
@end itemize
@heading News in 11.06
@@ -1516,15 +1525,15 @@ locking. Customize @code{TeX-install-font-lock} for
this.
@itemize @bullet
@item
Now use @t{-t landscape} by default when landscape option appears.
-Suggested by Erik Frisk <frisk@@isy.liu.se>.
+Suggested by Erik Frisk @email{frisk@@isy.liu.se}.
@end itemize
@heading News in 11.03
@itemize @bullet
@item
-Use @file{tex-fptex.el} for fpTeX support.
-Contributed by Fabrice Popineau <Fabrice.Popineau@@supelec.fr>.
+Use @file{tex-fptex.el} for fp@TeX{} support.
+Contributed by Fabrice Popineau @email{Fabrice.Popineau@@supelec.fr}.
@end itemize
@heading News in 11.02
@@ -1533,23 +1542,23 @@ Contributed by Fabrice Popineau
<Fabrice.Popineau@@supelec.fr>.
@item
New user option @code{LaTeX-top-caption-list} specifies environments
where the caption should go at top.
-Contributed by ataka@@milk.freemail.ne.jp (Masayuki Ataka).
+Contributed by @email{ataka@@milk.freemail.ne.jp} (Masayuki Ataka).
@item
Allow explicit dimensions in @file{graphicx.sty}.
-Contributed by ataka@@milk.freemail.ne.jp (Masayuki Ataka).
+Contributed by @email{ataka@@milk.freemail.ne.jp} (Masayuki Ataka).
@item
Limited support for @file{verbatim.sty}.
-Contributed by ataka@@milk.freemail.ne.jp (Masayuki Ataka).
+Contributed by @email{ataka@@milk.freemail.ne.jp} (Masayuki Ataka).
@item
-Better support for asmmath items.
-Patch by ataka@@milk.freemail.ne.jp (Masayuki Ataka).
+Better support for amsmath items.
+Patch by @email{ataka@@milk.freemail.ne.jp} (Masayuki Ataka).
@item
More accurate error parsing.
-Added by David Kastrup <David.Kastrup@@t-online.de>.
+Added by David Kastrup @email{David.Kastrup@@t-online.de}.
@end itemize
@heading News in 11.01
diff --git a/doc/faq.texi b/doc/faq.texi
index aa447b4..9afa4ba 100644
--- a/doc/faq.texi
+++ b/doc/faq.texi
@@ -1,5 +1,5 @@
@c This is part of the AUCTeX Manual.
-@c Copyright (C) 2004-2014 Free Software Foundation, Inc.
+@c Copyright (C) 2004-2014, 2021 Free Software Foundation, Inc.
@c See the file auctex.texi for copying conditions.
@ifset rawfile
@include macros.texi
@@ -23,7 +23,7 @@ encountered a bug or the relevant sections in the manual for
other
related problems.
If this did not help, you can send a bug report to the @AUCTeX{} bug
-reporting list by using the command @kbd{M-x TeX-submit-bug-report RET}.
+reporting list by using the command @kbd{M-x TeX-submit-bug-report @key{RET}}.
But before you do this, you can try to get more information about the
problem at hand which might also help you locate the cause of the error
yourself.
@@ -44,8 +44,8 @@ in the bug report.
Second, you can try to figure out if something in your personal or site
configuration triggers the error by starting Emacs without such
customizations. You can do this by invoking Emacs with the command line
-@samp{emacs -q -no-site-file -l auctex}. The @samp{-l} option
-@samp{auctex.el} which you normally do in your init file. After you
+@samp{emacs -q -no-site-file -l auctex}. The @option{-l} option
+loads @file{auctex.el} which you normally do in your init file. After you
have started Emacs like this, you can load the file triggering the
error. If everything is working now, you know that you have to search
either in the site configuration file or your personal init file for
@@ -58,7 +58,7 @@ What versions of Emacs are supported?
are unsupported.
@item
-What should I do when @code{./configure} does not find programs like latex?
+What should I do when @command{./configure} does not find programs like
@command{latex}?
This is problem often encountered on Windows. Make sure that the
@env{PATH} environment variable includes the directories containing the
@@ -83,11 +83,14 @@ It must be enabled first, insert this in your init file:
Read also the chapters about parsing and multifile documents in the
manual.
+@ifclear rawfile
+@xref{Parsing Files} and @ref{Multifile}.
+@end ifclear
@item
Why doesn't @code{TeX-save-document} work?
-@code{TeX-check-path} has to contain "./" somewhere.
+@code{TeX-check-path} has to contain "@file{./}" somewhere.
@item
Why is the information in @file{foo.tex} forgotten when I save
@@ -95,7 +98,7 @@ Why is the information in @file{foo.tex} forgotten when I save
For various reasons, @AUCTeX{} ignores the extension when it stores
information about a file, so you should use unique base names for your
-files. E.g. rename @file{foo.bib} to @file{foob.bib}.
+files. E.g.@: rename @file{foo.bib} to @file{foob.bib}.
@item
Why doesn't @AUCTeX{} signal when processing a document is done?
@@ -121,7 +124,7 @@ determines the file where the error happened by parsing the
log file and
counting the parentheses. This can fail when there are other,
unbalanced parentheses present.
-Activating so-called file:line:error messages for the log file usually
+Activating so-called @samp{file:line:error} messages for the log file usually
solves this issue, as these kind of messages are are easier to parse;
however, they may lack some details. Activation can be done either in
the configuration of your @TeX{} system (consult its manual to see where
diff --git a/doc/install.texi b/doc/install.texi
index 1238a26..f7af60f 100644
--- a/doc/install.texi
+++ b/doc/install.texi
@@ -1,6 +1,6 @@
@c This is part of the AUCTeX Manual.
@c Copyright (C) 1994, 1996, 2003-2007, 2012-2013,
-@c 2015, 2017, 2018 Free Software Foundation, Inc.
+@c 2015, 2017, 2018, 2020, 2021 Free Software Foundation, Inc.
@c See the file auctex.texi for copying conditions.
@ifset rawfile
@include macros.texi
@@ -15,7 +15,7 @@
The modern and strongly recommended way of installing @AUCTeX{} is by
using the Emacs package manager integrated in Emacs 24 and greater
-(@acronym{ELPA}). Simply do @kbd{M-x list-packages RET}, mark the
+(@acronym{ELPA}). Simply do @kbd{M-x list-packages @key{RET}}, mark the
auctex package for installation with @kbd{i}, and hit @kbd{x} to execute
the installation procedure. That's all.
@@ -23,10 +23,10 @@ the installation procedure. That's all.
@code{user-init-file} which essentially does the same as the manual
installation explained above.
-@example
+@lisp
(use-package tex
:ensure auctex)
-@end example
+@end lisp
Using the @acronym{ELPA} version has several advantages. Besides being
platform and @acronym{OS} independent, you will receive intermediate
@@ -122,15 +122,14 @@ Instructions for checking out the source code can be
found at
Well, @AUCTeX{} would be pointless without that. Processing
documentation requires @TeX{}, @LaTeX{} and Texinfo during installation.
-@previewlatex{} requires Dvips for its operation in @acronym{DVI} mode.
-The default configuration of @AUCTeX{} is tailored for te@TeX{} or
-@TeX{}live-based distributions, but can be adapted easily.
+@previewlatex{} requires Dvips or @command{dvipng} for its operation in
@acronym{DVI} mode.
+The default configuration of @AUCTeX{} is tailored for @w{@TeX{} Live}-based
+distributions, but can be adapted easily.
@item A recent Ghostscript
This is needed for operation of @previewlatex{} in both @acronym{DVI}
-and @acronym{PDF} mode. Most versions of Ghostscript nowadays in use
-should work fine (version 7.0 and newer).
+and @acronym{PDF} mode. Ghostscript version 7.07 or newer is required.
@item GNU make
@@ -140,7 +139,7 @@ you have to obtain it in order to build @AUCTeX{} by
yourself. GNU make
is sometimes provided under the name @command{gmake} in your
@acronym{OS}'s binary package system.
-@item The @code{texinfo} package
+@item The Texinfo package
Strictly speaking, you can get away without it if you are building
from the distribution tarball, have not modified any files and don't
@@ -151,7 +150,7 @@ included in the tarball. At least @w{version 4.0} is
required.
For some known issues with various software, see
@ifset rawfile
-the @file{PROBLEMS} file.
+the @file{PROBLEMS.preview} file.
@end ifset
@ifclear rawfile
@ref{Known problems,,,preview-latex,the @previewlatex{} manual}.
@@ -167,7 +166,7 @@ various files will be. To do so, run
./configure @var{options}
@end example
-(Note: if you have fetched @AUCTeX{} from @acronym{Git} rather than
+(Note: if you have fetched @AUCTeX{} from Git rather than
a regular release, you will have to first follow the instructions in
@file{README.GIT}).
@@ -176,7 +175,7 @@ On many machines, you will not need to specify any options,
but if
help it out with one of these options:
@table @code
-@item --prefix=@file{/usr/local}
+@item --prefix=@var{prefix}
All automatic placements for package components will be chosen from
sensible existing hierarchies below this: directories like @file{man},
@file{share} and @file{bin} are supposed to be directly below
@@ -197,16 +196,16 @@ user, you will typically set @var{prefix} to your home
directory.
Consult @ref{Advice for non-privileged users} for addtional
instructions.
-@item --with-emacs[=@var{/path/to/emacs}]
-If you are using a pretest which isn't in your @code{$PATH}, or
+@item --with-emacs=@var{/path/to/emacs}
+If you are using a pretest which isn't in your @env{PATH}, or
@command{configure} is not finding the right Emacs executable, you can
specify it with this option.
-@item --with-lispdir=@var{/dir}
+@item --with-lispdir=@var{lispdir}
This option specifies the location of the @file{site-lisp}
-directory within @samp{load-path} under which the files will get
+directory within @code{load-path} under which the files will get
installed (the bulk will get installed in a subdirectory).
-@file{./configure} should figure this out by itself.
+@command{./configure} should figure this out by itself.
@item --with-auctexstartfile=@file{auctex.el}
@itemx --with-previewstartfile=@file{preview-latex.el}
@@ -219,11 +218,11 @@ start files after installation since other files are found
@item --with-packagelispdir=@file{auctex}
This is the directory where the bulk of the package gets located. The
-startfile adds this into @var{load-path}.
+startfile adds this into @code{load-path}.
@item --with-auto-dir=@var{/dir}
You can use this option to specify the directory containing
-automatically generated information. It is not necessary for most
+automatically generated information by @kbd{M-x TeX-auto-generate-global
@key{RET}}. It is not necessary for most
@TeX{} installs, but may be used if you don't like the directory that
configure is suggesting.
@@ -231,8 +230,11 @@ configure is suggesting.
This is not an option specific to @AUCTeX{}. A number of standard
options to @command{configure} exist, and we do not have the room to
describe them here; a short description of each is available, using
-@code{--help}. If you use @samp{--help=recursive}, then also
-@previewlatex{}-specific options will get listed.
+@option{--help}.
+
+@c FIXME: It seems this no longer holds.
+@c If you use @samp{--help=recursive}, then also @previewlatex{}-specific
+@c options will get listed.
@item --disable-preview
This disables configuration and installation of @previewlatex{}. This
@@ -242,7 +244,8 @@ should, if possible, refrain from distributing @AUCTeX{} and
@previewlatex{} separately in order to avoid confusion and upgrade
hassles if users install partial packages on their own.
-@item --with-texmf-dir=@var{/dir}@*--without-texmf-dir
+@item --with-texmf-dir=@var{/dir}
+@itemx --without-texmf-dir
@cindex preview-install-styles
This option is used for specifying a @acronym{TDS}-compliant directory
hierarchy. Using @code{--with-texmf-dir=@var{/dir}} you can specify
@@ -250,11 +253,11 @@ where the @TeX{} @acronym{TDS} directory hierarchy
resides, and the
@TeX{} files will get installed in
@file{@var{/dir}/tex/latex/preview/}.
-If you use the @code{--without-texmf-dir} option, the @TeX{}-related
+If you use the @option{--without-texmf-dir} option, the @TeX{}-related
files will be kept in the Emacs Lisp tree, and at runtime the
@env{TEXINPUTS} environment variable will be made to point there. You
can install those files into your own @TeX{} tree at some later time
-with @kbd{M-x preview-install-styles RET}.
+with @kbd{M-x preview-install-styles @key{RET}}.
@item --with-tex-dir=@var{/dir}
If you want to specify an exact directory for the preview @TeX{} files,
@@ -306,6 +309,7 @@ into system directories.
@node Loading the package
@section Loading the package
+@cindex @file{init.el}
@cindex @file{.emacs}
You can detect the successful activation of @AUCTeX{} and
@@ -323,21 +327,21 @@ automatically loaded on startup and nothing else needs to
be done. If
not, they should at least have been placed somewhere in your
@code{load-path}. You can then load them by placing the lines
-@example
+@lisp
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
-@end example
-
-into your init file.
+@end lisp
+@noindent
+into your init file such as @file{init.el} or @file{.emacs}.
If you explicitly used @code{--with-lispdir}, you may need to add the
specified directory into Emacs' @code{load-path} variable by adding
something like
-@example
+@lisp
(add-to-list 'load-path "~/elisp")
-@end example
-
+@end lisp
+@noindent
before the above lines into your Emacs startup file.
For site-wide activation in GNU Emacs, see
@@ -352,14 +356,15 @@ Once activated, the modes provided by @AUCTeX{} are used
per default for
all supported file types. If you want to change the modes for which it
is operative instead of the default, use
@example
-@kbd{M-x customize-variable @key{RET} TeX-modes @key{RET}}
+@kbd{M-x customize-option @key{RET} TeX-modes @key{RET}}
@end example
If you want to remove a preinstalled @AUCTeX{} completely before any of
its modes have been used,
-@example
+@lisp
(unload-feature 'tex-site)
-@end example
+@end lisp
+@noindent
should accomplish that.
@node Advice for package providers
@@ -389,14 +394,14 @@ If the installation procedure did not achieve this
already by placing
@file{auctex.el} and @file{preview-latex.el} into a possibly existing
@file{site-start.d} directory, you can do this by placing
-@example
+@lisp
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
-@end example
+@end lisp
@noindent in the system-wide @file{site-start.el}.
-The @code{--without-texmf-dir} option can be convenient for systems that
+The @option{--without-texmf-dir} option can be convenient for systems that
are intended to support more than a single TeX distribution. Since more
often than not @TeX{} packages for operating system distributions are
either much more outdated or much less complete than separately provided
@@ -406,6 +411,7 @@ when providing packages.
The following package structure would be adequate for a typical fully
supported Unix-like installation:
+@c FIXME: teTeX is much outdated now.
@table @samp
@item preview-tetex
Style files and documentation for @file{preview.sty}, placed into a
@@ -415,7 +421,7 @@ packages, it might be appropriate to provide separate
packages for
those.
@item auctex-emacs-tetex
This package will require the installation of @samp{preview-tetex} and
-will record in @samp{TeX-macro-global} where to find the @TeX{} tree.
+will record in @code{TeX-macro-global} where to find the @TeX{} tree.
It is also a good idea to run
@example
emacs -batch -f TeX-auto-generate-global
@@ -424,11 +430,11 @@ when either @AUCTeX{} or te@TeX{} get installed or
upgraded. If your
users might want to work with a different @TeX{} distribution (nowadays
pretty common), instead consider the following:
@item auctex-emacs
-This package will be compiled with @samp{--without-texmf-dir} and will
+This package will be compiled with @option{--without-texmf-dir} and will
consequently contain the @samp{preview} style files in its private
directory. It will probably not be possible to initialize
-@samp{TeX-macro-global} to a sensible value, so running
-@samp{TeX-auto-generate-global} does not appear useful. This package
+@code{TeX-macro-global} to a sensible value, so running
+@code{TeX-auto-generate-global} does not appear useful. This package
would neither conflict with nor provide @samp{preview-tetex}.
@end table
@@ -440,37 +446,37 @@ software for their private use. In that case you need to
pass more
options to the @command{configure} script.
The main expedient is using the @option{--prefix} option to the
-@file{configure} script, and let it point to the personal home
+@command{configure} script, and let it point to the personal home
directory. In that way, resulting binaries will be installed under the
@file{bin} subdirectory of your home directory, manual pages under
@file{man} and so on. It is reasonably easy to maintain a bunch of
personal software, since the prefix argument is supported by most
-@file{configure} scripts.
+@command{configure} scripts.
You often need to specify @option{--with-lispdir} option as well.
If you haven't installed Emacs under your home directory and use Emacs
-installed in system directories, the @file{configure} script might not
+installed in system directories, the @command{configure} script might not
be able to figure out suitable place to install lisp files under your
-home directory. In that case, the @file{configure} script would
+home directory. In that case, the @command{configure} script would
silently choose, by default, the @file{site-lisp} directory within
-@samp{load-path} for the place, where administration privileges are
+@code{load-path} for the place, where administration privileges are
usually required to put relevant files. Thus you will have to tell
-the @file{configure} script explicitly where to put those files by,
-e.g., @option{--with-lispdir=@file{/home/myself/share/emacs/site-lisp}}.
+the @command{configure} script explicitly where to put those files by,
+e.g., @code{--with-lispdir=@samp{/home/myself/share/emacs/site-lisp}}.
You'll have to add something like
-@file{/home/myself/share/emacs/site-lisp} to your @code{load-path}
+@samp{/home/myself/share/emacs/site-lisp} to your @code{load-path}
variable, if it isn't there already.
-In addition, you will have to tell @file{configure} script where to
+In addition, you will have to tell @command{configure} script where to
install @TeX{}-related files such as @file{preview.sty} if
@previewlatex{} isn't disabled. It is enough to specify
@option{--with-texmf-dir=@file{$HOME/texmf}} for most typical cases, but
you have to create the direcotry @file{$HOME/texmf} in advance if it
doesn't exist. If this prescription doesn't work, consider using one or
-more of the options @option{--with-texmf-dir=@var{/dir}},
-@option{--without-texmf-dir}, @option{--with-tex-dir=@var{/dir}} and
-@option{--with-doc-dir=@var{/dir}}. See @ref{Configure} for detail of
+more of the options @code{--with-texmf-dir=@var{/dir}},
+@code{--without-texmf-dir}, @code{--with-tex-dir=@var{/dir}} and
+@code{--with-doc-dir=@var{/dir}}. See @ref{Configure} for detail of
these options.
Now here is another thing to ponder: perhaps you want to make it easy
@@ -499,7 +505,7 @@ In GNU Emacs, it should be sufficient if people just do
(load "~myself/share/emacs/site-lisp/auctex.el" nil t t)
(load "~myself/share/emacs/site-lisp/preview-latex.el" nil t t)
@end lisp
-
+@noindent
where the path points to your personal installation. The rest of the
package should be found relative from there without further ado.
@@ -517,7 +523,7 @@ startup files:
@subheading Making the @LaTeX{} style available
If you want others to be able to share your installation, you should
-configure it using @samp{--without-texmf-dir}, in which case things
+configure it using @option{--without-texmf-dir}, in which case things
should work as well for them as for you.
@subsection Using @AUCTeX{} from local Git repo
@@ -590,15 +596,15 @@ of this directory:
Most of the site-specific customization should already have happened
during configuration of @AUCTeX{}. Any further customization can be
done with customization buffers directly in Emacs. Just type @kbd{M-x
-customize-group RET AUCTeX RET} to open the customization group for
+customize-group @key{RET} AUCTeX @key{RET}} to open the customization group for
@AUCTeX{} or use the menu entries provided in the mode menus. Editing
the file @file{tex-site.el} as suggested in former versions of @AUCTeX{}
should not be done anymore because the installation routine will
overwrite those changes.
-You might check some variables with a special significance. They are
-accessible directly by typing @kbd{M-x customize-variable RET <variable>
-RET}.
+You might check some options with a special significance. They are
+accessible directly by typing @kbd{M-x customize-option @key{RET} <option>
+@key{RET}}.
@defopt TeX-macro-global
Directories containing the site's @TeX{} style files.
@@ -613,7 +619,7 @@ used by your document. To do this, you must set this
variable to a list
of directories where the standard style files are located. The
directories will be searched recursively, so there is no reason to list
subdirectories explicitly. Automatic configuration will already have
-set the variable for you if it could use the program @samp{kpsewhich}.
+set the variable for you if it could use the program @command{kpsewhich}.
In this case you normally don't have to alter anything.
@c Local Variables:
diff --git a/doc/preview-faq.texi b/doc/preview-faq.texi
index feb1979..569ef00 100644
--- a/doc/preview-faq.texi
+++ b/doc/preview-faq.texi
@@ -1,6 +1,6 @@
@c This is part of the preview-latex manual.
-@c Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2017 Free Software
-@c Foundation, Inc.
+@c Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009
+@c 2017, 2021 Free Software Foundation, Inc.
@c See file preview-latex.texi for copying conditions.
@ifset rawfile
@include macros.texi
@@ -63,7 +63,7 @@ got it from.
@subsection I have trouble with the display format...
We recommend keeping the variable @code{preview-image-type} set to
@code{dvipng} (if you have it installed) or @code{png}. This is the
-default and can be set via the Preview/Customize menu.
+default and can be set via the @samp{Preview/Customize} menu.
All other formats are known to have inconveniences, either in file size
or quality. There are some Emacs versions around not supporting
@@ -121,7 +121,7 @@ generate any errors, but they will not produce any
previews, either.
@item An outdated @file{preview} installation
The @file{preview.sty} package is useful for more than just
-@previewlatex{}. For example, it is part of @TeX{}live. So you have
+@previewlatex{}. For example, it is part of @w{@TeX{} Live}. So you have
to make sure that @previewlatex{} does not get to work with outdated
style and configuration files: some newer features will not work with
older @TeX{} style files, and really old files will make
@@ -145,7 +145,7 @@ You can include them however manually by adding the lines:
\usepackage[displaymath,textmath,sections,graphics,floats]@{preview@}
\PreviewEnvironment@{enumerate@}
@end example
-
+@noindent
in your document header, that is before
@example
@@ -160,14 +160,14 @@ Be aware that
@example
\PreviewEnvironment@{...@}
@end example
-
+@noindent
does not accept a comma separated
list! Also note that by putting more and more
@example
\PreviewEnvironment@{...@}
@end example
-
+@noindent
in your document, it will look more and more like a @acronym{DVI} file
preview when running @previewlatex{}. Since each preview is treated as
one large monolithic block by Emacs, one should really restrict
@@ -185,7 +185,7 @@ us assume you use the latter. In that case you should
write something like
\InputIfFileExists@{preview/prauctex.cfg@}@{@}@{@}
\PreviewEnvironment@{enumerate@}
@end example
-
+@noindent
in it. The first line inputs the system-wide default configuration
(the file name should match that, but not your own
@file{prauctex.cfg}), then you add your own stuff.
@@ -230,7 +230,7 @@ l.52 \item Sie lassen sich als Funktion $
l.52 \item Sie lassen sich als Funktion $y = f(x)$
darstellen.
@end example
-
+@noindent
appear (previous versions generated messages looking even more like
errors). Those are not real errors (as will be noted in the log
file). Or rather, while they @strong{are} really @TeX{} error
@@ -241,6 +241,7 @@ Since they are actual errors, you will also get @AUCTeX{}
to state
@example
Preview-LaTeX exited as expected with code 1 at Wed Sep 4 17:03:30
@end example
+@noindent
after the @LaTeX{} run in the run buffer. This merely indicates that
errors were present, and errors will always be present when
@previewlatex{} is operating. There might be also real errors, so in
@@ -261,9 +262,9 @@ As mentioned in the previews @acronym{FAQ} entry,
@previewlatex{} might
use the file name of the original output file for the creation of
preview images. If the original output file is being displayed with a
viewer when this happens, you might see strange effects depending on the
-viewer, e.g. a message about the file being corrupted or the display of
+viewer, e.g.@: a message about the file being corrupted or the display of
all the preview images instead of your typeset document. (Also
-@xref{Customization}.)
+@pxref{Customization}.)
@node Other formats, , Troubleshooting, Frequently Asked Questions
@@ -286,7 +287,7 @@ In short, no. The @samp{preview} package is
@LaTeX{}-dependent. Adding support for other formats requires
volunteers.
-@subsection Does @previewlatex{} work with plain TeX?
+@subsection Does @previewlatex{} work with plain @TeX{}?
Again, no. Restructuring the @samp{preview} package for @samp{plain}
operation would be required. Volunteers welcome.
diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi
index b398ee1..25577e5 100644
--- a/doc/preview-latex.texi
+++ b/doc/preview-latex.texi
@@ -71,8 +71,6 @@ This manual may be copied under the conditions spelled out in
@insertcopying
@end ifhtml
-@contents
-
@iftex
@unnumbered @previewlatex{}
@end iftex
@@ -115,7 +113,7 @@ sans-serif font to visually offset it.
@cindex Warranty
For the conditions for copying parts of @previewlatex{}, see the General
-Public Licenses referres to in the copyright notices of the files, the
+Public Licenses referred to in the copyright notices of the files, the
General Public Licenses accompanying them and the explanatory section in
@ref{Copying,,,auctex,the @AUCTeX{} manual}.
@@ -149,8 +147,8 @@ strings with @kbd{C-h f} if you need the Lisp information.
@itemx @code{preview-at-point}
@itemx Preview/Generate previews (or toggle) at point
If the cursor is positioned on or inside of a preview area, this
-toggles its visibility, regenerating the preview if necessary. If not,
-it will run the surroundings through preview. The surroundings include
+toggles its visibility, regenerating the preview if necessary. If not,
+it will run the surroundings through preview. The surroundings include
all areas up to the next valid preview, unless invalid previews occur
before, in which case the area will include the last such preview in
either direction. And overriding any other
@@ -159,7 +157,7 @@ through @code{preview-region}.
@kindex @kbd{C-c C-p C-p}
@findex preview-at-point
-@item @kbd{<mouse-2>}
+@item @kbd{@key{mouse-2}}
The middle mouse button has a similar action bound to it as
@code{preview-at-point}, only that it knows which preview to apply it to
according to the position of the click. You can click either anywhere
@@ -168,7 +166,7 @@ source text, you can click on the icon preceding the source
text. In
other areas, the usual mouse key action (typically: paste) is not
affected.
-@item @kbd{<mouse-3>}
+@item @kbd{@key{mouse-3}}
The right mouse key pops up a context menu with several options:
toggling the preview, regenerating it, removing it (leaving the
unpreviewed text), copying the text inside of the preview, and copying
@@ -268,7 +266,7 @@ Clear out all previews in the current region.
@itemx Preview/Remove previews from buffer
@kindex @kbd{C-c C-p C-c C-b}
@findex preview-clearout-buffer
-Clear out all previews in current buffer. This makes the current buffer
+Clear out all previews in current buffer. This makes the current buffer
lose all previews.
@item @kbd{C-c C-p C-c C-d}
@@ -296,7 +294,7 @@ effectively changes because some included file or style
file is
tampered with.
Note that support for preamble cache is limited for @LaTeX{} variants.
-c.f. @url{https://github.com/davidcarlisle/dpctex/issues/15}
+c.f.@: @url{https://github.com/davidcarlisle/dpctex/issues/15}
@itemize @bullet
@item
Xe@LaTeX{} cannot use preamble cache at all. The reason is intrinsic in
@@ -313,7 +311,7 @@ codes in preamble.
@kindex @kbd{C-u C-c C-p C-f}
@findex preview-cache-preamble-off
Clear the pregenerated format file and stop using preambles for the
-current document. If the caching gives you problems, use this.
+current document. If the caching gives you problems, use this.
@item @kbd{C-c C-p C-i}
@itemx @code{preview-goto-info-page}
@@ -338,15 +336,15 @@ info manual.
This is the preferred way of reporting bugs as it will fill in what
version of @previewlatex{} you are using as well as versions of
relevant other software, and also some of the more important
-settings. Please use this method of reporting, if at all possible and
+settings. Please use this method of reporting, if at all possible and
before reporting a bug, have a look at @ref{Known problems}.
@item @kbd{C-c C-k}
@itemx LaTeX/TeX Output/Kill Job
@kindex @kbd{C-c C-k}
@cindex Kill preview-generating process
-Kills the preview-generating process. This is really an @AUCTeX{}
-keybinding, but it is included here as a hint. If you are generating
+Kills the preview-generating process. This is really an @AUCTeX{}
+keybinding, but it is included here as a hint. If you are generating
a preview and then make a change to the buffer, @previewlatex{} may be
confused and place the previews wrong.
@end table
@@ -355,8 +353,8 @@ confused and place the previews wrong.
@chapter Simple customization
Customization options can be found by typing @kbd{M-x customize-group
-@key{RET} preview @key{RET}}. Remember to set the option when you have
-changed it. The list of suggestions can be made very long (and is
+@key{RET} preview @key{RET}}. Remember to set the option when you have
+changed it. The list of suggestions can be made very long (and is
covered in detail in @ref{For advanced users}), but some are:
@itemize @bullet
@@ -364,7 +362,7 @@ covered in detail in @ref{For advanced users}), but some
are:
If you use a non-white background in Emacs, you might have color
artifacts at the edges of your previews. Playing around with the option
-@code{preview-transparent-color} in the @code{Preview Appearance} group
+@code{preview-transparent-color} in the @samp{Preview Appearance} group
might improve things. With some settings, the cursor may cover the
whole background of a preview, however.
@@ -380,7 +378,8 @@ by using the @LaTeX{} package @code{showkeys} alternatively
the region @previewlatex{} considers as the preview image. To enable a
similar mechanism internal to @previewlatex{}, enable the
@code{showlabels} option in the variable
-@code{preview-default-option-list} in the @code{Preview Latex} group.
+@code{preview-default-option-list} in the @samp{Preview Latex} group.
+@vindex preview-default-option-list
It must be noted, however, that a much better idea may be to use the
Ref@TeX{} package for managing references. @xref{RefTeX in a
@@ -428,12 +427,14 @@ less correct.
@item Preview your favourite @LaTeX{} constructs
+@vindex preview-default-option-list
+@vindex preview-default-preamble
If you have a certain macro or environment that you want to preview,
first check if it can be chosen by cutomizing
-@code{preview-default-option-list} in the @code{Preview Latex} group.
+@code{preview-default-option-list} in the @samp{Preview Latex} group.
If it is not available there, you can add it to
-@code{preview-default-preamble} also in the @code{Preview Latex} group,
+@code{preview-default-preamble} also in the @samp{Preview Latex} group,
by adding a @code{\PreviewMacro} or @code{\PreviewEnvironment} entry
(@pxref{Provided commands}) @emph{after} the @code{\RequirePackage}
line. For example, if you want to preview the @code{center}
@@ -470,11 +471,12 @@ subdirectory @file{preview}, the default behavior).
@item Don't preview inline math
@cindex Inline math
+@vindex preview-default-option-list
If you have performance problems because your document is full of inline
math (@code{$@dots{}$}), or if your usage of @code{$} conflicts with
-@previewlatex{}'s, you can turn off inline math previews. In the
-@code{Preview Latex} group, remove @code{textmath} from
+@previewlatex{}'s, you can turn off inline math previews. In the
+@samp{Preview Latex} group, remove @code{textmath} from
@code{preview-default-option-list} by customizing this variable.
@end itemize
@@ -500,7 +502,7 @@ an Emacs-lisp part integrating the thing into Emacs (aided
by
@node The LaTeX style file, The Emacs interface, For advanced users, For
advanced users
@section The @LaTeX{} style file
-@c Autogenerated from ../preview.dtx
+@c Autogenerated from ../latex/preview.dtx
@include preview-dtxdoc.texi
@node The Emacs interface, The preview images, The LaTeX style file, For
advanced users
@@ -523,17 +525,17 @@ only do after the @LaTeX{} run completes. This run
produces a host of
pseudo-error messages that get parsed by @previewlatex{} at the end of
the @LaTeX{} run and give it the necessary information about where in
the source file the @LaTeX{} code for the various previews is located
-exactly. The parsing takes a moment and will render Emacs busy.
+exactly. The parsing takes a moment and will render Emacs busy.
@item preview-LaTeX-command-replacements
This variable specifies transformations to be used before calling the
configured command. One possibility is to have @samp{\pdfoutput=0 }
appended to every command starting with @samp{pdf}. This particular
setting is available as the shortcut
-@samp{preview-LaTeX-disable-pdfoutput}. Since @previewlatex{} can work
+@code{preview-LaTeX-disable-pdfoutput}. Since @previewlatex{} can work
with @acronym{PDF} files by now, there is little incentive for using
this option, anymore (for projects not requiring @acronym{PDF} output,
-the added speed of @samp{dvipng} might make this somewhat attractive).
+the added speed of @command{dvipng} might make this somewhat attractive).
@item preview-required-option-list
@code{preview-LaTeX-command} uses @code{preview-required-option-list} in
@@ -616,7 +618,7 @@ changes after that, it will not get reported. If you have
an outdated
version of @file{preview.sty} in your path, the size might not be
reported at all. If in this case @AUCTeX{} is unable to find a size
specification, and if you are using a document class with a different
-default value (like KomaScript), the default fallback assumption will
+default value (like @samp{KomaScript}), the default fallback assumption will
probably be wrong and @previewlatex{} will scale up things too large.
So better specify those size options even when you know that @LaTeX{}
does not need them: @previewlatex{} might benefit from them. Another
@@ -633,9 +635,9 @@ PostScript file is @code{preview-fast-dvips-command}, while
@code{preview-dvips-command} is used for cranking out a @acronym{DVI}
file where every preview is in a separate @acronym{EPS} file. Which of
the two commands gets used depends on the setting of
-@code{preview-fast-conversion}. The printer specified here by default
+@code{preview-fast-conversion}. The printer specified here
is @option{-Pwww} by default, which will usually get you scalable fonts
-where available. If you are experiencing problems, you might want to try
+where available. If you are experiencing problems, you might want to try
playing around with Dvips options (@inforef{Command-line options,,dvips}).
The conversion of the previews into PostScript or @acronym{EPS} files
@@ -660,7 +662,7 @@ normal open preview in text representation.
@item preview-inner-environments
This is a list of environments that are regarded as inner levels of an
-outer environment when doing @code{preview-environment}. One example
+outer environment when doing @code{preview-environment}. One example
when this is needed is in
@code{\begin@{equation@}\begin@{split@}@dots{}\end@{split@}\end@{equation@}},
and
accordingly @code{split} is one entry in
@@ -697,12 +699,12 @@ which can be displayed much faster by Emacs. Actually,
not in sequence
but backwards since you are most likely editing at the end of the
document. And as an added convenience, any preview that happens to be
on-screen is given higher priority so that @previewlatex{} will first
-cater for the images that are displayed. There are various options
+cater for the images that are displayed. There are various options
customizable concerning aspects of that operation, see the customization
-group @code{Preview Gs} for this.
+group @samp{Preview Gs} for this.
Another noteworthy setting of @code{preview-image-type} is
-@samp{dvipng}: in this case, the @samp{dvipng}
+@samp{dvipng}: in this case, the @command{dvipng}
@pindex dvipng
program will get run on @acronym{DVI} output (see below for @acronym{PDF}).
This is in general much faster than Dvips and Ghostscript. In that
@@ -722,7 +724,7 @@ if the @acronym{DVI} file contains PostScript specials in
which case the
affected images will get run through Dvips and Ghostscript once
@samp{dvipng} finishes.
-Note for p@LaTeX{} and up@LaTeX{} users: It is known that @code{dvipng}
+Note for p@LaTeX{} and up@LaTeX{} users: It is known that @command{dvipng}
is not compatible with p@LaTeX{} and up@LaTeX{}. If
@code{preview-image-type} is set to @samp{dvipng} and (u)p@LaTeX{} is
used, @samp{dvipng} just fails and @previewlatex{} falls back on Dvips
@@ -755,21 +757,21 @@ As explained previously, Emacs uses pseudo-error messages
generated by
the @samp{preview} package in order to pinpoint the exact source
location where a preview originated. This works in running text, but
fails when preview material happens to lie in macro arguments, like the
-contents of @code{\emph}. Those macros first read in their entire
+contents of @code{\emph}. Those macros first read in their entire
argument, munge it through, perhaps transform it somehow, process it and
-perhaps then typeset something. When they finally typeset something,
+perhaps then typeset something. When they finally typeset something,
where is the location where the stuff originated? @TeX{}, having read in
the entire argument before, does not know and actually there would be no
sane way of defining it.
For previews contained inside such a macro argument, the default
behaviour of @previewlatex{} is to use a position immediately after the
-closing brace of the argument. All the previews get placed there, all at
+closing brace of the argument. All the previews get placed there, all at
a zero-width position, which means that Emacs displays it in an order
that @previewlatex{} cannot influence (currently in Emacs it is even
-possible that the order changes between runs). And since the placement
+possible that the order changes between runs). And since the placement
of those previews is goofed up, you will not be able to regenerate them
-by clicking on them. The default behaviour is thus somewhat undesirable.
+by clicking on them. The default behaviour is thus somewhat undesirable.
The solution (like with other preview problems) is to tell the @LaTeX{}
@samp{preview} package how to tackle this problem (@pxref{The LaTeX
@@ -778,20 +780,20 @@ during previews! You only want the text math previewed,
so the solution
is to use @code{\PreviewMacro*\emph} in the preamble of your document
which will make @LaTeX{} ignore @code{\emph} completely as long as it is
not part of a larger preview (in which case it gets typeset as
-usual). Its argument thus becomes ordinary text and gets treated like
+usual). Its argument thus becomes ordinary text and gets treated like
ordinary text.
Note that it would be a bad idea to declare
@code{\PreviewMacro*[@{@{@}@}]\emph} since then both @code{\emph} as
-well as its argument would be ignored instead of previewed. For
+well as its argument would be ignored instead of previewed. For
user-level macros, this is almost never wanted, but there may be
internal macros where you might want to ignore internal arguments.
The same mechanism can be used for a number of other text-formatting
-commands like @code{\textrm}, @code{\textit} and the like. While they
+commands like @code{\textrm}, @code{\textit} and the like. While they
all use the same internal macro @code{\text@@command}, it will not do to
redefine just that, since they call it only after having read their
-argument in, and then it already is too late. So you need to disable
+argument in, and then it already is too late. So you need to disable
every of those commands by hand in your document preamble.
Actually, we wrote all of the above just to scare you. At least all of
@@ -806,7 +808,7 @@ or alternatively do the
manual disabling of your favorite macro in
@code{preview-default-preamble},
@vindex preview-default-preamble
-which is customizable in the Preview Latex group.
+which is customizable in the @samp{Preview Latex} group.
@node ToDo, Frequently Asked Questions, For advanced users, top
@c Also used as TODO: in separate file
diff --git a/doc/preview-problems.texi b/doc/preview-problems.texi
index 264e14c..282bd1a 100644
--- a/doc/preview-problems.texi
+++ b/doc/preview-problems.texi
@@ -11,7 +11,7 @@
@c @cindex @code{preview-report-bug}
@c @cindex Report a bug
A number of issues are known concerning the interoperation with various
-other software. Some of the known problems can be solved by moving to
+other software. Some of the known problems can be solved by moving to
newer versions of the problematic software or by simple patches.
@menu
@@ -46,12 +46,12 @@ with bitmapped fonts, anyway. You might try @option{-Ppdf}
for another
stab at scalable fonts, or other printer definitions. Use
@display
-@kbd{M-x customize-variable @key{RET} preview-fast-dvips-command @key{RET}}
+@kbd{M-x customize-option @key{RET} preview-fast-dvips-command @key{RET}}
@end display
@noindent
and
@display
-@kbd{M-x customize-variable @key{RET} preview-dvips-command @key{RET}}
+@kbd{M-x customize-option @key{RET} preview-dvips-command @key{RET}}
@end display
@noindent
in order to customize this.
@@ -102,6 +102,7 @@ which will tag the corners of the included @TeX{} box.
This will mostly
be convenient for @emph{pure} PostScript stuff like that created by
PSTricks, which Dvips would otherwise reserve no space for.
+@c FIXME: It seems that x-symbol is much outdated.
@node x-symbol interoperation
@section x-symbol interoperation
diff --git a/doc/preview-readme.texi b/doc/preview-readme.texi
index 26f8fa1..70fd0c2 100644
--- a/doc/preview-readme.texi
+++ b/doc/preview-readme.texi
@@ -70,7 +70,7 @@ The usual activation (if it is not done automatically) would
be
If you still don't get a ``Preview'' menu in @LaTeX{} mode in spite
of @AUCTeX{} showing its ``Command'', your installation is broken. One
possible cause are duplicate Lisp files that might be detectable with
-@kbd{@key{M-x} list-load-path-shadows @key{RET}}.
+@kbd{M-x list-load-path-shadows @key{RET}}.
@node Getting started, Basic modes of operation, Activating preview-latex,
Introduction
@section Getting started
@@ -121,7 +121,7 @@ Ghostscript get called by default.
The image type to be generated by Ghostscript can be configured with
@example
-@kbd{M-x} customize-variable @kbd{RET} preview-image-type @kbd{RET}
+@kbd{M-x customize-option @key{RET} preview-image-type @key{RET}}
@end example
@vindex preview-image-type
@@ -171,12 +171,11 @@ a printable
@iftex
this printed
@end iftex
-manual may also be available in the form of @file{preview-latex.dvi} or
-@file{preview-latex.ps}.
+manual may also be available in the form of @file{preview-latex.pdf}.
Detailed documentation for the @LaTeX{} style used for extracting the
-preview images is placed in @file{preview.dvi} in a suitable directory
-during installation; on typical teTeX-based systems,
+preview images is placed in @file{preview.pdf} in a suitable directory
+during installation; on typical @w{@TeX{} Live}-based systems,
@example
texdoc preview
@@ -198,7 +197,7 @@ project page}. You can get its files from the
@AUCTeX{}, so no separate download will be necessary.
You will also find @file{.rpm} files there for Fedora and possibly
-SuSE. Anonymous @acronym{Git} is available as well.
+SuSE. Anonymous Git is available as well.
@node Contacts, , Availability, Introduction
@section Contacts
diff --git a/doc/preview-todo.texi b/doc/preview-todo.texi
index f39618f..485373e 100644
--- a/doc/preview-todo.texi
+++ b/doc/preview-todo.texi
@@ -7,10 +7,10 @@
@item Support other formats than just @LaTeX{}
-plain @TeX{} users and Con@TeX{}t users should not have to feel left
-out. While Con@TeX{}t is not supported yet by released versions of
+plain @TeX{} users and @ConTeXt{} users should not have to feel left
+out. While @ConTeXt{} is not supported yet by released versions of
@AUCTeX{}, at least supporting plain would help people, and be a start
-for Con@TeX{}t as well. There are plain-based formats like MusiX@TeX{}
+for @ConTeXt{} as well. There are plain-based formats like MusiX@TeX{}
that could benefit a lot from @previewlatex{}. The main part of the
difficulties here is to adapt @file{preview.dtx} to produce stuff not
requiring @LaTeX{}.
@@ -73,12 +73,12 @@ Various stuff appears several times.
@item Implement rendering pipelines for Emacs
-The current @file{gs.el} interface is fundamentally flawed, not only
+The current @previewlatex{} interface is fundamentally flawed, not only
because of a broken implementation. A general batchable and
daemonizable rendering infrastructure that can work on all kinds of
preview images for embedding into buffers is warranted. The current
implementation has a rather adhoc flavor and is not easily extended.
-It will not work outside of AUCTeX, either.
+It will not work outside of @AUCTeX{}, either.
@item Integrate into Ref@TeX{}
@@ -93,7 +93,7 @@ Previews on erroneous @LaTeX{} passages might gain a red
border or similar.
@item Pop up relevant online documentation for frequent errors
-A lot of errors are of the "badly configured" variety. Perhaps the
+A lot of errors are of the ``badly configured'' variety. Perhaps the
relevant info pages should be delivered in addition to the error
message.
diff --git a/doc/quickstart.texi b/doc/quickstart.texi
index 0bea60d..874b4eb 100644
--- a/doc/quickstart.texi
+++ b/doc/quickstart.texi
@@ -25,7 +25,7 @@ inserting
@lisp
(load "auctex.el" nil t t)
@end lisp
-
+@noindent
in your user init file.@footnote{This usually is a file in your home
directory called @file{.emacs}, or @file{.emacs.d/init.el}.}
@@ -46,7 +46,7 @@ be achieved by putting
(setq TeX-auto-save t)
(setq TeX-parse-self t)
@end lisp
-
+@noindent
into your init file. Finally, if you often use @code{\include} or
@code{\input}, you should make @AUCTeX{} aware of the multi-file
document structure. You can do this by inserting
@@ -77,17 +77,15 @@ and for viewing and debugging.
@subsection Making your @TeX{} code more readable
@AUCTeX{} can do syntax highlighting of your source code, that means
-commands will get special colors or fonts. You can enable it locally by
-typing @kbd{M-x font-lock-mode RET}. If you want to have font locking
-activated generally, enable @code{global-font-lock-mode}, e.g. with
-@kbd{M-x customize-variable RET global-font-lock-mode RET}.
+commands will get special colors or fonts. This is enabled by default.
+You can disable it locally by typing @kbd{M-x font-lock-mode @key{RET}}.
@AUCTeX{} will indent new lines to indicate their syntactical
relationship to the surrounding text. For example, the text of a
@code{\footnote} or text inside of an environment will be indented
relative to the text around it. If the indenting has gotten wrong after
adding or deleting some characters, use @key{TAB} to reindent the line,
-@kbd{M-q} for the whole paragraph, or @kbd{M-x LaTeX-fill-buffer RET}
+@kbd{M-q} for the whole paragraph, or @kbd{M-x LaTeX-fill-buffer @key{RET}}
for the whole buffer.
@subsection Entering sectioning commands
@@ -100,7 +98,7 @@ for the whole buffer.
@cindex @code{\label}
Insertion of sectioning macros, that is @samp{\chapter},
-@samp{\section}, @samp{\subsection}, etc. and accompanying @samp{\label}
+@samp{\section}, @samp{\subsection}, etc.@: and accompanying @samp{\label}
commands may be eased by using @kbd{C-c C-s}. You will be asked for the
section level. As nearly everywhere in @AUCTeX{}, you can use the
@key{TAB} or @key{SPC} key to get a list of available level names, and
@@ -117,8 +115,8 @@ list, and to complete what you type. Actually, the list
will not only
provide standard @LaTeX{} environments, but also take your
@samp{\documentclass} and @samp{\usepackage} commands into account if
you have parsing enabled by setting @code{TeX-parse-self} to @code{t}.
-If you use a couple of environments frequently, you can use the up and
-down arrow keys (or @kbd{M-p} and @kbd{M-n}) in the minibuffer to get
+If you use a couple of environments frequently, you can use the @key{up} and
+@key{down} arrow keys (or @kbd{M-p} and @kbd{M-n}) in the minibuffer to get
back to the previously inserted commands.
Some environments need additional arguments. Often, @AUCTeX{} knows about
@@ -128,14 +126,14 @@ this and asks you to enter a value.
@kbd{C-c C-m}, or simply @kbd{C-c RET} will give you a prompt that asks
you for a @LaTeX{} macro. You can use @key{TAB} for completion, or the
-up/down arrow keys (or @kbd{M-p} and @kbd{M-n}) to browse the command
+@key{up}/@key{down} arrow keys (or @kbd{M-p} and @kbd{M-n}) to browse the
command
history. In many cases, @AUCTeX{} knows which arguments a macro needs
and will ask you for that. It even can differentiate between mandatory
and optional arguments---for details, see @ref{Completion}.
An additional help for inserting macros is provided by the possibility
to complete macros right in the buffer. With point at the end of a
-partially written macro, you can complete it by typing @kbd{M-TAB}.
+partially written macro, you can complete it by typing @kbd{M-@key{TAB}}.
@subsection Changing the font
@@ -158,17 +156,17 @@ Insert @i{italics} @samp{\textit@{@point{}@}} text.
@item C-c C-f C-e
@kindex C-c C-f C-e
@cindex @code{\emph}
-Insert @i{emphasized} @samp{\emph@{@point{}@}} text.
+Insert @emph{emphasized} @samp{\emph@{@point{}@}} text.
@item C-c C-f C-s
@kindex C-c C-f C-s
@cindex @code{\textsl}
-Insert @i{slanted} @samp{\textsl@{@point{}@}} text.
+Insert @slanted{slanted} @samp{\textsl@{@point{}@}} text.
@item C-c C-f C-r
@kindex C-c C-f C-r
@cindex @code{\textrm}
-Insert roman @samp{\textrm@{@point{}@}} text.
+Insert @r{roman} @samp{\textrm@{@point{}@}} text.
@item C-c C-f C-f
@kindex C-c C-f C-f
@@ -209,7 +207,7 @@ braces. It offers shortcuts for commenting out text
(@kbd{C-c ;} for
the current region or @kbd{C-c %} for the paragraph you are in). The
same keystrokes will remove the % signs, if the region or paragraph is
commented out yet. With @code{TeX-fold-mode}, you can hide certain
-parts (like footnotes, references etc.) that you do not edit currently.
+parts (like footnotes, references etc.)@: that you do not edit currently.
Support for Emacs' outline mode is provided as well. And there's more,
but this is beyond the scope of this Quick Start Guide.
@@ -253,23 +251,27 @@ Ah, you didn't know you can do both? That brings us to
the next topic.
From a @LaTeX{} file, you can produce @acronym{DVI} output, or a
@acronym{PDF} file directly @i{via} @command{pdflatex}. You can switch
on source specials for easier navigation in the output file, or tell
-@command{latex} to stop after an error (usually @code{\noninteractive}
+@command{latex} to stop after an error (usually @option{--noninteractive}
is used, to allow you to detect all errors in a single run).
These options are controlled by toggles, the keystrokes should be easy
to memorize:
@table @kbd
-@item @kbd{C-c C-t C-p}
+@item C-c C-t C-p
+@kindex C-c C-t C-p
This command toggles between @acronym{DVI} and @acronym{PDF} output
-@item @kbd{C-c C-t C-i}
+@item C-c C-t C-i
+@kindex C-c C-t C-i
toggles interactive mode
-@item @kbd{C-c C-t C-s}
-toggles source specials support
+@item C-c C-t C-s
+@kindex C-c C-t C-s
+toggles Sync@TeX{} (or source specials) support
-@item @kbd{C-c C-t C-o}
+@item C-c C-t C-o
+@kindex C-c C-t C-o
toggles usage of Omega/lambda.
@end table
@@ -277,10 +279,10 @@ toggles usage of Omega/lambda.
There is also another possibility: compile the document with
@command{tex} (or @command{latex}) and then convert the resulting
@acronym{DVI} file to @acronym{PDF} using
-@command{dvips}--@command{ps2pdf} sequence. If you want to go by this
-route, when @code{TeX-PDF-via-dvips-ps2pdf} variable is non-nil,
-@AUCTeX{} will suggest you to run the appropriate command when you type
-@kbd{C-C C-c}. For details, see @ref{Processor Options}.
+@command{dvips}--@command{ps2pdf} sequence or @command{dvipdfmx} command.
+If you want to go by this route, customize @code{TeX-PDF-from-DVI} option.
+Then @AUCTeX{} will suggest you to run the appropriate command when
+you type @kbd{C-C C-c}. For details, see @ref{Processor Options}.
@subsection Debugging @LaTeX{}
@@ -298,7 +300,7 @@ may be repeated until all errors have been dealt with. By
pressing
@AUCTeX{} should notify you of overfull and underfull boxes in addition
to regular errors.
-Issue @kbd{M-x TeX-error-overview RET} to see a nicely formatted list of
+Issue @kbd{M-x TeX-error-overview @key{RET}} to see a nicely formatted list of
all errors and warnings reported by the compiler.
If a command got stuck in a seemingly infinite loop, or you want to stop
@@ -318,7 +320,6 @@ If you are using @code{\include} or @code{\input} to
structure your
document, try @kbd{C-c C-b} while you are editing one of the included
files. It will run @command{latex} only on the current buffer, using the
preamble from the master file.
-@c does this also work with input? why not?
@c Local Variables:
@c mode: texinfo
diff --git a/doc/todo.texi b/doc/todo.texi
index ca4db2f..9818a8b 100644
--- a/doc/todo.texi
+++ b/doc/todo.texi
@@ -1,6 +1,6 @@
@c This is part of the AUCTeX Manual.
-@c Copyright (C) 2004-2006, 2008, 2009, 2013-2015, 2020 Free Software
-@c Foundation, Inc.
+@c Copyright (C) 2004-2006, 2008, 2009, 2013-2015,
+@c 2020, 2021 Free Software Foundation, Inc.
@c See the file auctex.texi for copying conditions.
@ifset rawfile
@include macros.texi
@@ -66,7 +66,7 @@ common practice that major mode functions directly add macros
and
environments via @code{TeX-add-symbols} and
@code{LaTeX-add-environments}, but those macros and environments are
lost once @code{TeX-remove-style} runs. It is necessary to run major
-mode function, by e.g. @code{normal-mode}, again to recover them, but
+mode function, by e.g.@: @code{normal-mode}, again to recover them, but
that makes no point in running @code{TeX-remove-style} itself because
major mode function kills all buffer-local variables.
@@ -102,12 +102,12 @@ order to insert the respective sequence into the buffer
(cf. the
@item Crossreferencing support
It would be nice if you could index process your favorite collection of
-@file{.dtx} files (such as the LaTeX source), just call a command on
-arbitrary control sequence, and get either the DVI viewer opened right
+@file{.dtx} files (such as the @LaTeX{} source), just call a command on
+arbitrary control sequence, and get either the @acronym{DVI} viewer opened
right
at the definition of that macro (using Source Specials), or the source
code of the @file{.dtx} file.
-@item Better plain TeX support
+@item Better plain @TeX{} support
For starters, @code{LaTeX-math-mode} is not very @LaTeX{}-specific in
the first place, and similar holds for indentation and formatting.
@@ -116,12 +116,12 @@ the first place, and similar holds for indentation and
formatting.
Page count when compiling should (optionally) go to modeline of the
window where the compilation command was invoked, instead of the output
window. Suggested by Karsten Tinnefeld
-<tinnefeld@@irb.informatik.uni-dortmund.de>.
+@email{tinnefeld@@irb.informatik.uni-dortmund.de}.
@item
Command to insert a macrodefinition in the preamble, without moving
point from the current location. Suggested by
-"Jeffrey C. Ely" <ely@@nwu.edu>.
+"Jeffrey C. Ely" @email{ely@@nwu.edu}.
@item
A database of all commands defined in all stylefiles. When a command or
@@ -130,20 +130,20 @@ the appropriate @code{\usepackage} in the preamble.
@item
A way to add and overwrite math mode entries in style files, and to
-decide where they should be. Suggested by Remo Badii <Remo.Badii@@psi.ch>.
+decide where they should be. Suggested by Remo Badii
@email{Remo.Badii@@psi.ch}.
@item
Create template for (first) line of tabular environment.
@item
-@c Already fixed?
+@c FIXME: Already fixed?
I think prompting for the master is the intended behaviour. It
-corresponds to a `shared' value for TeX-master.
+corresponds to a `shared' value for @code{TeX-master}.
There should probably be a `none' value which wouldn't query for the
-master, but instead disable all features that relies on TeX-master.
+master, but instead disable all features that relies on @code{TeX-master}.
-This default value for TeX-master could then be controled with mapping
+This default value for @code{TeX-master} could then be controled with mapping
based on the extension.
@item
@@ -170,11 +170,11 @@ LaTeX macros, available from the menu bar.
@item
@code{TeX-command-default} should be set from the master file, if not
-set locally. Suggested by Peter Whaite @samp{<peta@@cim.mcgill.ca>}.
+set locally. Suggested by Peter Whaite @email{peta@@cim.mcgill.ca}.
@item
Make @AUCTeX{} work with @samp{crypt++}. Suggested by Chris Moore
-@samp{<Chris.Moore@@src.bae.co.uk>}.
+@email{Chris.Moore@@src.bae.co.uk}.
@item
Make @AUCTeX{} work with @samp{longlines}. This would also apply to
@@ -182,9 +182,10 @@ Make @AUCTeX{} work with @samp{longlines}. This would
also apply to
before attempting this.
@item
+@c FIXME: Already achieved?
The @samp{Spell} command should apply to all files in a document. Maybe
it could try to restrict to files that have been modified since last
-spell check? Suggested by Ravinder Bhumbla @samp{<rbhumbla@@ucsd.edu>}.
+spell check? Suggested by Ravinder Bhumbla @email{rbhumbla@@ucsd.edu}.
@item
Make @key{.} check for abbreviations and sentences ending with capital
@@ -193,7 +194,7 @@ letters.
@item
Use Emacs 19 minibuffer history to choose between previewers, and other
stuff. Suggested by John Interrante
-@samp{<interran@@uluru.Stanford.EDU>}.
+@email{interran@@uluru.Stanford.EDU}.
@item
Documentation of variables that can be set in a style hook.
@@ -220,7 +221,7 @@ Here is the start of such a list.
@item
Outline should be (better) supported in @TeX{} mode.
-At least, support headers, trailers, as well as TeX-outline-extra.
+At least, support headers, trailers, as well as @code{TeX-outline-extra}.
@item
@code{TeX-header-start} and @code{TeX-trailer-end}.
@@ -276,7 +277,7 @@ loading a new file.
@item
Maybe the regexp for matching a TeX symbol during parsing should be
@samp{"\\\\\\([a-zA-Z]+\\|.\\)"} ---
-@samp{<thiemann@@informatik.uni-tuebingen.de>} Peter Thiemann.
+@email{thiemann@@informatik.uni-tuebingen.de} Peter Thiemann.
@item
@AUCTeX{} should not parse verbatim environments.
diff --git a/doc/wininstall.texi b/doc/wininstall.texi
index 5289ab6..230f8e2 100644
--- a/doc/wininstall.texi
+++ b/doc/wininstall.texi
@@ -1,5 +1,5 @@
@c This is part of the AUCTeX Manual.
-@c Copyright (C) 2003-2007, 2009, 2018
+@c Copyright (C) 2003-2007, 2009, 2018, 2021
@c Free Software Foundation, Inc.
@c See the file auctex.texi for copying conditions.
@ifset rawfile
@@ -15,7 +15,7 @@ further below.
@enumerate
@item
-Install the prerequisites, i.e. GNU Emacs, MSYS or Cygwin, a @TeX{}
+Install the prerequisites, i.e.@: GNU Emacs, MSYS or Cygwin, a @TeX{}
system, and Ghostscript.
@item
@@ -28,7 +28,7 @@ Configure @AUCTeX{}:
For Emacs: Many people like to install @AUCTeX{} into the pseudo file
system hierarchy set up by the Emacs installation. Assuming Emacs is
installed in @file{C:/Program Files/Emacs} and the directory for local
-additions of your @TeX{} system, e.g. MiK@TeX{}, is
+additions of your @TeX{} system, e.g.@: MiK@TeX{}, is
@file{C:/localtexmf}, you can do this by typing the following statement
at the shell prompt:
@@ -166,11 +166,11 @@ gswin32c -h
@end example
on a Windows command line should tell you whether your Ghostscript
supports the @code{png16m} device needed for @acronym{PNG} support.
-MiKTeX apparently comes with its own Ghostscript called @samp{mgs.exe}.
+MiK@TeX{} apparently comes with its own Ghostscript called @file{mgs.exe}.
@item
@uref{https://www.perl.org/,Perl} is needed for rebuilding the
-documentation if you are working with a copy from @acronym{Git} or have
+documentation if you are working with a copy from Git or have
touched documentation source files in the @previewlatex{} part. If the
line endings of the file @file{preview/latex/preview.dtx} don't
correspond with what Perl calls @code{\n} when reading text files,
@@ -182,23 +182,23 @@ Now the fun stuff starts. If you have not yet done so,
unpack the
instructions for unpacking above.
@item
-Ready for takeoff. Start some shell (typically @command{bash}) capable of
+Ready for takeoff. Start some shell (typically @command{bash}) capable of
running @command{configure}, change into the installation directory and
call @command{./configure} with appropriate options.
Typical options you'll want to specify will be
@table @code
@item --prefix=@var{drive:/path/to/emacs-hierarchy}
-which tells @file{configure} where to perform the installation. It may
-also make @file{configure} find Emacs automatically; if this doesn't
-happen, try @samp{--with-emacs} as described below. All automatic
+which tells @command{configure} where to perform the installation. It may
+also make @command{configure} find Emacs automatically; if this doesn't
+happen, try @option{--with-emacs} as described below. All automatic
detection of files and directories restricts itself to directories below
the @var{prefix} or in the same hierarchy as the program accessing the
files. Usually, directories like @file{man}, @file{share} and
@file{bin} will be situated right under @var{prefix}.
This option also affects the defaults for placing the Texinfo
-documentation files (see also @samp{--infodir} below) and automatically
+documentation files (see also @option{--infodir} below) and automatically
generated style hooks.
If you have a central directory hierarchy (not untypical with Cygwin)
@@ -249,7 +249,7 @@ display.
@item --with-texmf-dir=@var{drive:/dir}
This will specify the directory where your @TeX{} installation sits. If
-your @TeX{} installation does not conform to the TDS (@TeX{} directory
+your @TeX{} installation does not conform to the @acronym{TDS} (@TeX{}
directory
standard), you may need to specify more options to get everything in
place.
@end table
@@ -262,13 +262,14 @@ the `Configure' section in the @file{INSTALL} file.
@ref{Configure}.
@end ifclear
-Calling
-@file{./configure --help=recursive}
-will tell about other options, but those are almost never required.
+@c FIXME: It seems this no longer holds.
+@c Calling
+@c @file{./configure --help=recursive}
+@c will tell about other options, but those are almost never required.
Some executables might not be found in your path. That is not a good
idea, but you can get around by specifying environment variables to
-@file{configure}:
+@command{configure}:
@example
GS="@var{drive:/path/to/gswin32c.exe}" ./configure @dots{}
@end example
@@ -276,7 +277,7 @@ should work for this purpose. @file{gswin32c.exe} is the
usual name for
the required @emph{command line} executable under Windows; in contrast,
@file{gswin32.exe} is likely to fail.
-As an alternative to specifying variables for the @file{configure} call
+As an alternative to specifying variables for the @command{configure} call
you can add directories containing the required executables to the
@env{PATH} variable of your Windows system. This is especially a good
idea if Emacs has trouble finding the respective programs later during
@@ -294,10 +295,10 @@ working @file{site-start.d} directory or similar setup,
since then the
startup files @file{auctex.el} and @file{preview-latex.el} will have
been placed there. If this has not been done, you should be able to
load the startup files manually with
-@example
+@lisp
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
-@end example
+@end lisp
in either a site-wide @file{site-start.el} or your personal startup file
(usually accessible as @file{~/.emacs} or @file{~/.emacs.d/init.el} from
within Emacs).
@@ -305,23 +306,23 @@ within Emacs).
@cindex @file{tex-mik.el}
The default configuration of @AUCTeX{} is probably not the best fit for
Windows systems with MiK@TeX{}. You might want to add
-@example
+@lisp
(require 'tex-mik)
-@end example
+@end lisp
after loading @file{auctex.el} and @file{preview-latex.el} in order to
get more appropriate values for some customization options.
You can always use
@example
-@kbd{M-x customize-group RET AUCTeX RET}
+@kbd{M-x customize-group @key{RET} AUCTeX @key{RET}}
@end example
in order to customize more stuff, or use the @samp{Customize} menu.
@item
Load @file{circ.tex} into Emacs and see if you get the @samp{Command}
-menu. Try using it to @LaTeX{} the file.
+menu. Try using it to @LaTeX{} the file.
@item
Check whether the @samp{Preview} menu is available in this file. Use it
@@ -332,7 +333,7 @@ you can either add @acronym{PNG} support to your Emacs
installation or
choose another image format to be used by @previewlatex{}.
Adding support for an image format usually involves the installation of
-a library, e.g. from @uref{http://gnuwin32.sf.net/}. If you got your
+a library, e.g.@: from @uref{http://gnuwin32.sf.net/}. If you got your
Emacs from @uref{https://www.gnu.org/} you might want to check its
@uref{https://ftp.gnu.org/gnu/emacs/windows/README,README file} for
details.
@@ -345,9 +346,9 @@ support is the only problem with your Emacs installation.
Try adding the line
-@example
+@lisp
(setq preview-image-type 'pnm)
-@end example
+@end lisp
to your init file for a quick test. You should remove the line after
the test again, because @acronym{PNM} files take away @strong{vast}
diff --git a/font-latex.el b/font-latex.el
index df38b69..da95bc2 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -331,8 +331,9 @@ variable `font-latex-fontify-sectioning'." ',num)
font-lock-constant-face 2 command)
("reference"
(("nocite" "*{") ("cite" "*[[{") ("label" "{") ("pageref" "{")
- ("vref" "*{") ("eqref" "{") ("ref" "{") ("Ref" "{") ("include" "{")
- ("input" "{") ("bibliography" "{") ("index" "{") ("glossary" "{")
+ ("vref" "*{") ("eqref" "{") ("ref" "{") ("Ref" "{")
+ ("footref" "{") ("include" "{") ("input" "{")
+ ("bibliography" "{") ("index" "{") ("glossary" "{")
("footnote" "[{") ("footnotemark" "[") ("footnotetext" "[{")
("marginpar" "[{") ("chaptermark" "{") ("sectionmark" "{")
("subsectionmark" "{") ("subsubsectionmark" "{")
@@ -1024,7 +1025,7 @@ have changed."
;; argument and allows for up to one level of brackets
;; inside the argument (e.g., the dialect of a language in
;; the `lstlisting' environment by the `listings' package).
- "\\(?:\\[[^\]\[]*\\(?:\\[[^\]\[]*\\][^\]\[]*\\)*\\]\\)?"
+ "\\(?:\\[[^][]*\\(?:\\[[^][]*\\][^][]*\\)*\\]\\)?"
;; After the optional argument, there may also be another
;; mandatory argument(s) (e.g. with VerbatimOut or the
;; minted envs or defined with `lstnewenvironment'). Use
@@ -1875,7 +1876,8 @@ The \\begin{equation} incl. arguments in the same line and
(font-latex-find-dollar-math
;; Hope that limit+font-latex-multiline-boundary
;; doesn't fall just inside single "$$".
- (+ limit font-latex-multiline-boundary) num)
+ (min (point-max) (+ limit font-latex-multiline-boundary))
+ num)
;; Found.
(progn
(forward-char num)
@@ -1896,7 +1898,8 @@ The \\begin{equation} incl. arguments in the same line and
"Find dollar sign(s) before LIMIT.
Set point just before the found $. Ignore escaped $ (\"\\$\").
Optional argument NUM, if non-nil, specifies the number of dollar
-signs to follow the point and must be 1 or 2."
+signs to follow the point and must be 1 or 2.
+LIMIT must not exceed the end of buffer."
(catch 'found
(while (progn
(skip-chars-forward "^$" limit)
@@ -1905,8 +1908,17 @@ signs to follow the point and must be 1 or 2."
;; If that "$" is not our target, skip over it and search
;; again.
(cond
- ;; check 1: Are we in a verbatim construct?
- ((nth 3 (syntax-ppss))
+ ;; check 1: Are we in a verbatim construct or comment?
+ ((let ((ppss (syntax-ppss)))
+ (or (nth 3 ppss)
+ ;; Ignore $ in comments...
+ (and (nth 4 ppss)
+ ;; ... except if we're looking for the end of the
+ ;; inline math. We need to consider this %$
+ ;; comments because they are the workaround for
+ ;; falsely triggered math mode due to valid,
+ ;; non-math occurrences of $. (bug#48365)
+ (not num))))
(skip-chars-forward "$" limit))
;; check 2: Else, is "$" escaped?
((TeX-escaped-p)
@@ -1920,21 +1932,6 @@ signs to follow the point and must be 1 or 2."
;; followed by $$ because expressions like "$1+1$$2+2$" and
;; "$1+2$$$3+3$$" are legal.
(forward-char 1))
- ;; (Quote from bug#19589, with a bit of adaptation)
- ;;
- ;; > When I use environment variables (such as $HOME) in a .tex
- ;; > file, the $ triggers math mode syntax highlighting. The
- ;; > result is that the rest of the buffer, until the next $,
- ;; > is highlighted as if it were in math mode. Some examples:
- ;; > \includegraphics{$HOME/path/to/graphic}
- ;; > \bibliography{$HOME/path/to/bib}
- ;;
- ;; In order to spare workaround of adding "%$" at the end of
- ;; the lines for such cases, we stay away from the next syntax
- ;; state check.
- ;; ;; check 3: Else, is "$" in comments or verb-like construct?
- ;; ((nth 8 (syntax-ppss))
- ;; (skip-chars-forward "$" limit))
(t
;; That "$" is live one.
(throw 'found t))))))
diff --git a/latex.el b/latex.el
index fe09378..5204ff4 100644
--- a/latex.el
+++ b/latex.el
@@ -45,6 +45,15 @@
(declare-function turn-off-filladapt-mode "ext:filladapt"
nil)
+;; These functions are reported to be unknown when built
+;; `with-native-compilation':
+(declare-function LaTeX-command-section-change-level "tex-buf"
+ (arg))
+(declare-function TeX-LaTeX-sentinel "tex-buf"
+ (process name))
+(declare-function LaTeX-flymake "latex-flymake"
+ (report-fn &rest _args))
+
;; Silence the compiler for variables:
(defvar outline-heading-alist)
(defvar TeX-auto-file)
@@ -816,7 +825,9 @@ environment just inserted, the buffer position just before
(or (assoc environment LaTeX-indent-environment-list)
(if auto-fill-function
;; Fill the region only when `auto-fill-mode' is active.
- (LaTeX-fill-region content-start (line-beginning-position
2))))
+ (LaTeX-fill-region content-start (line-beginning-position 2))
+ ;; Else just indent the region. (bug#48518)
+ (indent-region content-start (line-beginning-position 2))))
(set-mark content-start))
(indent-according-to-mode))
;; Indent \end{foo}.
@@ -1066,8 +1077,9 @@ If nil, act like the empty string is given, but do not
prompt."
(deactivate-mark)
(LaTeX-insert-item)
;; The inserted \item may have outdented the first line to the
- ;; right. Fill it, if appropriate.
- (when (and (not (looking-at "$"))
+ ;; right. Fill it, if appropriate and `auto-fill-mode' is active.
+ (when (and auto-fill-function
+ (not (looking-at "$"))
(not (assoc environment LaTeX-indent-environment-list))
(> (- (line-end-position) (line-beginning-position))
(current-fill-column)))
@@ -1817,7 +1829,7 @@ The value is actually the tail of the list of options
given to CLASS."
Return first found class option matching REGEXP, or nil if not found."
(TeX-member regexp (apply #'append
(mapcar #'cdr LaTeX-provided-class-options))
- 'string-match))
+ #'string-match))
(defvar LaTeX-provided-package-options nil
"Alist of options provided to LaTeX packages.
@@ -1947,7 +1959,7 @@ The value is actually the tail of the list of options
given to PACKAGE."
;; NOTE: This uses an O(N^2) algorithm, while an O(N log N)
;; algorithm is possible.
(mapc (lambda (symbol)
- (if (not (TeX-member symbol TeX-auto-symbol 'equal))
+ (if (not (TeX-member symbol TeX-auto-symbol #'equal))
;; No matching symbol, insert in list
(add-to-list 'TeX-auto-symbol (concat "end" symbol))
;; Matching symbol found, remove from list
@@ -2336,6 +2348,9 @@ and this variable will be ignored."
Initialized once at the first time you prompt for a LaTeX class.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+;; Add the variable to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'TeX-global-class-files)
+
(defcustom TeX-arg-input-file-search t
"If `TeX-arg-input-file' should search for files.
If the value is t, files in TeX's search path are searched for
@@ -2415,6 +2430,15 @@ To insert a hook here, you must insert it in the
appropiate style file.")
Initialized once at the first time you prompt for an input file.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+(defvar LaTeX-global-package-files nil
+ "List of the LaTeX package files.
+Initialized once at the first time you prompt for a LaTeX package.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
+;; Add both variables to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'TeX-global-input-files)
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-global-package-files)
+
(defun LaTeX-arg-usepackage-read-packages-with-options ()
"Read the packages and the options for the usepackage macro.
@@ -2424,18 +2448,18 @@ of the options, nil otherwise."
(let* ((TeX-file-extensions '("sty"))
(crm-separator ",")
packages var options)
- (unless TeX-global-input-files
+ (unless LaTeX-global-package-files
(if (if (eq TeX-arg-input-file-search 'ask)
(not (y-or-n-p "Find packages yourself? "))
TeX-arg-input-file-search)
(progn
(message "Searching for LaTeX packages...")
- (setq TeX-global-input-files
+ (setq LaTeX-global-package-files
(mapcar #'list (TeX-search-files-by-type
- 'texinputs 'global t t)))
+ 'texinputs 'global t t)))
(message "Searching for LaTeX packages...done"))))
(setq packages (TeX-completing-read-multiple
- "Packages: " TeX-global-input-files))
+ "Packages: " LaTeX-global-package-files))
;; Clean up hook before use in `LaTeX-arg-usepackage-insert'.
(setq LaTeX-after-usepackage-hook nil)
(mapc #'TeX-load-style packages)
@@ -2580,6 +2604,10 @@ May be reset with `\\[universal-argument]
\\[TeX-normal-mode]'.")
Initialized once at the first time you prompt for a BibLaTeX
style. May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+;; Add both variables to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'BibTeX-global-style-files)
+(add-to-list 'TeX-normal-mode-reset-list 'BibLaTeX-global-style-files)
+
(defun TeX-arg-bibstyle (optional &optional prompt)
"Prompt for a BibTeX style file.
If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -2593,7 +2621,7 @@ string."
(TeX-argument-insert
(completing-read (TeX-argument-prompt optional prompt "BibTeX style")
(append (mapcar #'list (TeX-search-files-by-type
- 'bstinputs 'local t t))
+ 'bstinputs 'local t t))
BibTeX-global-style-files))
optional))
@@ -2609,6 +2637,9 @@ May be reset with `\\[universal-argument]
\\[TeX-normal-mode]'.")
Initialized once at the first time you prompt for an Biber file.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+(add-to-list 'TeX-normal-mode-reset-list 'BibTeX-global-files)
+(add-to-list 'TeX-normal-mode-reset-list 'TeX-Biber-global-files)
+
(defun TeX-arg-bibliography (optional &optional prompt)
"Prompt for a BibTeX database file.
If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -5482,7 +5513,9 @@ the symbols will be surrounded by dollar signs. The
following
commands are defined:
\\{LaTeX-math-mode-map}"
- nil nil (list (cons (LaTeX-math-abbrev-prefix) LaTeX-math-keymap))
+ :init-value nil
+ :lighter nil
+ :keymap (list (cons (LaTeX-math-abbrev-prefix) LaTeX-math-keymap))
(TeX-set-mode-name))
(defalias 'latex-math-mode #'LaTeX-math-mode)
@@ -6018,6 +6051,420 @@ Install tool bar if `LaTeX-enable-toolbar' is non-nil."
;; Defined in `tex-bar.el':
(LaTeX-install-toolbar)))
+;;; Error Messages
+
+(defconst LaTeX-error-description-list
+ '(("\\(?:Package Preview Error\\|Preview\\):.*" .
+ "The `auctex' option to `preview' should not be applied manually.
+If you see this error message outside of a preview run, either
+you did something too clever, or AUCTeX something too stupid.")
+
+ ("Bad \\\\line or \\\\vector argument.*" .
+ "The first argument of a \\line or \\vector command, which specifies the
+slope, is illegal\.")
+
+ ("Bad math environment delimiter.*" .
+ "TeX has found either a math-mode-starting command such as \\[ or \\(
+when it is already in math mode, or else a math-mode-ending command
+such as \\) or \\] while in LR or paragraph mode. The problem is caused
+by either unmatched math mode delimiters or unbalanced braces\.")
+
+ ("Bad use of \\\\\\\\.*" .
+ "A \\\\ command appears between paragraphs, where it makes no sense. This
+error message occurs when the \\\\ is used in a centering or flushing
+environment or else in the scope of a centering or flushing
+declaration.")
+
+ ("\\\\begin{[^ ]*} ended by \\\\end{[^ ]*}." .
+ "LaTeX has found an \\end command that doesn't match the corresponding
+\\begin command. You probably misspelled the environment name in the
+\\end command, have an extra \\begin, or else forgot an \\end.")
+
+ ("Can be used only in preamble." .
+ "LaTeX has encountered, after the \\begin{document}, one of the
+following commands that should appear only in the preamble:
+\\documentclass, \\nofiles, \\includeonly, \\makeindex, or
+\\makeglossary. The error is also caused by an extra \\begin{document}
+command.")
+
+ ("Command name [^ ]* already used.*" .
+ "You are using \\newcommand, \\newenvironment, \\newlength, \\newsavebox,
+or \\newtheorem to define a command or environment name that is
+already defined, or \\newcounter to define a counter that already
+exists. (Defining an environment named gnu automatically defines the
+command \\gnu.) You'll have to choose a new name or, in the case of
+\\newcommand or \\newenvironment, switch to the \\renew ... command.")
+
+ ("Counter too large." .
+ "1. Some object that is numbered with letters, probably an item in a
+enumerated list, has received a number greater than 26. Either you're
+making a very long list or you've been resetting counter values.
+
+2. Footnotes are being ``numbered'' with letters or footnote symbols
+and LaTeX has run out of letters or symbols. This is probably caused
+by too many \\thanks commands.")
+
+ ("Environment [^ ]* undefined." .
+ "LaTeX has encountered a \\begin command for a nonexistent environment.
+You probably misspelled the environment name. ")
+
+ ("Float(s) lost." .
+ "You put a figure or table environment or a \\marginpar command inside a
+parbox---either one made with a minipage environment or \\parbox
+command, or one constructed by LaTeX in making a footnote, figure,
+etc. This is an outputting error, and the offending environment or
+command may be quite a way back from the point where LaTeX discovered
+the problem. One or more figures, tables, and/or marginal notes have
+been lost, but not necessarily the one that caused the error.")
+
+ ("Illegal character in array arg." .
+ "There is an illegal character in the argument of an array or tabular
+environment, or in the second argument of a \\multicolumn command.")
+
+ ("Missing \\\\begin{document}." .
+ "LaTeX produced printed output before encountering a \\begin{document}
+command. Either you forgot the \\begin{document} command or there is
+something wrong in the preamble. The problem may be a stray character
+or an error in a declaration---for example, omitting the braces around
+an argument or forgetting the \\ in a command name.")
+
+ ("Missing p-arg in array arg.*" .
+ "There is a p that is not followed by an expression in braces in the
+argument of an array or tabular environment, or in the second argument
+of a \\multicolumn command.")
+
+ ("Missing @-exp in array arg." .
+ "There is an @ character not followed by an @-expression in the
+argument of an array or tabular environment, or in the second argument
+of a \\multicolumn command.")
+
+ ("No such counter." .
+ "You have specified a nonexistent counter in a \\setcounter or
+\\addtocounter command. This is probably caused by a simple typing
+error. However, if the error occurred while a file with the extension
+aux is being read, then you probably used a \\newcounter command
+outside the preamble.")
+
+ ("Not in outer par mode." .
+ "You had a figure or table environment or a \\marginpar command in math
+mode or inside a parbox.")
+
+ ("\\\\pushtabs and \\\\poptabs don't match." .
+ "LaTeX found a \\poptabs with no matching \\pushtabs, or has come to the
+\\end{tabbing} command with one or more unmatched \\pushtabs commands.")
+
+ ("Something's wrong--perhaps a missing \\\\item." .
+ "The most probable cause is an omitted \\item command in a list-making
+environment. It is also caused by forgetting the argument of a
+thebibliography environment.")
+
+ ("Tab overflow." .
+ "A \\= command has exceeded the maximum number of tab stops that LaTeX
+permits.")
+
+ ("There's no line here to end." .
+ "A \\newline or \\\\ command appears between paragraphs, where it makes no
+sense. If you're trying to ``leave a blank line'', use a \\vspace
+command.")
+
+ ("This may be a LaTeX bug." .
+ "LaTeX has become thoroughly confused. This is probably due to a
+previously detected error, but it is possible that you have found an
+error in LaTeX itself. If this is the first error message produced by
+the input file and you can't find anything wrong, save the file and
+contact the person listed in your Local Guide.")
+
+ ("Too deeply nested." .
+ "There are too many list-making environments nested within one another.
+How many levels of nesting are permitted may depend upon what computer
+you are using, but at least four levels are provided, which should be
+enough.")
+
+ ("Too many unprocessed floats." .
+ "While this error can result from having too many \\marginpar commands
+on a page, a more likely cause is forcing LaTeX to save more figures
+and tables than it has room for. When typesetting its continuous
+scroll, LaTeX saves figures and tables separately and inserts them as
+it cuts off pages. This error occurs when LaTeX finds too many figure
+and/or table environments before it is time to cut off a page, a
+problem that is solved by moving some of the environments farther
+towards the end of the input file. The error can also be caused by a
+``logjam''---a figure or table that cannot be printed causing others
+to pile up behind it, since LaTeX will not print figures or tables out
+of order. The jam can be started by a figure or table that either is
+too large to fit on a page or won't fit where its optional placement
+argument says it must go. This is likely to happen if the argument
+does not contain a p option.")
+
+ ("Undefined tab position." .
+ "A \\>, \\+, \\-, or \\< command is trying to go to a nonexistent tab
+position---one not defined by a \\= command.")
+
+ ("\\\\< in mid line." .
+ "A \\< command appears in the middle of a line in a tabbing environment.
+This command should come only at the beginning of a line.")
+
+ ("Double subscript." .
+ "There are two subscripts in a row in a mathematical
+formula---something like x_{2}_{3}, which makes no sense.")
+
+ ("Double superscript." .
+ "There are two superscripts in a row in a mathematical
+formula---something like x^{2}^{3}, which makes no sense.")
+
+ ("Extra alignment tab has been changed to \\\\cr." .
+ "There are too many separate items (column entries) in a single row of
+an array or tabular environment. In other words, there were too many &
+'s before the end of the row. You probably forgot the \\\\ at the end of
+the preceding row.")
+
+ ("Extra \\}, or forgotten \\$." .
+ "The braces or math mode delimiters don't match properly. You probably
+forgot a {, \\[, \\(, or $.")
+
+ ("Font [^ ]* not loaded: Not enough room left." .
+ "The document uses more fonts than TeX has room for. If different parts
+of the document use different fonts, then you can get around the
+problem by processing it in parts.")
+
+ ("I can't find file `.*'." .
+ "TeX can't find a file that it needs. If the name of the missing file
+has the extension tex, then it is looking for an input file that you
+specified---either your main file or another file inserted with an
+\\input or \\include command. If the missing file has the extension sty
+, then you have specified a nonexistent document style or style
+option.")
+
+ ("Illegal parameter number in definition of .*" .
+ "This is probably caused by a \\newcommand, \\renewcommand,
+\\newenvironment, or \\renewenvironment command in which a # is used
+incorrectly. A # character, except as part of the command name \\#,
+can be used only to indicate an argument parameter, as in #2, which
+denotes the second argument. This error is also caused by nesting one
+of the above four commands inside another, or by putting a parameter
+like #2 in the last argument of a \\newenvironment or \\renewenvironment
+command.")
+
+ ("Illegal unit of measure ([^ ]* inserted)." .
+ "If you just got a
+
+ ! Missing number, treated as zero.
+
+error, then this is part of the same problem. If not, it means that
+LaTeX was expecting a length as an argument and found a number
+instead. The most common cause of this error is writing 0 instead of
+something like 0in for a length of zero, in which case typing return
+should result in correct output. However, the error can also be caused
+by omitting a command argument.")
+
+ ("Misplaced alignment tab character \\&." .
+ "The special character &, which should be used only to separate items
+in an array or tabular environment, appeared in ordinary text. You
+probably meant to type \\&.")
+
+ ("Missing control sequence inserted." .
+ "This is probably caused by a \\newcommand, \\renewcommand, \\newlength,
+or \\newsavebox command whose first argument is not a command name.")
+
+ ("Missing number, treated as zero." .
+ "This is usually caused by a LaTeX command expecting but not finding
+either a number or a length as an argument. You may have omitted an
+argument, or a square bracket in the text may have been mistaken for
+the beginning of an optional argument. This error is also caused by
+putting \\protect in front of either a length command or a command such
+as \\value that produces a number.")
+
+ ("Missing [{}] inserted." .
+ "TeX has become confused. The position indicated by the error locator
+is probably beyond the point where the incorrect input is.")
+
+ ("Missing \\$ inserted." .
+ "TeX probably found a command that can be used only in math mode when
+it wasn't in math mode. Remember that unless stated otherwise, all
+all the commands of Section 3.3 in LaTeX Book (Lamport) can be used
+only in math mode. TeX is not in math mode when it begins processing
+the argument of a box-making command, even if that command is inside a
+math environment. This error also occurs if TeX encounters a blank
+line when it is in math mode.")
+
+ ("Not a letter." .
+ "Something appears in the argument of a \\hyphenation command that
+doesn't belong there.")
+
+ ("Paragraph ended before [^ ]* was complete." .
+ "A blank line occurred in a command argument that shouldn't contain
+one. You probably forgot the right brace at the end of an argument.")
+
+ ("\\\\[^ ]*font [^ ]* is undefined .*" .
+ "These errors occur when an uncommon font is used in math mode---for
+example, if you use a \\sc command in a formula inside a footnote,
+calling for a footnote-sized small caps font. This problem is solved
+by using a \\load command.")
+
+ ("Font .* not found." .
+ "You requested a family/series/shape/size combination that is totally
+unknown. There are two cases in which this error can occur:
+ 1) You used the \\size macro to select a size that is not available.
+ 2) If you did not do that, go to your local `wizard' and
+ complain fiercely that the font selection tables are corrupted!")
+
+ ("TeX capacity exceeded, sorry .*" .
+ "TeX has just run out of space and aborted its execution. Before you
+panic, remember that the least likely cause of this error is TeX not
+having the capacity to process your document. It was probably an
+error in your input file that caused TeX to run out of room. The
+following discussion explains how to decide whether you've really
+exceeded TeX's capacity and, if so, what to do. If the problem is an
+error in the input, you may have to use the divide and conquer method
+described previously to locate it. LaTeX seldom runs out of space on a
+short input file, so if running it on the last few pages before the
+error indicator's position still produces the error, then there's
+almost certainly something wrong in the input file.
+
+The end of the error indicator tells what kind of space TeX ran out
+of. The more common ones are listed below, with an explanation of
+their probable causes.
+
+buffer size
+===========
+Can be caused by too long a piece of text as the argument
+of a sectioning, \\caption, \\addcontentsline, or \\addtocontents
+command. This error will probably occur when the \\end{document} is
+being processed, but it could happen when a \\tableofcontents,
+\\listoffigures, or \\listoftables command is executed. To solve this
+problem, use a shorter optional argument. Even if you're producing a
+table of contents or a list of figures or tables, such a long entry
+won't help the reader.
+
+exception dictionary
+====================
+You have used \\hyphenation commands to give TeX
+more hyphenation information than it has room for. Remove some of the
+less frequently used words from the \\hyphenation commands and insert
+\\- commands instead.
+
+hash size
+=========
+Your input file defines too many command names and/or uses
+too many cross-ref- erencing labels.
+
+input stack size
+================
+This is probably caused by an error in a command
+definition. For example, the following command makes a circular
+definition, defining \\gnu in terms of itself:
+
+ \\newcommand{\\gnu}{a \\gnu} % This is wrong!
+
+When TeX encounters this \\gnu command, it will keep chasing its tail
+trying to figure out what \\gnu should produce, and eventually run out
+of ``input stack''.
+
+main memory size
+================
+This is one kind of space that TeX can run out of when processing a
+short file. There are three ways you can run TeX out of main memory
+space: (1) defining a lot of very long, complicated commands, (2)
+making an index or glossary and having too many \\index or \\glossary
+commands on a single page, and (3) creating so complicated a page of
+output that TeX can't hold all the information needed to generate it.
+The solution to the first two problems is obvious: define fewer
+commands or use fewer \\index and \\glossary commands. The third problem
+is nastier. It can be caused by large tabbing, tabular, array, and
+picture environments. TeX's space may also be filled up with figures
+and tables waiting for a place to go. To find out if you've really
+exceeded TeX's capacity in this way, put a \\clearpage command in your
+input file right before the place where TeX ran out of room and try
+running it again. If it doesn't run out of room with the \\clearpage
+command there, then you did exceed TeX's capacity. If it still runs
+out of room, then there's probably an error in your file. If TeX is
+really out of room, you must give it some help. Remember that TeX
+processes a complete paragraph before deciding whether to cut the
+page. Inserting a \\newpage command in the middle of the paragraph,
+where TeX should break the page, may save the day by letting TeX write
+the current page before processing the rest of the paragraph. (A
+\\pagebreak command won't help.) If the problem is caused by
+accumulated figures and tables, you can try to prevent them from
+accumulating---either by moving them further towards the end of the
+document or by trying to get them to come out sooner. If you are
+still writing the document, simply add a \\clearpage command and forget
+about the problem until you're ready to produce the final version.
+Changes to the input file are likely to make the problem go away.
+
+pool size
+=========
+You probably used too many cross-ref-erencing \\labels and/or defined
+too many new command names. More precisely, the labels and command
+names that you define have too many characters, so this problem can be
+solved by using shorter names. However, the error can also be caused
+by omitting the right brace that ends the argument of either a counter
+command such as \\setcounter, or a \\newenvironment or \\newtheorem
+command.
+
+save size
+=========
+This occurs when commands, environments, and the scopes of
+declarations are nested too deeply---for example, by having the
+argument of a \\multiput command contain a picture environment that in
+turn has a \\footnotesize declaration whose scope contains a \\multiput
+command containing a ....")
+
+ ("Text line contains an invalid character." .
+ "The input contains some strange character that it shouldn't. A mistake
+when creating the file probably caused your text editor to insert this
+character. Exactly what could have happened depends upon what text
+editor you used. If examining the input file doesn't reveal the
+offending character, consult the Local Guide for suggestions.")
+
+ ("Undefined control sequence." .
+ "TeX encountered an unknown command name. You probably misspelled the
+name. If this message occurs when a LaTeX command is being processed,
+the command is probably in the wrong place---for example, the error
+can be produced by an \\item command that's not inside a list-making
+environment. The error can also be caused by a missing \\documentclass
+command.")
+
+ ("Use of [^ ]* doesn't match its definition." .
+ "It's probably one of the picture-drawing commands, and you have used
+the wrong syntax for specifying an argument. If it's \\@array that
+doesn't match its definition, then there is something wrong in an
+@-expression in the argument of an array or tabular
+environment---perhaps a fragile command that is not \\protect'ed.")
+
+ ("You can't use `macro parameter character \\#' in [^ ]* mode." .
+ "The special character # has appeared in ordinary text. You probably
+meant to type \\#.")
+
+ ("Overfull \\\\hbox .*" .
+ "Because it couldn't find a good place for a line break, TeX put more
+on this line than it should.")
+
+ ("Overfull \\\\vbox .*" .
+ "Because it couldn't find a good place for a page break, TeX put more
+on the page than it should. ")
+
+ ("Underfull \\\\hbox .*" .
+ "Check your output for extra vertical space. If you find some, it was
+probably caused by a problem with a \\\\ or \\newline command---for
+example, two \\\\ commands in succession. This warning can also be
+caused by using the sloppypar environment or \\sloppy declaration, or
+by inserting a \\linebreak command.")
+
+ ("Underfull \\\\vbox .*" .
+ "TeX could not find a good place to break the page, so it produced a
+page without enough text on it. ")
+
+ ;; New list items should be placed here
+ ;;
+ ;; ("err-regexp" . "context")
+ ;;
+ ;; the err-regexp item should match anything
+
+ (".*" . "No help available")) ; end definition
+ "Help messages for errors in LaTeX mode.
+Used as buffer local value of `TeX-error-description-list-local'.
+See its doc string for detail.")
+
;;; Mode
(defgroup LaTeX-macro nil
@@ -6351,6 +6798,8 @@ function would return non-nil and `(match-string 1)'
would return
;; \Ref and \labelformat are part of kernel with LaTeX 2019-10-01:
'("Ref" TeX-arg-ref)
'("labelformat" TeX-arg-counter t)
+ ;; \footref is part of kernel with LaTeX 2021-06-01:
+ '("footref" TeX-arg-ref)
'("newcommand" TeX-arg-define-macro [ TeX-arg-define-macro-arguments ] t)
'("renewcommand" TeX-arg-macro [ TeX-arg-define-macro-arguments ] t)
'("newenvironment" TeX-arg-define-environment
@@ -6820,7 +7269,12 @@ function would return non-nil and `(match-string 1)'
would return
;; Initialization of `add-log-current-defun-function':
(set (make-local-variable 'add-log-current-defun-function)
- #'TeX-current-defun-name))
+ #'TeX-current-defun-name)
+
+ ;; Set LaTeX-specific help messages for error so that it's available
+ ;; in `TeX-help-error'.
+ (setq-local TeX-error-description-list-local
+ LaTeX-error-description-list))
(defun LaTeX-imenu-create-index-function ()
"Imenu support function for LaTeX."
diff --git a/preview.el b/preview.el
index 34bed52..3f708f2 100644
--- a/preview.el
+++ b/preview.el
@@ -999,7 +999,8 @@ The usual PROCESS and COMMAND arguments for
(setq TeX-sentinel-function nil)
;; Add DELAYBIND option for adjustment of foreground
;; color to work.
- (if (eq preview-pdf-color-adjust-method t)
+ (if (and (eq preview-pdf-color-adjust-method t)
+ (aref preview-colors 1))
(setq preview-gs-command-line (append
preview-gs-command-line
'("-dDELAYBIND"))))
diff --git a/style/algorithm.el b/style/algorithm.el
index c493c82..8500f44 100644
--- a/style/algorithm.el
+++ b/style/algorithm.el
@@ -32,10 +32,12 @@
(require 'latex)
(defvar LaTeX-algorithm-package-options
- '("section")
+ '(;; Appearance options:
+ "plain" "ruled" "boxed"
+ ;; Numbering convention:
+ "part" "chapter" "section" "subsection" "subsubsection" "nothing")
"Package options for the algorithm package.")
-
(defun LaTeX-env-algorithm (environment)
"Insert a algorithm-like ENVIRONMENT with caption and label."
(let* ((pos (completing-read (TeX-argument-prompt t nil "Position")
@@ -54,30 +56,25 @@
(when (and short-caption (not (string= short-caption "")))
(insert LaTeX-optop short-caption LaTeX-optcl))
(insert TeX-grop caption)
- ;; ask for a label and insert it
- ; (LaTeX-label environment
'environment)
- ;; the longtable `\caption' is equivalent to a
- ;; `\multicolumn', so it needs a `\\' at the
- ;; end of the line. Prior to that, add } to
- ;; close `\caption{'
- (insert TeX-grcl "")
+ ;; Add } to close `\caption{'
+ (insert TeX-grcl)
;; fill the caption
- (LaTeX-fill-paragraph)
+ (when auto-fill-function (LaTeX-fill-paragraph))
;; Insert a new line and indent
(LaTeX-newline)
- (LaTeX-label environment 'environment)
- (LaTeX-newline)
- (indent-according-to-mode))))
-
+ (indent-according-to-mode)
+ ;; Finally add a \label:
+ (when (LaTeX-label environment 'environment)
+ (LaTeX-newline)
+ (indent-according-to-mode)))))
(TeX-add-style-hook
"algorithm"
(lambda ()
(LaTeX-add-environments
- '("algorithm" LaTeX-env-algorithm ))
+ '("algorithm" LaTeX-env-algorithm))
(TeX-add-symbols
- '("listofalgorithms" 0))
- TeX-dialect))
-
+ '("listofalgorithms" 0)))
+ TeX-dialect)
;;; algorithm.el ends here
diff --git a/style/beamer.el b/style/beamer.el
index 7c80ce8..36f15d7 100644
--- a/style/beamer.el
+++ b/style/beamer.el
@@ -41,7 +41,7 @@
"Do beamer-specific stuff after the insertion of an environment."
;; Add `fragile' as an optional argument to the frame environment if
;; a verbatim environment is inserted.
- (when (and (TeX-member env (LaTeX-verbatim-environments) 'string-equal)
+ (when (and (TeX-member env (LaTeX-verbatim-environments) #'string-equal)
(save-excursion
(goto-char start)
(string-equal (LaTeX-current-environment) "frame")))
@@ -155,8 +155,9 @@
(insert (format "\\frametitle{%s}" title))
;; This works because \frametitle is a
;; paragraph command.
- (backward-char)
- (LaTeX-fill-paragraph))))))
+ (when auto-fill-function
+ (backward-char)
+ (LaTeX-fill-paragraph)))))))
'("onlyenv" (lambda (env &rest ignore)
(LaTeX-insert-environment
env
diff --git a/style/bicaption.el b/style/bicaption.el
index b8d6cb7..245b454 100644
--- a/style/bicaption.el
+++ b/style/bicaption.el
@@ -106,7 +106,7 @@ arguments."
(when (and label-inside (not star))
(LaTeX-label currenv 'environment))
(insert TeX-grcl)
- (LaTeX-fill-paragraph)
+ (when auto-fill-function (LaTeX-fill-paragraph))
(LaTeX-newline)
(indent-according-to-mode)
;; Insert short & regular 2. caption
@@ -131,7 +131,7 @@ arguments."
""))))
(and width (TeX-argument-insert width t))
(and inpos (TeX-argument-insert inpos t))))
- (LaTeX-fill-paragraph)
+ (when auto-fill-function (LaTeX-fill-paragraph))
;; Insert label -- a new line is inserted only if label is there:
(when (and (not label-inside) (not star)
(save-excursion (LaTeX-label currenv 'environment)))
diff --git a/style/brazil.el b/style/brazil.el
new file mode 100644
index 0000000..353e771
--- /dev/null
+++ b/style/brazil.el
@@ -0,0 +1,37 @@
+;;; brazil.el --- Setup AUCTeX for editing Brazilian text. -*-
lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2021-05-02
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Code:
+
+(require 'tex)
+
+(TeX-add-style-hook
+ "brazil"
+ (lambda ()
+ (TeX-run-style-hooks "brazilian"))
+ TeX-dialect)
+
+;;; brazil.el ends here
diff --git a/style/brazilian.el b/style/brazilian.el
new file mode 100644
index 0000000..5124e66
--- /dev/null
+++ b/style/brazilian.el
@@ -0,0 +1,77 @@
+;;; brazilian.el --- Setup AUCTeX for editing Brazilian text. -*-
lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2021-05-02
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; Cater for some specialities of Brazilian and Portuguese languages
+;; provided by babel package, e.g. special quote and hyphen strings or
+;; `"' which is an active character.
+
+;; Thanks to Gustavo Barros <gusbrs.2016@gmail.com> for requesting
+;; this feature and reviewing the code.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-quotes
+ "font-latex"
+ (quotes))
+
+(declare-function font-latex-add-to-syntax-alist
+ "font-latex"
+ (list))
+
+(defvar LaTeX-brazilian-mode-syntax-table
+ (copy-syntax-table LaTeX-mode-syntax-table)
+ "Syntax table used in LaTeX mode when using `brazilian' language.")
+
+(modify-syntax-entry ?\" "w" LaTeX-brazilian-mode-syntax-table)
+
+(TeX-add-style-hook
+ "brazilian"
+ (lambda ()
+ (set-syntax-table LaTeX-brazilian-mode-syntax-table)
+ (unless (eq (car TeX-quote-language) 'override)
+ (setq TeX-quote-language nil))
+ (setq LaTeX-babel-hyphen-language "brazilian")
+ (TeX-add-symbols
+ '("ord" 0)
+ '("ro" 0)
+ '("orda" 0)
+ '("ra" 0))
+ ;; Fontification
+ (when (and (eq TeX-install-font-lock 'font-latex-setup)
+ (featurep 'font-latex))
+ (font-latex-add-quotes '("\"<" "\">" french))
+ ;; Prevent "| from leading to color bleed.
+ (font-latex-add-to-syntax-alist (list (cons ?\" "\\"))))
+ (run-hooks 'TeX-language-pt-br-hook))
+ TeX-dialect)
+
+;;; brazilian.el ends here
diff --git a/style/caption.el b/style/caption.el
index 346b84d..988a9bb 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -287,7 +287,7 @@ caption, insert only a caption."
;; `LaTeX-fill-paragraph' without messing up the code since
;; \caption starts a new paragraph with AUCTeX
;; (cf. `paragraph-start').
- (LaTeX-fill-paragraph))
+ (when auto-fill-function (LaTeX-fill-paragraph)))
(defun LaTeX-arg-caption-captionof (optional &optional star)
"Query for the arguments of \"\\captionof\" macro and insert them.
@@ -311,7 +311,7 @@ STAR is non-nil, do not query for a short-caption and a
label."
(when (and short-caption (not (string= short-caption "")))
(insert LaTeX-optop short-caption LaTeX-optcl))
(TeX-argument-insert caption optional)
- (LaTeX-fill-paragraph)
+ (when auto-fill-function (LaTeX-fill-paragraph))
(when (and (not star)
;; Check if `envtype' is a figure or a table, also
;; consult `LaTeX-label-alist' for additions from user
diff --git a/style/currvita.el b/style/currvita.el
index 03a099a..62aa51f 100644
--- a/style/currvita.el
+++ b/style/currvita.el
@@ -58,7 +58,8 @@
(LaTeX-insert-item)
;; The inserted \item may have outdented the first line to the
;; right. Fill it, if appropriate.
- (when (and (not (looking-at "$"))
+ (when (and auto-fill-function
+ (not (looking-at "$"))
(not (assoc env LaTeX-indent-environment-list))
(> (- (line-end-position) (line-beginning-position))
(current-fill-column)))
diff --git a/style/doc.el b/style/doc.el
index bcdfeef..6818e0a 100644
--- a/style/doc.el
+++ b/style/doc.el
@@ -50,7 +50,7 @@
(defun LaTeX-doc-after-insert-macrocode (env start end)
"Make sure the macrocode environment is properly formatted after insertion."
- (when (TeX-member env '("macro" "macrocode" "macrocode*") 'string-equal)
+ (when (TeX-member env '("macro" "macrocode" "macrocode*") #'string-equal)
(save-excursion
(goto-char end)
(skip-chars-backward " \t")
diff --git a/style/enumitem.el b/style/enumitem.el
index efb8aa3..1a858b1 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -246,7 +246,8 @@ key-val and the first item."
(LaTeX-insert-item)
;; The inserted \item may have outdented the first line to the
;; right. Fill it, if appropriate.
- (when (and (not (looking-at "$"))
+ (when (and auto-fill-function
+ (not (looking-at "$"))
(not (assoc env LaTeX-indent-environment-list))
(> (- (line-end-position) (line-beginning-position))
(current-fill-column)))
diff --git a/style/graphicx.el b/style/graphicx.el
index bb28b9c..bacd734 100644
--- a/style/graphicx.el
+++ b/style/graphicx.el
@@ -185,6 +185,9 @@ extensions to be matched."
Initialized once at the first time you prompt for an input file.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+;; Add the variable to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-includegraphics-global-files)
+
(defun LaTeX-includegraphics-read-file-TeX ()
"Read image file for \\includegraphics.
Offers all graphic files found in the TeX search path. See
diff --git a/style/kpfonts.el b/style/kpfonts.el
index 654378f..8dec44c 100644
--- a/style/kpfonts.el
+++ b/style/kpfonts.el
@@ -508,7 +508,9 @@ argument, the symbols will be surrounded by dollar signs.
The
following commands are defined:
\\{LaTeX-kpfonts-mode-map}"
- nil nil (list (cons (LaTeX-kpfonts-abbrev-prefix) LaTeX-kpfonts-keymap))
+ :init-value nil
+ :lighter nil
+ :keymap (list (cons (LaTeX-kpfonts-abbrev-prefix) LaTeX-kpfonts-keymap))
(TeX-set-mode-name))
(easy-menu-define LaTeX-kpfonts-mode-menu
diff --git a/style/latexinfo.el b/style/latexinfo.el
deleted file mode 100644
index 9eb68ad..0000000
--- a/style/latexinfo.el
+++ /dev/null
@@ -1,183 +0,0 @@
-;;; latexinfo.el - Support for LaTeXinfo files. -*- lexical-binding: t; -*-
-
-;; Copyright (C) 1993-2021 Free Software Foundation, Inc.
-
-;; Author: Marc Gemis <makke@wins.uia.ac.be>
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with AUCTeX; see the file COPYING. If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-;; MA 02110-1301 USA.
-
-;;; Code:
-
-(require 'tex)
-(require 'latex)
-
-;;; LaTeXinfo mode
-
-(defvar TeX-latexinfo-node-regexp
- '("\\\\node[ \t]+\\([^,\n\r%]+\\)" 1 TeX-auto-label)
- "Matches LaTeXinfo \\node commands, only current node will be found.
-We ignore next, previous and up fields.")
-
-(defvar LaTeXinfo-mode nil
- "Non-nil means LaTeXinfo minor mode is active.")
- (make-variable-buffer-local 'LaTeXinfo-mode)
-
-(defvar LaTeXinfo-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-u\C-b" #'latexinfo-format-buffer)
- (define-key map "\C-c\C-u\C-r" #'latexinfo-format-region)
- (define-key map "\C-c\C-u\C-s" #'latexinfo-show-structure)
- (define-key map "\C-c\C-ud" #'makke:latexinfo-delete-structure)
- (define-key map "\C-c\C-ug" #'latexinfo-goto-node)
- (define-key map "\C-c\C-ui" #'makke:latexinfo-structure)
- map)
- "Keymap containing LaTeXinfo commands.")
-
-(or (assq 'LaTeXinfo-mode minor-mode-map-alist)
- (setq minor-mode-map-alist
- (cons (cons 'LaTeXinfo-mode LaTeXinfo-mode-map)
- minor-mode-map-alist)))
-
-(defun TeX-arg-latexinfo-index (optional &optional prompt)
- "Prompt for a LaTeXinfo index type with completion."
- (TeX-argument-insert
- (completing-read (TeX-argument-prompt optional prompt "Index")
- '(("cp") ("vr") ("fn") ("tp") ("pg") ("ky"))
- nil t)
- optional))
-
-(defun LaTeX-item-latexinfo-menu ()
- "Insert a new menu item"
- (insert "* ::")
- (backward-char 2))
-
-(defun latexinfo-goto-node () ; temporarily here, later in latexinfo-upd.el ??
- "Place pointer on the node given by the user, read node with completion
-This fails when the user types in the label of something else"
- (interactive)
- (let ((node-name (completing-read "Goto Node: " (LaTeX-label-list))))
- (goto-char (point-min))
- (if (re-search-forward
- (concat
- TeX-esc "node[ \\t]+" node-name ","
- "\\|"
- TeX-esc "label{" LaTeX-section-label node-name
- "\\|"
- TeX-esc "label{" node-name
- )
- (point-max) t)
- (beginning-of-line 1)
- (error "No such node"))))
-
-;;; Hook
-
-(TeX-add-style-hook "latexinfo"
- (function
- (lambda ()
- (require 'latexinfo)
- (require 'latexinfo-structure)
-
- (require 'min-map)
- (setq LaTeXinfo-mode t)
-
- (TeX-auto-add-regexp TeX-latexinfo-node-regexp)
-
- (TeX-add-symbols
- '("node"
- (TeX-arg-literal " ")
- (TeX-arg-free TeX-arg-define-label "Node name")
- (TeX-arg-literal ", ")
- (TeX-arg-free TeX-arg-ref "Next node")
- (TeX-arg-literal ", ")
- (TeX-arg-free TeX-arg-ref "Previous node")
- (TeX-arg-literal ", ")
- (TeX-arg-free TeX-arg-ref "Up node"))
- '("setfilename" TeX-arg-file)
-
- '("var" t)
- '("dfn" t)
- '("emph" t)
- '("kbd" t)
- '("code" t)
- '("samp" t)
- '("key" t)
- '("ctrl" t)
- '("file" t)
-
- '("comment"
- (TeX-arg-literal " ")
- (TeX-arg-free "Comment"))
- '("c"
- (TeX-arg-literal " ")
- (TeX-arg-free "Comment"))
-
- '("cindex" t)
- '("cpsubindex" 2)
- '("cpindexbold" t)
-
- '("newindex" TeX-arg-latexinfo-index)
-
- '("br" nil)
- '("w" "Text")
- '("dots" nil)
- '("refill" nil)
- '("bullet" nil)
- '("copyright" nil)
- '("sp" nil)
-
- '("xref" TeX-arg-ref)
- '("pxref" TeX-arg-ref)
- '("inforef"
- (TeX-arg-literal "{")
- (TeX-arg-free "Name of node")
- (TeX-arg-literal ", ")
- (TeX-arg-free "Name for note")
- (TeX-arg-literal ", ")
- (TeX-arg-free TeX-arg-file "Info file")
- (TeX-arg-literal "}")))
-
- (LaTeX-add-environments "menu" "tex" "ignore" "ifinfo"
"iftex"
- "example" "same" "display"
"format")
-
- ; Menu's have a special kind of items
- (make-local-variable 'LaTeX-item-list)
- (setq LaTeX-item-list (cons '("menu" .
LaTeX-item-latexinfo-menu)
- LaTeX-item-list))
-
- (make-local-variable 'TeX-font-list)
- (setq TeX-font-list
- (list (list ?\C-b (concat TeX-esc "b{") "}")
- (list ?\C-c (concat TeX-esc "sc{") "}")
- (list ?\C-e (concat TeX-esc "emph{") "}")
- (list ?\C-i (concat TeX-esc "i{") "}")
- (list ?\C-r (concat TeX-esc "r{") "}")
- (list ?\C-s (concat TeX-esc "samp{") "}")
- (list ?\C-t (concat TeX-esc "t{") "}")
- (list ?s (concat TeX-esc "strong{") "}")
- (list ?\C-f (concat TeX-esc "file{") "}")
- (list ?\C-d (concat TeX-esc "dfn{") "}")
- (list ?\C-v (concat TeX-esc "var{") "}")
- (list ?k (concat TeX-esc "key{") "}")
- (list ?\C-k (concat TeX-esc "kbd{") "}")
- (list ?c (concat TeX-esc "code{") "}")
- (list ?C (concat TeX-esc "cite{") "}")))
-
- ;; need the following stuff to let xref and pxref work
- (make-local-variable 'LaTeX-section-label)
- (setq LaTeX-section-label "")))
- TeX-dialect)
-
-;;; latexinfo.el ends here
diff --git a/style/longtable.el b/style/longtable.el
index 4e7ea30..2646e33 100644
--- a/style/longtable.el
+++ b/style/longtable.el
@@ -83,7 +83,7 @@ insert line break macro."
;; close `\caption{'
(insert TeX-grcl "\\\\")
;; fill the caption
- (LaTeX-fill-paragraph)
+ (when auto-fill-function (LaTeX-fill-paragraph))
;; Insert a new line and indent
(LaTeX-newline)
(indent-according-to-mode))
diff --git a/style/moodle.el b/style/moodle.el
index b61310e..ac5f286 100644
--- a/style/moodle.el
+++ b/style/moodle.el
@@ -129,11 +129,12 @@
(newline)
(indent-according-to-mode)
(insert qtext)
- (LaTeX-fill-paragraph)))
+ (when auto-fill-function (LaTeX-fill-paragraph))))
(LaTeX-insert-item)
;; The inserted \item may have outdented the first line to the
;; right. Fill it, if appropriate.
- (when (and (not (looking-at "$"))
+ (when (and auto-fill-function
+ (not (looking-at "$"))
(not (assoc env LaTeX-indent-environment-list))
(> (- (line-end-position) (line-beginning-position))
(current-fill-column)))
diff --git a/style/pdfpages.el b/style/pdfpages.el
index f59096f..2fd44a7 100644
--- a/style/pdfpages.el
+++ b/style/pdfpages.el
@@ -110,7 +110,8 @@
(read-file-name
"File to include: " nil nil nil nil
(lambda (pdfs)
- (string-match "\\.pdf$" pdfs)))
+ (or (file-directory-p pdfs)
+ (string-match "\\.pdf\\'" pdfs))))
(TeX-master-directory))))
(format "%s" pdffile)))))
diff --git a/style/portuges.el b/style/portuges.el
new file mode 100644
index 0000000..7c0cdb1
--- /dev/null
+++ b/style/portuges.el
@@ -0,0 +1,37 @@
+;;; portuges.el --- Setup AUCTeX for editing Portuges text. -*-
lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2021-05-02
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Code:
+
+(require 'tex)
+
+(TeX-add-style-hook
+ "portuges"
+ (lambda ()
+ (TeX-run-style-hooks "portuguese"))
+ TeX-dialect)
+
+;;; portuges.el ends here
diff --git a/style/portuguese.el b/style/portuguese.el
new file mode 100644
index 0000000..1e8b4c8
--- /dev/null
+++ b/style/portuguese.el
@@ -0,0 +1,78 @@
+;;; portuguese.el --- Setup AUCTeX for editing Portuguese text. -*-
lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2021-05-02
+;; Keywords: tex
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING. If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+
+;; Cater for some specialities of Portuguese language provided by
+;; babel package, e.g. special quote and hyphen strings or `"' which
+;; is an active character.
+
+;; Thanks to Gustavo Barros <gusbrs.2016@gmail.com> for requesting
+;; this feature and reviewing the code.
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-quotes
+ "font-latex"
+ (quotes))
+
+(declare-function font-latex-add-to-syntax-alist
+ "font-latex"
+ (list))
+
+(defvar LaTeX-portuguese-mode-syntax-table
+ (copy-syntax-table LaTeX-mode-syntax-table)
+ "Syntax table used in LaTeX mode when using `portuguese' language.")
+
+(modify-syntax-entry ?\" "w" LaTeX-portuguese-mode-syntax-table)
+
+(TeX-add-style-hook
+ "portuguese"
+ (lambda ()
+ (set-syntax-table LaTeX-portuguese-mode-syntax-table)
+ (unless (eq (car TeX-quote-language) 'override)
+ (setq TeX-quote-language
+ `("portuguese" "\"<" "\">" ,TeX-quote-after-quote)))
+ (setq LaTeX-babel-hyphen-language "portuguese")
+ (TeX-add-symbols
+ '("ord" 0)
+ '("ro" 0)
+ '("orda" 0)
+ '("ra" 0))
+ ;; Fontification
+ (when (and (eq TeX-install-font-lock 'font-latex-setup)
+ (featurep 'font-latex))
+ (font-latex-add-quotes '("\"<" "\">" french))
+ ;; Prevent "| from leading to color bleed.
+ (font-latex-add-to-syntax-alist (list (cons ?\" "\\"))))
+ (run-hooks 'TeX-language-pt-hook))
+ TeX-dialect)
+
+;;; portuguese.el ends here
diff --git a/style/subcaption.el b/style/subcaption.el
index 370a5dc..5f3122f 100644
--- a/style/subcaption.el
+++ b/style/subcaption.el
@@ -69,7 +69,7 @@ caption, insert only a caption."
(insert LaTeX-optop short-caption LaTeX-optcl))
(insert TeX-grop caption TeX-grcl)
;; Fill the \subcaption paragraph before inserting the \label:
- (LaTeX-fill-paragraph)
+ (when auto-fill-function (LaTeX-fill-paragraph))
(when (and (not star)
(save-excursion (LaTeX-label currenv 'environment)))
;; Move \label into next line if we have one:
@@ -109,7 +109,7 @@ caption, insert only a caption."
;; Fill the paragraph before inserting {}. We use this function
;; since we add \subcaption to `paragraph-start' in the style hook
;; below.
- (LaTeX-fill-paragraph))
+ (when auto-fill-function (LaTeX-fill-paragraph)))
(TeX-add-style-hook
"subcaption"
diff --git a/style/tcolorboxlib-raster.el b/style/tcolorboxlib-raster.el
index bcb93d0..912f3c2 100644
--- a/style/tcolorboxlib-raster.el
+++ b/style/tcolorboxlib-raster.el
@@ -119,7 +119,8 @@
(LaTeX-insert-item)
;; The inserted \item may have outdented the first line to the
;; right. Fill it, if appropriate.
- (when (and (not (looking-at "$"))
+ (when (and auto-fill-function
+ (not (looking-at "$"))
(not (assoc environment LaTeX-indent-environment-list))
(> (- (line-end-position) (line-beginning-position))
(current-fill-column)))
diff --git a/style/thmtools.el b/style/thmtools.el
index f4be618..d9ccf19 100644
--- a/style/thmtools.el
+++ b/style/thmtools.el
@@ -233,8 +233,8 @@ RefTeX users should customize or add ENVIRONMENT to
nil (\"Theorem\" \"theorem\") nil))"
(let* ((help-form "\
Select the content of the optional argument with a key:
-`h' in order to insert a plain heading,
-`k' in order to insert key=value pairs with completion,
+'h' in order to insert a plain heading,
+'k' in order to insert key=value pairs with completion,
RET in order to leave it empty.")
(choice (read-char-choice
(TeX-argument-prompt
diff --git a/style/xltabular.el b/style/xltabular.el
index 72c46df..09c5a97 100644
--- a/style/xltabular.el
+++ b/style/xltabular.el
@@ -79,7 +79,7 @@ nested curly brace pair nor escaped \"}\".")
;; close `\caption{'
(insert TeX-grcl "\\\\")
;; fill the caption
- (LaTeX-fill-paragraph)
+ (when auto-fill-function (LaTeX-fill-paragraph))
;; Insert a new line and indent
(LaTeX-newline)
(indent-according-to-mode))
diff --git a/tests/latex/font-latex-test.el b/tests/latex/font-latex-test.el
index 744ffdd..d619942 100644
--- a/tests/latex/font-latex-test.el
+++ b/tests/latex/font-latex-test.el
@@ -43,6 +43,23 @@ $a$")
(setq font-latex--updated-region-end (point-max))
(font-latex-match-dollar-math (point-max))))))
+(ert-deftest font-latex-unclosed-dollars ()
+ "Test unclosed dollar doesn't cause error."
+ (let ((TeX-install-font-lock #'font-latex-setup))
+ (with-temp-buffer
+ (LaTeX-mode)
+
+ (insert "a$")
+ (goto-char (point-min))
+ (setq font-latex--updated-region-end (point-max))
+ (should (not (font-latex-match-dollar-math (point-max))))
+
+ (erase-buffer)
+ (insert "a$$")
+ (goto-char (point-min))
+ (setq font-latex--updated-region-end (point-max))
+ (should (not (font-latex-match-dollar-math (point-max)))))))
+
(ert-deftest font-latex-extend-region-backwards-quotation ()
"Test f-l-e-r-b-q doesn't extend region too eagerly."
(with-temp-buffer
diff --git a/tex-buf.el b/tex-buf.el
index 114ceac..0f3bf18 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -919,7 +919,7 @@ QUEUE is non-nil when we are checking for the printer
queue."
"Check STYLES compared to the current style options."
(let ((files (TeX-style-list)))
(while (and styles
- (not (TeX-member (car (car styles)) files 'string-match)))
+ (not (TeX-member (car (car styles)) files #'string-match)))
(setq styles (cdr styles))))
(if styles
(nth 1 (car styles))
@@ -1124,42 +1124,28 @@ Return the new process."
lst nil)
(setq lst (cdr lst))))))
-(defun TeX-run-format (name command file)
- "Create a process for NAME using COMMAND to format FILE with TeX."
- (TeX-run-set-command name command)
- (let ((buffer (TeX-process-buffer-name file))
- (process (TeX-run-command name command file)))
- ;; Hook to TeX debugger.
- (with-current-buffer buffer
- (TeX-parse-reset)
- (setq TeX-parse-function #'TeX-parse-TeX)
- (setq TeX-sentinel-function #'TeX-TeX-sentinel)
- (if TeX-process-asynchronous
- (progn
- ;; Updating the mode line.
- (setq TeX-current-page "[0]")
- (TeX-format-mode-line process)
- (set-process-filter process #'TeX-format-filter)))
- process)))
-
(defvar TeX-error-report-switches nil
"Reports presence of errors after `TeX-run-TeX'.
+Actually, `TeX-run-format' sets it.
To test whether the current buffer has a compile error from last
-run of `TeX-run-TeX', use
+run of `TeX-run-format', use
(TeX-error-report-has-errors-p)")
(defun TeX-error-report-has-errors-p ()
"Return non-nil if current buffer has compile errors from last TeX run."
(plist-get TeX-error-report-switches (intern (TeX-master-file))))
-(defun TeX-run-TeX (name command file)
+(defun TeX-run-format (name command file)
"Create a process for NAME using COMMAND to format FILE with TeX."
-
- ;; Save information in TeX-error-report-switches
- ;; Initialize error to nil (no error) for current master.
- ;; Presence of error is reported inside `TeX-TeX-sentinel-check'
+ (TeX-run-set-command name command)
(let ((current-master (TeX-master-file))
- (idx-file nil) (element nil))
+ (buffer (TeX-process-buffer-name file))
+ (process (TeX-run-command name command file)))
+
+ ;; Save information in TeX-error-report-switches
+ ;; Initialize error to nil (no error) for current master.
+ ;; Presence of error is reported inside `TeX-TeX-sentinel-check'
+
;; the current master file is saved because error routines are
;; parsed in other buffers;
(setq TeX-error-report-switches
@@ -1170,6 +1156,23 @@ run of `TeX-run-TeX', use
(plist-put TeX-error-report-switches
(intern current-master) nil))
+ ;; Hook to TeX debugger.
+ (with-current-buffer buffer
+ (TeX-parse-reset)
+ (setq TeX-parse-function #'TeX-parse-TeX)
+ (setq TeX-sentinel-function #'TeX-TeX-sentinel)
+ (if TeX-process-asynchronous
+ (progn
+ ;; Updating the mode line.
+ (setq TeX-current-page "[0]")
+ (TeX-format-mode-line process)
+ (set-process-filter process #'TeX-format-filter)))
+ process)))
+
+(defun TeX-run-TeX (name command file)
+ "Create a process for NAME using COMMAND to format FILE with TeX."
+
+ (let ((idx-file nil) (element nil))
;; Store md5 hash of the index file before running LaTeX.
(and (memq major-mode '(doctex-mode latex-mode))
(prog1 (file-exists-p
@@ -1182,7 +1185,7 @@ run of `TeX-run-TeX', use
(while (setq element (assoc idx-file LaTeX-idx-md5-alist))
(setq LaTeX-idx-md5-alist (delq element LaTeX-idx-md5-alist))))
(with-temp-buffer
- (insert-file-contents idx-file)
+ (insert-file-contents-literally idx-file)
(push (cons idx-file (md5 (current-buffer))) LaTeX-idx-md5-alist))))
;; can we assume that TeX-sentinel-function will not be changed
@@ -1462,7 +1465,7 @@ reasons. Use `TeX-run-function' instead."
(defvar TeX-sentinel-function (lambda (_process _name) nil)
- "Hook to cleanup TeX command buffer after temination of PROCESS.
+ "Hook to cleanup TeX command buffer after termination of PROCESS.
NAME is the name of the process.")
(make-variable-buffer-local 'TeX-sentinel-function)
@@ -1470,7 +1473,7 @@ NAME is the name of the process.")
(defvar TeX-sentinel-default-function (lambda (_process _name) nil)
"Default for `TeX-sentinel-function'. To be set in major mode.
-Hook to cleanup TeX command buffer after temination of PROCESS.
+Hook to cleanup TeX command buffer after termination of PROCESS.
NAME is the name of the process.")
(make-variable-buffer-local 'TeX-sentinel-default-function)
@@ -1716,7 +1719,7 @@ Rerun to get mark in right position\\." nil t)
(list (file-name-nondirectory
(TeX-active-master))))
'("idx"))
(with-temp-buffer
- (insert-file-contents idx-file)
+ (insert-file-contents-literally idx-file)
(not (equal
;; Compare old md5 hash of the idx file with the new one.
(cdr (assoc idx-file LaTeX-idx-md5-alist))
@@ -2947,424 +2950,32 @@ warning."
;;; Error Messages
-(defcustom TeX-error-description-list
- '(("\\(?:Package Preview Error\\|Preview\\):.*" .
- "The `auctex' option to `preview' should not be applied manually.
-If you see this error message outside of a preview run, either
-you did something too clever, or AUCTeX something too stupid.")
-
- ("Bad \\\\line or \\\\vector argument.*" .
- "The first argument of a \\line or \\vector command, which specifies the
-slope, is illegal\.")
-
- ("Bad math environment delimiter.*" .
- "TeX has found either a math-mode-starting command such as \\[ or \\(
-when it is already in math mode, or else a math-mode-ending command
-such as \\) or \\] while in LR or paragraph mode. The problem is caused
-by either unmatched math mode delimiters or unbalanced braces\.")
-
- ("Bad use of \\\\\\\\.*" .
- "A \\\\ command appears between paragraphs, where it makes no sense. This
-error message occurs when the \\\\ is used in a centering or flushing
-environment or else in the scope of a centering or flushing
-declaration.")
-
- ("\\\\begin{[^ ]*} ended by \\\\end{[^ ]*}." .
- "LaTeX has found an \\end command that doesn't match the corresponding
-\\begin command. You probably misspelled the environment name in the
-\\end command, have an extra \\begin, or else forgot an \\end.")
-
- ("Can be used only in preamble." .
- "LaTeX has encountered, after the \\begin{document}, one of the
-following commands that should appear only in the preamble:
-\\documentclass, \\nofiles, \\includeonly, \\makeindex, or
-\\makeglossary. The error is also caused by an extra \\begin{document}
-command.")
-
- ("Command name [^ ]* already used.*" .
- "You are using \\newcommand, \\newenvironment, \\newlength, \\newsavebox,
-or \\newtheorem to define a command or environment name that is
-already defined, or \\newcounter to define a counter that already
-exists. (Defining an environment named gnu automatically defines the
-command \\gnu.) You'll have to choose a new name or, in the case of
-\\newcommand or \\newenvironment, switch to the \\renew ... command.")
-
- ("Counter too large." .
- "1. Some object that is numbered with letters, probably an item in a
-enumerated list, has received a number greater than 26. Either you're
-making a very long list or you've been resetting counter values.
-
-2. Footnotes are being ``numbered'' with letters or footnote symbols
-and LaTeX has run out of letters or symbols. This is probably caused
-by too many \\thanks commands.")
-
- ("Environment [^ ]* undefined." .
- "LaTeX has encountered a \\begin command for a nonexistent environment.
-You probably misspelled the environment name. ")
-
- ("Float(s) lost." .
- "You put a figure or table environment or a \\marginpar command inside a
-parbox---either one made with a minipage environment or \\parbox
-command, or one constructed by LaTeX in making a footnote, figure,
-etc. This is an outputting error, and the offending environment or
-command may be quite a way back from the point where LaTeX discovered
-the problem. One or more figures, tables, and/or marginal notes have
-been lost, but not necessarily the one that caused the error.")
-
- ("Illegal character in array arg." .
- "There is an illegal character in the argument of an array or tabular
-environment, or in the second argument of a \\multicolumn command.")
-
- ("Missing \\\\begin{document}." .
- "LaTeX produced printed output before encountering a \\begin{document}
-command. Either you forgot the \\begin{document} command or there is
-something wrong in the preamble. The problem may be a stray character
-or an error in a declaration---for example, omitting the braces around
-an argument or forgetting the \\ in a command name.")
-
- ("Missing p-arg in array arg.*" .
- "There is a p that is not followed by an expression in braces in the
-argument of an array or tabular environment, or in the second argument
-of a \\multicolumn command.")
-
- ("Missing @-exp in array arg." .
- "There is an @ character not followed by an @-expression in the
-argument of an array or tabular environment, or in the second argument
-of a \\multicolumn command.")
-
- ("No such counter." .
- "You have specified a nonexistent counter in a \\setcounter or
-\\addtocounter command. This is probably caused by a simple typing
-error. However, if the error occurred while a file with the extension
-aux is being read, then you probably used a \\newcounter command
-outside the preamble.")
-
- ("Not in outer par mode." .
- "You had a figure or table environment or a \\marginpar command in math
-mode or inside a parbox.")
-
- ("\\\\pushtabs and \\\\poptabs don't match." .
- "LaTeX found a \\poptabs with no matching \\pushtabs, or has come to the
-\\end{tabbing} command with one or more unmatched \\pushtabs commands.")
-
- ("Something's wrong--perhaps a missing \\\\item." .
- "The most probable cause is an omitted \\item command in a list-making
-environment. It is also caused by forgetting the argument of a
-thebibliography environment.")
-
- ("Tab overflow." .
- "A \\= command has exceeded the maximum number of tab stops that LaTeX
-permits.")
-
- ("There's no line here to end." .
- "A \\newline or \\\\ command appears between paragraphs, where it makes no
-sense. If you're trying to ``leave a blank line'', use a \\vspace
-command.")
-
- ("This may be a LaTeX bug." .
- "LaTeX has become thoroughly confused. This is probably due to a
-previously detected error, but it is possible that you have found an
-error in LaTeX itself. If this is the first error message produced by
-the input file and you can't find anything wrong, save the file and
-contact the person listed in your Local Guide.")
-
- ("Too deeply nested." .
- "There are too many list-making environments nested within one another.
-How many levels of nesting are permitted may depend upon what computer
-you are using, but at least four levels are provided, which should be
-enough.")
-
- ("Too many unprocessed floats." .
- "While this error can result from having too many \\marginpar commands
-on a page, a more likely cause is forcing LaTeX to save more figures
-and tables than it has room for. When typesetting its continuous
-scroll, LaTeX saves figures and tables separately and inserts them as
-it cuts off pages. This error occurs when LaTeX finds too many figure
-and/or table environments before it is time to cut off a page, a
-problem that is solved by moving some of the environments farther
-towards the end of the input file. The error can also be caused by a
-``logjam''---a figure or table that cannot be printed causing others
-to pile up behind it, since LaTeX will not print figures or tables out
-of order. The jam can be started by a figure or table that either is
-too large to fit on a page or won't fit where its optional placement
-argument says it must go. This is likely to happen if the argument
-does not contain a p option.")
-
- ("Undefined tab position." .
- "A \\>, \\+, \\-, or \\< command is trying to go to a nonexistent tab
-position---one not defined by a \\= command.")
-
- ("\\\\< in mid line." .
- "A \\< command appears in the middle of a line in a tabbing environment.
-This command should come only at the beginning of a line.")
-
- ("Double subscript." .
- "There are two subscripts in a row in a mathematical
-formula---something like x_{2}_{3}, which makes no sense.")
-
- ("Double superscript." .
- "There are two superscripts in a row in a mathematical
-formula---something like x^{2}^{3}, which makes no sense.")
-
- ("Extra alignment tab has been changed to \\\\cr." .
- "There are too many separate items (column entries) in a single row of
-an array or tabular environment. In other words, there were too many &
-'s before the end of the row. You probably forgot the \\\\ at the end of
-the preceding row.")
-
- ("Extra \\}, or forgotten \\$." .
- "The braces or math mode delimiters don't match properly. You probably
-forgot a {, \\[, \\(, or $.")
-
- ("Font [^ ]* not loaded: Not enough room left." .
- "The document uses more fonts than TeX has room for. If different parts
-of the document use different fonts, then you can get around the
-problem by processing it in parts.")
-
- ("I can't find file `.*'." .
- "TeX can't find a file that it needs. If the name of the missing file
-has the extension tex, then it is looking for an input file that you
-specified---either your main file or another file inserted with an
-\\input or \\include command. If the missing file has the extension sty
-, then you have specified a nonexistent document style or style
-option.")
-
- ("Illegal parameter number in definition of .*" .
- "This is probably caused by a \\newcommand, \\renewcommand,
-\\newenvironment, or \\renewenvironment command in which a # is used
-incorrectly. A # character, except as part of the command name \\#,
-can be used only to indicate an argument parameter, as in #2, which
-denotes the second argument. This error is also caused by nesting one
-of the above four commands inside another, or by putting a parameter
-like #2 in the last argument of a \\newenvironment or \\renewenvironment
-command.")
-
- ("Illegal unit of measure ([^ ]* inserted)." .
- "If you just got a
-
- ! Missing number, treated as zero.
-
-error, then this is part of the same problem. If not, it means that
-LaTeX was expecting a length as an argument and found a number
-instead. The most common cause of this error is writing 0 instead of
-something like 0in for a length of zero, in which case typing return
-should result in correct output. However, the error can also be caused
-by omitting a command argument.")
-
- ("Misplaced alignment tab character \\&." .
- "The special character &, which should be used only to separate items
-in an array or tabular environment, appeared in ordinary text. You
-probably meant to type \\&.")
-
- ("Missing control sequence inserted." .
- "This is probably caused by a \\newcommand, \\renewcommand, \\newlength,
-or \\newsavebox command whose first argument is not a command name.")
-
- ("Missing number, treated as zero." .
- "This is usually caused by a LaTeX command expecting but not finding
-either a number or a length as an argument. You may have omitted an
-argument, or a square bracket in the text may have been mistaken for
-the beginning of an optional argument. This error is also caused by
-putting \\protect in front of either a length command or a command such
-as \\value that produces a number.")
-
- ("Missing [{}] inserted." .
- "TeX has become confused. The position indicated by the error locator
-is probably beyond the point where the incorrect input is.")
-
- ("Missing \\$ inserted." .
- "TeX probably found a command that can be used only in math mode when
-it wasn't in math mode. Remember that unless stated otherwise, all
-all the commands of Section 3.3 in LaTeX Book (Lamport) can be used
-only in math mode. TeX is not in math mode when it begins processing
-the argument of a box-making command, even if that command is inside a
-math environment. This error also occurs if TeX encounters a blank
-line when it is in math mode.")
-
- ("Not a letter." .
- "Something appears in the argument of a \\hyphenation command that
-doesn't belong there.")
-
- ("Paragraph ended before [^ ]* was complete." .
- "A blank line occurred in a command argument that shouldn't contain
-one. You probably forgot the right brace at the end of an argument.")
-
- ("\\\\[^ ]*font [^ ]* is undefined .*" .
- "These errors occur when an uncommon font is used in math mode---for
-example, if you use a \\sc command in a formula inside a footnote,
-calling for a footnote-sized small caps font. This problem is solved
-by using a \\load command.")
-
- ("Font .* not found." .
- "You requested a family/series/shape/size combination that is totally
-unknown. There are two cases in which this error can occur:
- 1) You used the \\size macro to select a size that is not available.
- 2) If you did not do that, go to your local `wizard' and
- complain fiercely that the font selection tables are corrupted!")
-
- ("TeX capacity exceeded, sorry .*" .
- "TeX has just run out of space and aborted its execution. Before you
-panic, remember that the least likely cause of this error is TeX not
-having the capacity to process your document. It was probably an
-error in your input file that caused TeX to run out of room. The
-following discussion explains how to decide whether you've really
-exceeded TeX's capacity and, if so, what to do. If the problem is an
-error in the input, you may have to use the divide and conquer method
-described previously to locate it. LaTeX seldom runs out of space on a
-short input file, so if running it on the last few pages before the
-error indicator's position still produces the error, then there's
-almost certainly something wrong in the input file.
-
-The end of the error indicator tells what kind of space TeX ran out
-of. The more common ones are listed below, with an explanation of
-their probable causes.
-
-buffer size
-===========
-Can be caused by too long a piece of text as the argument
-of a sectioning, \\caption, \\addcontentsline, or \\addtocontents
-command. This error will probably occur when the \\end{document} is
-being processed, but it could happen when a \\tableofcontents,
-\\listoffigures, or \\listoftables command is executed. To solve this
-problem, use a shorter optional argument. Even if you're producing a
-table of contents or a list of figures or tables, such a long entry
-won't help the reader.
-
-exception dictionary
-====================
-You have used \\hyphenation commands to give TeX
-more hyphenation information than it has room for. Remove some of the
-less frequently used words from the \\hyphenation commands and insert
-\\- commands instead.
-
-hash size
-=========
-Your input file defines too many command names and/or uses
-too many cross-ref- erencing labels.
-
-input stack size
-================
-This is probably caused by an error in a command
-definition. For example, the following command makes a circular
-definition, defining \\gnu in terms of itself:
-
- \\newcommand{\\gnu}{a \\gnu} % This is wrong!
-
-When TeX encounters this \\gnu command, it will keep chasing its tail
-trying to figure out what \\gnu should produce, and eventually run out
-of ``input stack''.
-
-main memory size
-================
-This is one kind of space that TeX can run out of when processing a
-short file. There are three ways you can run TeX out of main memory
-space: (1) defining a lot of very long, complicated commands, (2)
-making an index or glossary and having too many \\index or \\glossary
-commands on a single page, and (3) creating so complicated a page of
-output that TeX can't hold all the information needed to generate it.
-The solution to the first two problems is obvious: define fewer
-commands or use fewer \\index and \\glossary commands. The third problem
-is nastier. It can be caused by large tabbing, tabular, array, and
-picture environments. TeX's space may also be filled up with figures
-and tables waiting for a place to go. To find out if you've really
-exceeded TeX's capacity in this way, put a \\clearpage command in your
-input file right before the place where TeX ran out of room and try
-running it again. If it doesn't run out of room with the \\clearpage
-command there, then you did exceed TeX's capacity. If it still runs
-out of room, then there's probably an error in your file. If TeX is
-really out of room, you must give it some help. Remember that TeX
-processes a complete paragraph before deciding whether to cut the
-page. Inserting a \\newpage command in the middle of the paragraph,
-where TeX should break the page, may save the day by letting TeX write
-the current page before processing the rest of the paragraph. (A
-\\pagebreak command won't help.) If the problem is caused by
-accumulated figures and tables, you can try to prevent them from
-accumulating---either by moving them further towards the end of the
-document or by trying to get them to come out sooner. If you are
-still writing the document, simply add a \\clearpage command and forget
-about the problem until you're ready to produce the final version.
-Changes to the input file are likely to make the problem go away.
-
-pool size
-=========
-You probably used too many cross-ref-erencing \\labels and/or defined
-too many new command names. More precisely, the labels and command
-names that you define have too many characters, so this problem can be
-solved by using shorter names. However, the error can also be caused
-by omitting the right brace that ends the argument of either a counter
-command such as \\setcounter, or a \\newenvironment or \\newtheorem
-command.
-
-save size
-=========
-This occurs when commands, environments, and the scopes of
-declarations are nested too deeply---for example, by having the
-argument of a \\multiput command contain a picture environment that in
-turn has a \\footnotesize declaration whose scope contains a \\multiput
-command containing a ....")
-
- ("Text line contains an invalid character." .
- "The input contains some strange character that it shouldn't. A mistake
-when creating the file probably caused your text editor to insert this
-character. Exactly what could have happened depends upon what text
-editor you used. If examining the input file doesn't reveal the
-offending character, consult the Local Guide for suggestions.")
-
- ("Undefined control sequence." .
- "TeX encountered an unknown command name. You probably misspelled the
-name. If this message occurs when a LaTeX command is being processed,
-the command is probably in the wrong place---for example, the error
-can be produced by an \\item command that's not inside a list-making
-environment. The error can also be caused by a missing \\documentclass
-command.")
-
- ("Use of [^ ]* doesn't match its definition." .
- "It's probably one of the picture-drawing commands, and you have used
-the wrong syntax for specifying an argument. If it's \\@array that
-doesn't match its definition, then there is something wrong in an
-@-expression in the argument of an array or tabular
-environment---perhaps a fragile command that is not \\protect'ed.")
-
- ("You can't use `macro parameter character \\#' in [^ ]* mode." .
- "The special character # has appeared in ordinary text. You probably
-meant to type \\#.")
-
- ("Overfull \\\\hbox .*" .
- "Because it couldn't find a good place for a line break, TeX put more
-on this line than it should.")
-
- ("Overfull \\\\vbox .*" .
- "Because it couldn't find a good place for a page break, TeX put more
-on the page than it should. ")
-
- ("Underfull \\\\hbox .*" .
- "Check your output for extra vertical space. If you find some, it was
-probably caused by a problem with a \\\\ or \\newline command---for
-example, two \\\\ commands in succession. This warning can also be
-caused by using the sloppypar environment or \\sloppy declaration, or
-by inserting a \\linebreak command.")
-
- ("Underfull \\\\vbox .*" .
- "TeX could not find a good place to break the page, so it produced a
-page without enough text on it. ")
-
- ;; New list items should be placed here
- ;;
- ;; ("err-regexp" . "context")
- ;;
- ;; the err-regexp item should match anything
-
- (".*" . "No help available")) ; end definition
- "A list of the form (\"err-regexp\" . \"context\") used by function
-`TeX-help-error' to display help-text on an error message or warning.
-err-regexp should be a regular expression matching the error message
-given from TeX/LaTeX, and context should be some lines describing that
-error."
+(defcustom TeX-error-description-list nil
+ "User defined help messages for errors in TeX run.
+See `TeX-error-description-list-local' for its format. All
+entries have higher priority than those in
+`TeX-error-description-list-local'.
+It must not have a fallback entry that matches any error."
:group 'TeX-output
:type '(repeat (cons :tag "Entry"
(regexp :tag "Match")
(string :format "Description:\n%v"))))
+(defvar TeX-error-description-list-local
+ '((".*" . "No help available"))
+ "Buffer local help messages for errors in TeX run.
+A list of the form (ERR-REGEXP . CONTEXT) used by function
+`TeX-help-error' to display help-text on an error message or warning.
+ERR-REGEXP should be a regular expression matching the error message
+given from TeX/LaTeX, and CONTEXT should be some lines describing that
+error.
+Major modes of AUCTeX can set its own catalogue as buffer local
+value of this variable, as LaTeX mode does.
+Style files of AUCTeX can also add their own entries to buffer local
+value of this variable to provide their own help messages.
+It must end with a fallback entry that matches any error, e.g.
+\(\".*\" . \"No help available\")")
+
;;; - Help
(defgroup TeX-error-description-faces nil
@@ -3422,11 +3033,17 @@ a bad box."
(log-file (with-current-buffer runbuffer
(with-current-buffer TeX-command-buffer
(expand-file-name (TeX-active-master "log")))))
+ (error-description-list
+ (append TeX-error-description-list
+ (buffer-local-value 'TeX-error-description-list-local
+ (buffer-local-value
+ 'TeX-command-buffer
+ runbuffer))))
(TeX-error-pointer 0))
;; Find help text entry.
(while (not (string-match (car (nth TeX-error-pointer
- TeX-error-description-list))
+ error-description-list))
error))
(setq TeX-error-pointer (+ TeX-error-pointer 1)))
@@ -3448,10 +3065,10 @@ a bad box."
(propertize "\n--- HELP ---\n" 'font-lock-face
'TeX-error-description-help)
(let ((help (cdr (nth TeX-error-pointer
- TeX-error-description-list))))
+ error-description-list))))
(save-excursion
(if (and (= (1+ TeX-error-pointer)
- (length TeX-error-description-list))
+ (length error-description-list))
(let* ((log-buffer (find-buffer-visiting log-file)))
(if log-buffer
(progn
@@ -3613,7 +3230,7 @@ errors. If nil, defaults to
`TeX-error-overview-active-buffer'."
'face 'link
'follow-link t
'id id
- 'action 'TeX-error-overview-goto-source)))
+ 'action #'TeX-error-overview-goto-source)))
entries))
;; Increase the `id' counter in any case.
(setq id (1+ id)))
diff --git a/tex-fold.el b/tex-fold.el
index ba7e9c0..9eab077 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -897,7 +897,9 @@ the other elements. The ordering among elements is
maintained."
Called interactively, with no prefix argument, toggle the mode.
With universal prefix ARG (or if ARG is nil) turn mode on.
With zero or negative ARG turn mode off."
- nil nil (list (cons TeX-fold-command-prefix TeX-fold-keymap))
+ :init-value nil
+ :lighter nil
+ :keymap (list (cons TeX-fold-command-prefix TeX-fold-keymap))
(if TeX-fold-mode
(progn
(set (make-local-variable 'search-invisible) t)
diff --git a/tex-info.el b/tex-info.el
index 57e14c3..ea6cab0 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -31,6 +31,10 @@
(require 'texinfo)
+;; Silence the compiler for Emacs compiled `--with-native-compilation':
+(declare-function TeX-TeX-sentinel "tex-buf"
+ (process name))
+
;;; Environments:
(defvar Texinfo-environment-list
'(("cartouche") ("command") ("copying") ("defcv") ("deffn") ("defivar")
@@ -656,9 +660,9 @@ value of `Texinfo-mode-hook'."
(set (make-local-variable 'require-final-newline) t)
(set (make-local-variable 'indent-tabs-mode) nil)
(set (make-local-variable 'paragraph-separate)
- (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
+ (concat "@[a-zA-Z]*[ \n]\\|" paragraph-separate))
(set (make-local-variable 'paragraph-start)
- (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
+ (concat "@[a-zA-Z]*[ \n]\\|" paragraph-start))
(set (make-local-variable 'fill-column) 72)
(set (make-local-variable 'comment-start) "@c ")
(set (make-local-variable 'comment-start-skip) "@c +\\|@comment +")
diff --git a/tex-jp.el b/tex-jp.el
index 9980815..562f2c9 100644
--- a/tex-jp.el
+++ b/tex-jp.el
@@ -538,7 +538,7 @@ overwrite the value already set locally."
;;; Error Messages
(if japanese-TeX-error-messages
- (setq TeX-error-description-list
+ (setq LaTeX-error-description-list
'(("\\(?:Package Preview Error\\|Preview\\):.*" .
"`preview'へ`auctex'オプションを直接与えるのは避けてください.
プレビューの実行時以外でこのエラーが出た場合,余りにこみいったことを
diff --git a/tex.el b/tex.el
index 06f0686..d964940 100644
--- a/tex.el
+++ b/tex.el
@@ -80,15 +80,9 @@
(defvar TeX-synctex-tex-flags)
;; Variables defined in other AUCTeX libraries:
;; latex.el:
-(defvar BibLaTeX-global-style-files)
-(defvar BibTeX-global-files)
-(defvar BibTeX-global-style-files)
(defvar LaTeX-default-verb-delimiter)
-(defvar LaTeX-global-class-files)
(defvar LaTeX-optcl)
(defvar LaTeX-optop)
-(defvar TeX-Biber-global-files)
-(defvar TeX-global-input-files)
(defvar TeX-output-dir)
;; tex-buf.el
(defvar TeX-current-process-region-p)
@@ -96,8 +90,6 @@
(defvar TeX-region-orig-buffer)
;; tex-ispell.el
(defvar TeX-ispell-verb-delimiters)
-;; graphicx.el
-(defvar LaTeX-includegraphics-global-files)
;; Others:
(defvar tex--prettify-symbols-alist) ; tex-mode.el
(defvar Info-file-list-for-emacs) ; info.el
@@ -228,8 +220,7 @@ If nil, none is specified."
:help "Convert PostScript file to PDF")
("Glossaries" "makeglossaries %(O?aux)" TeX-run-command nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode)
- :help "Run makeglossaries to create glossary
- file")
+ :help "Run makeglossaries to create glossary file")
("Index" "makeindex %(O?idx)" TeX-run-index nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode)
:help "Run makeindex to create index file")
@@ -1454,7 +1445,7 @@ are evaluated positively is chosen."
(defun TeX-match-style (regexp)
"Check if a style matching REGEXP is active."
- (TeX-member regexp (TeX-style-list) 'string-match))
+ (TeX-member regexp (TeX-style-list) #'string-match))
(defun TeX-view-match-predicate (predicate)
"Check if PREDICATE is true.
@@ -1610,7 +1601,7 @@ For available TYPEs, see variable `TeX-engine'."
(define-minor-mode TeX-Omega-mode
"Minor mode for using the Omega engine."
- nil nil nil
+ :init-value nil :lighter nil :keymap nil
:group 'TeX-command
(TeX-engine-set (if TeX-Omega-mode 'omega 'default)))
(defalias 'tex-omega-mode #'TeX-Omega-mode)
@@ -2132,7 +2123,7 @@ for backward compatibility."
(define-minor-mode TeX-interactive-mode
"Minor mode for interactive runs of TeX."
- nil nil nil
+ :init-value nil :lighter nil :keymap nil
:group 'TeX-command
(TeX-set-mode-name 'TeX-interactive-mode t t))
(defalias 'tex-interactive-mode #'TeX-interactive-mode)
@@ -2497,11 +2488,7 @@ Get `major-mode' from master file and enable it."
(defun TeX-local-master-p ()
"Return non-nil if there is a `TeX-master' entry in local variables spec.
Return nil otherwise."
- (save-excursion
- ;; XXX: Checking -*- line necessary as well?
- (goto-char (point-max))
- (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move)
- (re-search-forward "^%+ *TeX-master:" nil t)))
+ (assq 'TeX-master file-local-variables-alist))
;;; Style Paths
@@ -2986,7 +2973,7 @@ See variable `TeX-style-hook-dialect' for supported
dialects."
"Run the TeX style hooks STYLES."
(mapcar (lambda (style)
;; Avoid recursion.
- (unless (TeX-member style TeX-active-styles 'string-equal)
+ (unless (TeX-member style TeX-active-styles #'string-equal)
(setq TeX-active-styles
(cons style TeX-active-styles))
(TeX-load-style style)
@@ -3093,7 +3080,7 @@ FORCE is not nil."
:prefix "TeX-"
:group 'AUCTeX)
-(defcustom TeX-complete-word 'ispell-complete-word
+(defcustom TeX-complete-word #'ispell-complete-word
"Function to call for completing non-macros in `tex-mode'."
:type 'function
:group 'TeX-macro)
@@ -3116,7 +3103,7 @@ Possible values are nil, t, or a list of style names.
(upcase-plural (upcase plural)))
`(progn
(defvar ,(intern (format "%s-expert-%s-table" prefix thing))
- (make-hash-table :test 'equal)
+ (make-hash-table :test #'equal)
,(format "A hash-table mapping %s names to the style name providing
it.
A %s occuring in this table is considered an expert %s and
@@ -3336,7 +3323,7 @@ is called with \\[universal-argument]."
AUCTeX knows of some macros, and may query for extra arguments.
Space will complete and exit."
(interactive)
- (cond ((eq (preceding-char) ?\\)
+ (cond ((eq (preceding-char) last-command-event)
(call-interactively #'self-insert-command))
((eq (preceding-char) ?.)
(let ((TeX-default-macro " ")
@@ -3646,7 +3633,7 @@ Each entry is a list with three elements.
When entering `tex-mode', each regexp is tried in turn in order to find
the major mode to be used.")
-(defcustom TeX-default-mode 'latex-mode
+(defcustom TeX-default-mode #'latex-mode
"Mode to enter for a new file when it can't be determined otherwise."
:group 'TeX-misc
:type '(radio (function-item latex-mode)
@@ -4307,7 +4294,7 @@ you should not use something like `[\\(]' for a character
range."
(cdr (or (assq symbol syms)
(car (push
(cons symbol
- (make-hash-table :test 'equal))
+ (make-hash-table :test #'equal))
syms)))))))))
(setq count 0)
(dolist (symbol syms)
@@ -5967,20 +5954,19 @@ sign. With optional ARG, insert that many dollar
signs."
;;; Simple Commands
+(defvar TeX-normal-mode-reset-list '(TeX-style-hook-list)
+ "List of variables to reset with `\\[universal-argument]
\\[TeX-normal-mode]'.
+AUCTeX libraries and styles should add variables for reset to
+this list.")
+
(defun TeX-normal-mode (&optional arg)
"Remove all information about this buffer, and apply the style hooks again.
Save buffer first including style information.
With optional argument ARG, also reload the style hooks."
(interactive "*P")
(if arg
- (setq TeX-style-hook-list nil
- BibTeX-global-style-files nil
- BibTeX-global-files nil
- BibLaTeX-global-style-files nil
- TeX-Biber-global-files nil
- TeX-global-input-files nil
- LaTeX-global-class-files nil
- LaTeX-includegraphics-global-files nil))
+ (dolist (var TeX-normal-mode-reset-list)
+ (set var nil)))
(let ((TeX-auto-save t))
(if (buffer-modified-p)
(save-buffer)
@@ -6032,6 +6018,7 @@ valid languages."
(const "french") ;; not frenchb or francais
(const "italian")
(const "polish")
+ (const "portuguese")
(const "slovak")
(const "swedish")
(string :tag "Other Language"))
- [AUCTeX-diffs] [elpa] externals/auctex a6121fb 13/34: Fix fontification when $ is unclosed in buffer, (continued)
- [AUCTeX-diffs] [elpa] externals/auctex a6121fb 13/34: Fix fontification when $ is unclosed in buffer, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 1ded6fc 24/34: Fix markups in documents, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex afab0e0 17/34: Indent region (bug#48518), Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 70907dd 09/34: Skip inline math $ inside comments (bug#48365), Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 3c8e583 08/34: Introduce new variable `LaTeX-global-package-files', Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 8990190 16/34: Improve style/algorithm.el, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex b5f34a9 23/34: Followup my commit on May 6, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex bff3d85 01/34: ; Delete unnecessary escaping of characters, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 7ff3323 03/34: Add support for (Brazilian) Portuguese, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 2a4cbbb 21/34: Improve `TeX-electric-macro' in Texinfo mode, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex dfd6585 33/34: Merge remote-tracking branch 'origin/master' into externals/auctex,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 605cfc2 14/34: Add new test, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex bb1bb25 27/34: Remove backspace as paragraph separator, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 93d66d1 31/34: Adapt for Texinfo mode, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 154fc6e 28/34: Only re-fill \item contents if auto-fill-mode is active (bug#48760), Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex cd63c11 32/34: Use own error description for LaTeX mode only, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex a21c10a 29/34: Check for `auto-fill-function' before filling, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 34ab611 22/34: Improve completion, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex e7b25d1 26/34: Use #' rather than ' to quote function names, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 1d32138 25/34: ; Silence the compiler, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 81ce0ee 19/34: Add -dDELAYBIND only when necessary, Tassilo Horn, 2021/06/06