# Tag Info

94

Preliminaries In this answer, I'll be discussing "objects" such as "Theorem 2", "Lemma 3", "Page 7", and "Section 4". Each object is assumed to be associated with a \label command, e.g., \label{thm:important} and \label{sec:results}. Classes of cross-references: Static, semi-dynamic, and fully dynamic Static or hard-coded cross-references. As the name "...

80

cleveref Many others are documented in section 6 of the hyperref README. Some are more complex than simply loading after hyperref. Here are some more common ones... amsrefs float before hyperref before algorithm chappg sidecap linguex

66

geometry: From the User manual: With mag <> 1000, no truedimen and hyperref, hyperref should be loaded before geometry. Otherwise the resulted PDF size will become wrong. robustindex hypdestopt, hypcap, hypbmsec attachfile showframe, showidx (which disables the \hrefs in the index but in this loading order at least documents compile at all) uri, ...

45

The very recent version of the subcaption package will even issue an error: ! Package caption Error: The `subcaption' package does not work correctly (caption) in compatibility mode. The only way to get around this is to specify the option compatibility=false to the caption package: \documentclass{cifa} \usepackage{subcaption} \...

43

You can use the internal LaTeX macro \@ifpackageloaded to test if a package was loaded: \@ifpackageloaded{<name>}{<true>}{<false>} There are also: \@ifpackagewith{<name>}{<option-list>}{<true>}{<false>} \@ifpackagelater{<name>}{<date YYYY/MM/DD>}{<true>}{<false>} For further macro see ...

40

Once you get the error message: ! LaTeX Error: Option clash for package xcolor. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.17 type "h" (without the quotation marks, for help) in the output console and you get ? h The package xcolor has ...

39

Other common ones include bookmark glossaries

35

hyperref compatibility The hyperref package redefines many macros of LaTeX and LaTeX packages for generating hyperlinks in documents, for many kinds of references, such as citations, footnotes, captions, table of contents entries, and bookmarks. That's why it should usually be loaded after other packages, with some exceptions, such as some of the following ...

33

Load xcolor before tikz: \usepackage[table]{xcolor} \usepackage{tikz} The problem is that pgf/tikz already loads xcolor so loading it again with a new package option triggers the error message. Another option is to pass the table option to the class and not to the xcolor package. Then the packages can be loaded in any order: \documentclass[table]{...

33

Load varioref first, then hyperref, then cleveref. See section 12.1 of the cleveref manual. \documentclass[ngerman]{scrartcl} \usepackage{babel} \usepackage{varioref} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \section{Erster Abschnitt}\label{sec} \begin{figure} \rule{\textwidth}{1cm} \caption{bild}\label{bild} \end{figure} Siehe \...

31

The degree to which something is 'stable enough' will depend on your requirements. I'll answer by taking this situation in roughly the order of stability as I see it. If you want 'will never change again', then plain TeX is probably your best bet. Knuth does still fix bugs periodically, but most things are now likely to be regarded as 'features' rather than ...

30

Freek Dijkstra has put together a nice wiki of Latex package conflicts. Hyperref is the one he singles out for criticism: it has the nasty property that sometimes it conflicts when it is put earlier, sometimes when it is put later than other widely used packages, encouraging cargo-cult document headers. He's had less trouble with inputenc conflicts that ...

29

If the class defines either a macro or an environment called proof, add the instructions \let\proof\relax and \let\endproof\relax before loading amsthm.

22

Package functionality The functionality provided by the various packages for cross-referencing may be divided as follows: Formatting references according to the type of label being referred to (i.e., typesetting "section 3" instead of only "3"). Packages like fancyref, prettyref or refstyle provide a semi-automatic solution as you must adhere to certain ...

22

The problem is that one of the subpackages loaded by datatool, namely datatool-base has the line \RequirePackage{amsmath} and mathspec sets up a (very poor) check for possible loading of amsmath after it, which triggers the error even if amsmath has already been loaded when another package requires it. The normal setup of LaTeX is not reloading packages, ...

21

fntguide is my standard go-to reference for these kinds of questions. Here's the entirety of what it has to say about the matter: Warning: If you wish to use T1-encoded fonts other than the 'cmr' family then you may need to load the package (e.g. times) that selects the fonts before loading fontenc (this prevents the system from attempting to load ...

21

As you already mentioned, enumitem "disturbs" beamer. This is because the document class (beamer in this case) defines (or redefines) all the necessary commands/macros and environments to it's liking. Then, each loaded package does the same sequentially. As such, since enumitem follows the document class, it redefines the itemize (and other) environments, ...

21

I've never used this combination myself, but a search with your favorite engine should show you that there are some incompatibilities, e.g. (all in German): Paket titlesec und KOMA-Skript-Befehl \setindexpreamble (it was originally a usenet post, but the archived Google groups version is broken; with an interesting answer of Markus Kohm, the author of ...

19

Since biblatex "reimplements the bibliographic facilities of LaTeX from the ground up, [it] naturally conflicts with all packages modifying the same facilities" (manual, section 1.5.4). Specifically, biblatex is incompatible with natbib. biblatex' natbib option only provides aliases for natbib's citation commands. From a look into the manual of RevTeX 4.1, ...

19

As Andrew has mentioned, the general procedure to prevent symbol names clashes when two packages define the same symbol name is to load the first package, rename the conflicting symbols, and then load the second package. The \savesymbol command from the savesym package can be used to this; \savesymbol{XXX} renames a symbol from \XXX to \origXXX: \...

19

egreg answered the specific issue but the general issue of avoiding package loading as mentioned in comments: \documentclass{article} \ProvidesFile{longtable.sty} \usepackage{longtable} \typeout{longtable is: \meaning\longtable} \stop produces longtable is: undefined showing that the package is not loaded, despite the \usepackage.

18

This is actually a timing problem: The metadata has to be inserted before the final \clearpage command, otherwise, it isn't written to the PDF document any more. However, memoir issues a \clearpage with \AtBeginDocument{\AtEndDocument{\clearpage\dol@stsheet\dol@stpage}} so the code used by hyperxmp \AtBeginDocument{% % [...] \AtEndDocument{% ...

18

Basically the package is only loaded once, with the options specified at that point. Any later uses of \RequirePackage or \usepackage are silently ignored if the options specified were specified earlier, or generate an error otherwise. Normally it works to put options on \documentclass, so they are global options seen by all packages. The help text for ...

18

Marcus Kohm, the author of KOMA-Script (see his initials), utters about this frequently, but unluckily for TeX.SE usually in German. Also I would prefer to say, some packages are not fully compatible instead of they are incompatible, because in most cases they work partially and often there’s a workaround. Every package, that makes a redefinition of ...

18


17

It used to be a bad idea to have \usepackage[T1]{fontenc} before any other font packages because it could trigger LaTeX to attempt to load T1 versions of the Computer Modern font; nowadays I believe this isn't a problem because the EC fonts are installed by default (even though you probably don't want to use them with Latin Modern now in existence). ...

17

\PassOptionsToPackage{dvipsnames}{xcolor} \documentclass{...} \usepackage[normalem]{ulem} \usepackage[all]{xy} \usepackage{xcolor} However, it looks like that xcolor is already loaded by your documentclass or another package

17

EDIT: After discussion in comments, it turns out that I had underestimated the problem, and that David's answer was closer to being the correct answer than mine. Three catcode régimes are involved here. In chronological order, those are: catcodes in force when the code of the tabu package is read (tokenized); catcodes in force when the preamble of the ...

16

Load imakeidx before hyperref. Generally, hyperref should be loaded last, though there are some exceptions (see Which packages should be loaded after hyperref instead of before? ).

16

For chapters the incompatibility is not evident, as \titleformat{\chapter}... will redefine \@makechapterhead and \@makeschapterhead. However \documentclass{memoir} \usepackage{titlesec} will redefine \section in such a way that the second optional argument is not accepted; indeed \section[section toc][section head]{section title} will produce the ...

Only top voted, non community-wiki answers of a minimum length are eligible