In
Loading package twice with \RequirePackage causes "option clash"
and
Loading a package more than once
we see that a package can be loaded multiple times, as long as no options or no different options are given.
However, my question is not if this actually works, or if it is implemented in LaTeX this way (well, obviously it is), but if this is a documented behaviour.
This is what I've found in the clsguide about it:
"If a package is always loaded with
\RequirePackage...
or
\usepackage
then,
even if its loading is requested several times, it will be loaded only once."
While this is a clear indication for me that loading a package several times is ok, the author of the catoptions has a different opinion:
"You first loaded xcolor with option cmyk and later without any option. That leads to an option clash that LaTeX can't catch. The catoptions package highlights it."
(Source: catoptions causes option clash with xcolor )
Any more hints from the LaTeX2e documentation regarding this issue?
Example documents which show the problem:
\documentclass{article}
\usepackage{catoptions}
\usepackage[labelfont=bf]{caption}
\usepackage{subcaption}
\begin{document}
Test
\end{document}
\documentclass{article}
\usepackage{catoptions}
\usepackage[balancingshow]{multicol}
\usepackage{doc}
\begin{document}
Test
\end{document}
\documentclass{article}
\usepackage{catoptions}
\usepackage[demo]{graphicx}
\usepackage{rotating}
\begin{document}
Test
\end{document}
All these examples compile fine without using catoptions, but fail when using it.
xcolorwas loaded with options "cmyk" first and then loaded again without options. As long as you don't load thecatoptionspackage additionally this works fine, so I don't see why your opinion is "This naturally doesn't work". It works, but is this indended? – Jun 29 '16 at 07:56catoptionsor not? What is the documented behaviour? – Jun 29 '16 at 08:12catoptions: it's author feels that\usepackage[foo]{bar}\usepackage{bar}is an option clash. In contrast, the kernel team decided that this was not a clash. Both positions have points in their favour. – Joseph Wright Jun 29 '16 at 08:23\captionfrom the documented behaviour (and documenting the new behaviour)" That is one of the strengths of latex, that it can be extended. It is also one of its weaknesses, that extensions can interfere with each other. I think catoptions would be better not to do this, but I wouldn't call it a bug if it does. – David Carlisle Jun 29 '16 at 08:26\RequirePackage{caption}withinsubcaptionis totally fine, and the user has to decide if his feelings are more in sync with my feelings or the feelings of thecatoptionspackage author ;-) When answering issues to users, can I quote this as the official point of view of the LaTeX team? :-D – Jun 29 '16 at 08:35catoptionsandcaptionregarding patching existing commands: 1. The package loading stuff is elementary for other packages and therefore affecting package authors. 2. There is IMHO no technical reason to change it the waycatoptionsdoes. As Joseph has already written: It's just about "feeling", thecatoptionsauthor "feels" that this is an option clash which the LaTeX2e team (and I) does "feel" not. – Jun 29 '16 at 08:49