98

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 already ...


58

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]{article}...


57

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.


41

Load varioref first, then hyperref, then cleveref. See section 14.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 \...


37

Changing this tiny line of code \usepackage[usenames,dvipsnames]{color} to \usepackage[usenames,dvipsnames]{xcolor} fixed it, thanks @Ignasi


36

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, ...


33

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 ...


32

I see that I come some months to late but I want to present my approach to maybe solve the problem or at least to provide a workaround. The problem at my side is, the approach is so simple so that I can't imagine that there is no other people who had the same idea before. So my question is: Where is the catch in this approach? To explain the code: I ...


30

Since the algorithm and algorithm2e packages both define an algorithm environment, simply loading both with no extra precaution will cause a name clash like you experienced. However, you can still use both packages (if you really need both), but you need to pass the option algo2e to algorithm: \usepackage[algo2e]{algorithm2e} This option changes the name ...


25

Markus 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 ...


24

Here's some reasons why I prefer babel over polyglossia for LuaLaTeX. babel's base is part of the LaTeX core packages actively developed, but polyglossia is only getting a few minor updates. babel's RTL and BiDi support is really nice for LuaLaTeX now. But polyglossia only supports RTL text with XeLaTeX. babel's new ini system for setting up languages is ...


21

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 the ...


20

In usbthesis.cls change the line: \renewcommand{\year}[1]{\newcommand{\@year}{#1}} to, \newcommand{\myyear}[1]{\newcommand{\@year}{#1}} and use \myyear rather than \year in your document. It looks like pgfmathfunctions.random.code.tex uses \year to generate a random seed. Since the class redefines \year before it's use in that file, you're getting the ...


20

This "problem" is inherent to the class you're using. Here's what's happening: You load wiley2sp, which sets up the document structure. It also (re)defines the macro \vec: \if@mathematic \def\vec#1{\ensuremath{\mathchoice {\mbox{\boldmath$\displaystyle\mathbf{#1}$}} {\mbox{\boldmath$\textstyle\mathbf{#1}$}} ...


20

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.


19

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{% ...


19

Tex/Latex have what is called monolithic state: you can't cleanly isolate the configuration done by one package from another, which is one of the reasons why incompatibilities are possible. This means there is no way to identify how to undo what changes the \usepackage command has caused. Think of installing software on your machine: if the software makes ...


18

I experienced problem with the package ellipsis when loaded before hyperref. In addition, as Joseph Wright writes here, https://tex.stackexchange.com/a/64605/9632, cmap has to be loaded after hyperref.


17

Summary The correct answer is indeed the solution of Gernsheim with \RequirePackage{pdf14} right at the beginning before \documentclass. Details The minor version of the PDF file is set by \pdfminorversion in pdfTeX (Older versions are using \pdfoptionpdfminorversion). The version number is written in the very beginning of the PDF file: %!PDF-1.4 The ...


17

UPDATE 2019-01-14 An equivalent patch has been applied in tabu 2.9 which has been submitted to ctan. 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 ...


17

The first version of the pkgloader package has been released! Based on all of the useful comments above, and my own (re)search, I feel safe to answer my own individual questions as follows: Is there already another package that does (something like) this? No. The closest that has been suggested is scrlfile, and, frankly, it's not all that close. Also, ...


16

One can use David's suggestion, but etoolbox must be loaded anyway: \ProvidesFile{xpatch.sty} \usepackage{etoolbox} \usepackage{imakeidx} \usepackage{regexpatch} should do.


16

There are 79 language definition files (gloss-XX) in the polyglossia folder. For a thorough comparision you would have to compare for every language how good the gloss-file is, if it works with lualatex, if babel provide definitions for this language too and how good it works with lualatex. And naturally you also need to check if babel knows language which ...


15

UPDATE 2019-01-14 An patch equivalent to the code in Bruno's answer has been applied in tabu 2.9 which has been submitted to ctan, so the workaround suggested in this answer should not be needed. tabu uses \scantokens while parsing the preamble, which means it picks up the local verbatim setting and goes wrong. Since the argument is just \def\:{|} just ...


15

Short answer: Run texdoc l2tabuen in the OS prompt. Long answer: Although may be are not officially deprecated LaTeX2e commands, as David said, novices often fall in old documentation, examples and templates, taking obsolete or not well understood practices, as writing the non-deprecated \'{a} when with minimal settings in the preamble and a suitable ...


15

The siunitx code does it's best to 'guess' when content is 'purely textual', but it is best to give it some guidance. Here, the issue arises as siunitx picks up \multirow as 'before the number' but fails to grab all of the arguments in the same way. Adding a set of braces fixes this: \documentclass{article} \usepackage{mathpazo} \usepackage{array} \...


14

Putting a \RequirePackage{pdf14} in the preamble, just before the \documentclass worked for me.


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