LaTeX refactoring, use \RequirePackage always, not \input #12703
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At Sphinx 4.0.0 the file sphinx.sty was split into multiple smaller files.
Some of them structured as packages others as files using
\ProvidesFile
.I am currently working on some LaTeX PR, and this situation is a slight annoyance. Files with using
\ProvidesFile
can only be\input
and then only once (due to\newcommand
which can not be executed twice). This is sometimes a problem when for some reason we want to indicate in one file that its macros require some defined in some other file. In TeX, macros do not have to be defined beforehand to be used in other macro definitions, but abusing this is no good for future maintenance.Using
\RequirePackage
is a good way, because we can do it multiple times and it will not complain and will actually load the required file only once. And A can require B while B requires A. No problem about that in LaTeX. Here Package A requires B which is itself a package requiring A. Nothing bad happens:Using
\ProvidesFile
and not\ProvidesPackage
was a mistake.This fixes it.
Only people (do they exist at all?) having really messed around with replacing some of those files with custom ones will have to adjust and also use
\ProvidesPackage
in their own (surely less good) variants of Sphinx own perfect files.I think a simple addition to CHANGES will be enough to signal some internal change.