Please note that not everything has to be declared.
- Unknown macros are ignored with arguments kept, {} braces are removed.
- Unknown environment frames \begin, \end are removed. If \begin accepts arguments, the environment should be declared.
- Math mode macros only need to be declared, if they should not leave output that constitutes a part of a term or operator.
Packages
LaTeX builtins,
amsmath,
amsthm,
babel,
biblatex,
circuitikz,
cleveref,
geometry,
glossaries,
glossaries-extra,
graphicx,
hyperref,
inputenc,
koma-script,
listings,
mathtools,
pgfplots,
tikz,
unicode-math,
xcolor,
xspace
Document classes
article, book, report, scrartcl, scrbook, scrreprt
Source: yalafi/parameters.py, tests: tests/test_packages/test_latex_builtins.py
Macros (Major side effects for the filter are noted in parentheses.)
\AA, \aa, \AE, \addtocounter, \addtolength \ae, \author, \bibitem, \bibliographystyle, \caption (separates text), \chapter, \cite, \def (defines macro), \documentclass (activates module), \footnote (separates text), \footnotemark, \footnotetext (separates text), \framebox, \hfill, \hphantom, \hspace, \include, \includeonly, \index, \input, \item, \L, \l, \label, \LaTeX, \linebreak, \LTadd, \LTalter, \LTinput (executes code in file), \LTskip, \MakeLowercase, \MakeUppercase, \newcommand (defines macro), \newcounter, \newlength \newline, \newtheorem (defines environment), \nobreakspace \O, \o, \OE, \oe, \pagenumbering, \pageref, \pagestyle, \par, \paragraph, \part, \phantom, \providecommand (defines macro, but does not overwrite existing ones), \qquad, \quad, \ref, \refstepcounter, \renewcommand (defines macro), \S, \section, \setcounter, \setlength \settodepth \settoheight \settowidth \ss, \stepcounter, \subsection, \subsubsection, \TeX, \textasciicircum, \textasciitilde, \textbackslash, \thispagestyle, \title, \usepackage (activates module), \vphantom, \vspace
Environments
displaymath, enumerate, eqnarray(*), equation, figure, itemize, minipage, table, tabular, thebibliography, verbatim
Source: yalafi/packages/amsmath.py, tests: tests/test_packages/test_amsmath.py
Macros
\DeclareMathOperator, \eqref, \medspace, \negmedspace, \negthickspace, \negthinspace, \notag, \numberwithin, \substack, \text, \thickspace, \thinspace
Environments
align(*), alignat(*), aligned, equation(*), flalign(*), gather(*), multline(*), multlined
Source: yalafi/packages/amsthm.py, tests: tests/test_packages/test_amsthm.py
Macros
\newtheoremstyle, \qedhere, \theoremstyle
Environments
proof
Source: yalafi/packages/babel.py, tests: tests/test_packages/test_babel.py
Macros
\foreignlanguage, \selectlanguage
Environments
otherlanguage(*)
Source: yalafi/packages/biblatex.py, tests: tests/test_packages/test_biblatex.py
Macros
\addbibresource, \cite, \Cite, \footcite, \footcitetext, \parencite, \Parencite, \printbibliography
Source: yalafi/packages/circuitikz.py, tests: tests/test_packages/test_circuitikz.py
We simply remove the circuit in environment 'circuitikz'.
Loaded packages
Macros
\ctikzset
Environments
circuitikz
Source: yalafi/packages/cleveref.py, tests: tests/test_packages/test_cleveref.py
The LaTeX package cleveref
allows to automatically insert the type of a
reference, e.g. expand \cref{sec:one}
to section 1
if it indeed references
the first section.
The cleveref
output is also highly customizable, and we do not intend to
replicate its functionality within YaLafi.
Luckily, cleveref
has a poorman
option with the following intention:
If you have written a document using cleveref
, but a publisher does not
accept cleveref
, you can use that option to create a sed
file (during the
LaTeX run) which allows replacing all cleveref
commands.
See the cleveref
documentation for more details.
YaLafi makes use of that and reads this sed
file to replace all cleveref
commands with their correct replacement.
As explained above, this requires that you load cleveref
with the poorman
option, run LaTeX before YaLafi and passing the sed
file to YaLafi via
\YYCleverefInput
.
A sample file could look like
% file `main.tex`
\documentclass{scrartcl}
\newcommand{\YYCleverefInput}[1]{} % make the command known to LaTeX
\usepackage[poorman]{cleveref}
% See below for an example with hyperref!
\YYCleverefInput{main.sed} % tell YaLafi which sed file to use
\begin{document}
\section{One}\label{sec:one}
\Cref{sec:one}
\end{document}
As written above, you need to first run LaTeX to produce the file main.sed
and then use YaLafi.
The sed
file is loaded to YaLafi via \YYCleverefInput
.
The usage is similar to \LTinput
and you should also define
\newcommand{\YYCleverefInput}[1]{}
in your document.
Known limitation (1):
Unfortunately, the cleveref
package does not always
create the sed
file as expected.
Whenever you load the hyperref
package as well, only the starred commands,
e.g. \cref*{equation1}
, are written to the sed
file.
This should be fixed within the cleveref
LaTeX package.
Workaround (1):
Don’t use the starred variants and compile your document without loading
hyperref
to create the sed
script.
Only add the hyperref
package if you don’t need the created sed
file.
Unfortunately, cleveref
will overwrite the sed
file each time it is called
together with hyperref
and the poorman
option.
Hence, one need to remove the poorman
option in this case.
To simplify the process of loading cleveref
in a document where you also use
hyperref
, one can use the following LaTeX code.
The idea is that one can comment or uncomment loading the hyperref
package.
If the hyperref
package is not loaded, cleveref
is loaded with the
poorman
option and produces a valid sed
file on the next LaTeX run.
And if you load the hyperref
package, cleveref
is loaded without the
poorman
option such that subsequent LaTeX calls don’t change the sed
file.
All this is hidden from YaLafi within an %%% LT-SKIP
block to avoid warnings.
Instead, the usage of cleveref
with the poorman
option is passed to YaLafi.
% file `main.tex`
\documentclass{scrartcl}
\newcommand{\YYCleverefInput}[1]{} % make the command known to LaTeX
\newcommand{\LTadd}[1]{} % make the command known to LaTeX
%%% LT-SKIP-BEGIN
% \usepackage{hyperref}
\makeatletter
\@ifpackageloaded{hyperref}{
\usepackage{cleveref}
}{
\usepackage[poorman]{cleveref}
}
\makeatother
%%% LT-SKIP-END
\LTadd{\usepackage[poorman]{cleveref}} % tell YaLafi to use cleveref
\YYCleverefInput{main.sed} % tell YaLafi which sed file to use
\begin{document}
\section{One}\label{sec:one}
\Cref{sec:one}
\end{document}
You only need to disable loading hyperref
, whenever you use a new label (or
a different combination of labels).
But YaLafi will tell you, if it does not know a label yet.
After enabling hyperref
again, you might need to run LaTeX twice to update
the auxiliary files.
Known limitation (2): In multi-language documents, YaLafi uses the main language for all references.
Macros
\cpageref,
\Cpageref,
\cpagerefrange,
\Cpagerefrange,
\cref(*),
\Cref(*),
\crefalias,
\crefname,
\Crefname,
\crefrange(*),
\Crefrange(*),
\label,
\labelcpageref,
\labelcref,
\lcnamecref,
\lcnamecrefs,
\namecref,
\nameCref,
\namecrefs,
\nameCrefs,
\YYCleverefInput,
all commands that would be replaced with the sed
file
(e.g. \crefrangeconjunction)
Source: yalafi/packages/geometry.py, tests: tests/test_packages/test_geometry.py
Macros
\geometry
Source: yalafi/packages/glossaries.py, tests: tests/test_packages/test_glossaries.py
Please note the comments at the beginning of file
yalafi/packages/glossaries.py.
You have to load the .glsdefs
file into each LaTeX source and to place
all definitions of glossary entries inside
\begin{document} ... \end{document}
.
Macros
\acrpluralsuffix \GLS, \Gls, \gls, \glspluralsuffix \glsacrpluralsuffix \glsupacrpluralsuffix \GLSpl, \Glspl, \glspl, \GLSdesc, \Glsdesc, \glsdesc, \glsdisp, \glslink, \GLStext, \Glstext, \glstext, \longnewglossaryentry, \newacronym, \newglossaryentry
Source: yalafi/packages/glossaries_extra.py, tests: tests/test_packages/test_glossaries_extra.py
Please note the comments at the beginning of file
yalafi/packages/glossaries_extra.py.
You have to load the .glsdefs
file into each LaTeX source and to say
something like \usepackage[docdef=true]{glossaries-extra}
or \usepackage[docdef=atom]{glossaries-extra}
in the preamble.
With docdef=true
, all glossary entries have to be defined inside
\begin{document} ... \end{document}
.
Loaded packages
Macros
\newabbreviation, \Glsxtrfull, \glsxtrfull, \Glsxtrlong, \glsxtrlong, \Glsxtrshort, \glsxtrshort
Source: yalafi/packages/graphicx.py, tests: tests/test_packages/test_graphicx.py
Macros
\graphicspath \includegraphics
Source: yalafi/packages/hyperref.py, tests: tests/test_packages/test_hyperref.py
Macros
\belowpdfbookmark \currentpdfbookmark \href, \pdfbookmark \ref*, \subpdfbookmark \texorpdfstring, \url
Source: yalafi/packages/inputenc.py, tests: tests/test_packages/test_inputenc.py
Macros
\inputencoding
Source: yalafi/packages/koma_script.py, tests: tests/test_packages/test_koma_script.py
This is a helper package only available in YaLafi to implement commands used by the KOMA classes scrartcl, scrbook and scrreprt.
Macros
\extratitle, \KOMAoption, \KOMAoptions, \subject, \subtitle
Source: yalafi/packages/listings.py, tests: tests/test_packages/test_listings.py
We simply remove the listings, inserting a paragraph break.
Macros
\lstinputlisting, \lstset
Environments
lstlisting
Source: yalafi/packages/mathtools.py, tests: tests/test_packages/test_mathtools.py
Loaded packages
Macros
\mathtoolsset
Source: yalafi/packages/pgfplots.py, tests: tests/test_packages/test_pgfplots.py
Loaded packages
Macros
\pgfplotsset
Source: yalafi/packages/subfiles.py, tests: tests/test_packages/test_subfiles.py
Macros
\subfile, \subfileinclude
Source: yalafi/packages/tikz.py, tests: tests/test_packages/test_tikz.py
We simply remove the picture in environment 'tikzpicture'.
Macros
\tikzset, \usetikzlibrary
Environments
tikzpicture
Source: yalafi/packages/unicode_math.py, tests: tests/test_packages/test_unicode_math.py
Adds unicode ‘math operators’, i.e. also ≤
and similar are recognized in equations.
Macros
\setmathfont, \unimathsetup
Source: yalafi/packages/xcolor.py, tests: tests/test_packages/test_xcolor.py
Macros
\color, \colorbox, \definecolor, \fcolorbox, \textcolor
Source: yalafi/packages/xspace.py, tests: tests/test_packages/test_xspace.py
Macros
\xspace
Source: yalafi/documentclasses/article.py, tests: tests/test_documentclasses/test_article.py
—
Source: yalafi/documentclasses/book.py, tests: tests/test_documentclasses/test_book.py
—
Source: yalafi/documentclasses/report.py, tests: tests/test_documentclasses/test_report.py
—
Source: yalafi/documentclasses/scrartcl.py, tests: tests/test_documentclasses/test_scrartcl.py
Macros
For macros available in all KOMA classes see package koma-script.
Source: yalafi/documentclasses/scrbook.py, tests: tests/test_documentclasses/test_scrbook.py
Macros
For macros available in all KOMA classes see package koma-script.
Source: yalafi/documentclasses/scrreprt.py, tests: tests/test_documentclasses/test_scrreprt.py
Macros
For macros available in all KOMA classes see package koma-script.