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.
autodoc crashed when a decorator in mocked module takes arguments
because mock system returns the first argument for the decorator as a
decorated object.
This changes the approach for mocking decorators that remembers
arguments for each decoration, and fetch the latest argument on
generating document.
Add new configuration variables: `html_permalinks` and
`html_permalinks_icon`.
This refines the settings around HTML permalinks.
* html_add_permalinks
* Deprecated.
* html_permalinks
* Enable or disable permalinks feature.
* html_permalinks_icon
* Change the icon for permalinks
Prior to this the depth of the bookmarks is too low, one does not even
get to see for example what are the built-in extensions offered by
Sphinx.
Similarly the LaTeX created table of contents has not enough depth.
Dozens of contiguous pages from our documentation get only a single
link, it is very hard for newcomer to get some feeling of the scope of
Sphinx. With a more detailed table of contents (be it inside the PDF or
via the collapsable bookmark panel of PDF viewer) learning Sphinx is
easier.