The latex macros from sphinx.sty were already partitioned into
successive sections. The file sphinx.sty is split into multiple
files in concordance with this pre-existing sectioning.
The files are loaded via \input. File extension is .sty not .tex
to not confuse the Makefile.
This makes .idx files contain \spxentry{..} with no space, whether or
not the \index latex command is encountered in main text or e.g. in a
label of a description list (like happens for terms from a glossary).
Xindy does not care about spaces, but Makeindex doesn't merge entries
whose typesetting is to be done via \spxentry{..} or \spxentry {..}.
An alternative work-around would be for Sphinx LaTeX writer to use some
wrapper, say, \sphinxindexwrap, only to fetch the argument and force TeX
tokenization and then hand over it to \index command.
But we choose to let \spxentry expand to its own name, with no trailing
space (it gets its final definition only from the python.ist file in
case of Makeindex).
In case both the :index: role and the glossary are on same page, Xindy
and Makeindex behave differently: the former gives only once the page
number, the latter issues them twice (but the indexed term only once),
and there is warning in the .ilg file. But this is unrelated and we
can't do here anything about it.
As discussed in #7879, the default style of line numbers for code
blocks in HTML output becames 'inline' by default. And 'table' style
is now deprecated and will be removed in Sphinx-6.0.
Closes: #8253
The 'pxunit' key from latex_elements instructs how to handle image
dimensions specified in px units.
But pdftex has \pdfimageresolution which is used when an image file does
not provide readable or legit values for the x and/or y resolution.
This commit syncs them: from 'pxunit' the default image resolution in
pixels per inch (an integer) is computed.
This way an image will behave the same if:
- it is loaded with no explicit size set, _and_ no readable image
resolution data is readable from the file (or that data matches the
'pxunit' setting)
- or a size is set in figure directive using px units and equal to the
natural pixel size of the image,
This also with 'lualatex' but is ignored by with 'xelatex' and
'uplatex'.
Some writers will be crashed by KeyError because of lack of the refid if
a new auto footnote reference is added to the message catalog by
translation misses.
This detects the invalid footnote references and removes them on
the translation phase.
Since 3.0.1, the term role has matched to the words in glossary
case-sensitively. It's important change for preventing conflicts by
word cases. But, it also brings a problem for references in natural
text.
This optimizes the case-insensitive match of the term role. It allows
to search glossary words twice with no performance penalty; the first
search is case sensitive and another is case insenstive.
Opening and closing a file requires processing from the operating
system. Repeatedly opening and closing wastes system resources and
hinders buffering, causing a flush (disk I/O) after each write
operation.
Using a context manager ensures the logs are flushed to disk and files
are properly closed whether the program exists successfully or an
exception occurs. Compared to the previous implementation, a brutal
shutdown of the machine (e.g. power cord disconnected) could cause some
log lines not to be written. That should not be an issue in practice.
Now, files are created and truncated when linkcheck submitted the links
to check to the threads and is ready to process the results, instead of
when the builder is constructed. It keeps the file operations closer to
their use.