Next: Automatically Created Files for LaTeX, Previous: Help with LaTeX Command Syntax, Up: LaTeX Support
Many LaTeX commands and features only become available when the appropriate package is included in the document using the ‘\usepackage’ command. Predictive LaTeX mode supports this by automatically trying to load package dictionaries and configuration functions when a ‘\usepackage’ command is typed, and unloading them again if it is modified or deleted.
When a ‘\usepackage{package}’ command is typed, predictive
LaTeX mode looks for four dictionaries based on the package
name: dict-latex-
package,
dict-latex-math-
package,
dict-latex-preamble
package, and
dict-latex-env-
package. These correspond to the four
categories of LaTeX dictionary (see LaTeX Support). If any of
these dictionaries are found, they are added to the list of dictionaries
for the corresponding category, and will be active in the appropriate
regions of the document. If the text of the
‘\usepackage{package}’ command is modified or deleted, the
dictionaries are removed again.
In addition, when a ‘\usepackage’ command is typed, modified or deleted, predictive LaTeX mode will try to load an Elisp file called predictive-latex-package‘.el[c]’, and run package-specific load or unload functions, as appropriate. The variable predictive-latex-usepackage-functions is used to determine which function (if any) to call when loading or unloading a LaTeX package (see below). This allows arbitrary configuration changes to be made when packages are included in or removed from the document. (A common use of this is to add or remove auto-overlay regexps, see LaTeX Automatic Overlays.)
The predictive completion package already comes with support for some LaTeX packages, though by no means all or even the most important1.