summaryrefslogtreecommitdiff
path: root/sphinx/builders/latex
Commit message (Collapse)AuthorAgeFilesLines
* html builder: Append CRC32 checksum to asset URIs (#11415)Adam Turner2023-05-111-4/+7
|
* Revert "Support and prefer ``.jinja`` to ``_t`` for static templates ↵James Addison2023-04-231-2/+2
| | | | | (#11165)" (#11329) This reverts commit 5d13215b58f93c6be8255ef2e3e20836508c7d47.
* Partially revert "Disable localisation when SOURCE_DATE_EPOCH is set ↵Adam Turner2023-04-211-1/+1
| | | | | (#10949)" (#11343) This keeps some of the added tests, and avoids a full revert of ``sphinx.locale``.
* Support and prefer ``.jinja`` to ``_t`` for static templates (#11165)James Addison2023-04-071-2/+2
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Disable localisation when ``SOURCE_DATE_EPOCH`` is set (#10949)James Addison2023-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit disables Sphinx's localisation features when reproducible builds are requested, as determined by a non-empty SOURCE_DATE_EPOCH_ environment variable. The `Reproducible Builds`_ project aims to provide confidence to consumers of packaged software that the artefacts they're downloading and installing have not been altered by the environment they were built in, and can be replicated at a later date if required. Builds of localised documentation using Sphinx currently account for a large category of reproducible build testing failures, because the builders intentionally use varying environment locales at build-time. This can affect the contents of the ``objects.inv`` file. During investigation, it turned out that many ``gettext``-localised values (particularly in Python modules under ``sphinx.domains``) were being translated at module-load-time and would not subsequently be re-localised. This creates two unusual effects: 1. Attempting to write a test case to build the same application in two different languages was not initially possible, as the first-loaded translation catalogue (as found in the ``sphinx.locale.translators`` global variable) would remain in-use for subsequent application builds under different locales. 2. Localisation of strings could vary depending on whether the relevant modules were loaded before or after the resource catalogues were populated. We fix this by performing all translations lazily so that module imports can occur in any order and localisation of inventory entries should occur only when translations of those items are requested. Localisation can then be disabled by configuring the ``gettext`` language to the ISO-639-3 'undetermined' code (``'und'``), as this should not have an associated translation catalogue. We also want to prevent ``gettext`` from attempting to determine the host's locale from environment variables (including ``LANGUAGE``). .. _SOURCE_DATE_EPOCH: https://reproducible-builds.org/docs/source-date-epoch/ .. _Reproducible Builds: https://www.reproducible-builds.org/
* Fix error message wording in builders/latex/transforms.pyJean-François B2023-04-011-3/+5
| | | | | And make it and the two other ones there translatable strings. Using .format for the f-string.
* Fix typos found by codespellDimitri Papadopoulos2023-03-271-1/+1
|
* Resolve ``flake8-return`` errorsAdam Turner2023-02-181-4/+2
|
* Fix COM812Adam Turner2023-02-182-3/+3
|
* Resolve Ruff SIM114 violationsAdam Turner2023-02-151-4/+3
|
* Merge branch '6.1.x'Adam Turner2023-01-101-7/+4
|\ | | | | | | | | | | # Conflicts: # CHANGES # sphinx/__init__.py
| * Undo parallel image changesAdam Turner2023-01-101-7/+4
| |
* | Adopt ``profile = "black"`` for ``isort``Adam Turner2023-01-071-2/+7
|/ | | | This allows using Ruff's import sorting fixers
* Fix copying images under parallel execution (#11100)Adam Turner2023-01-071-4/+7
|
* Move console output utilities to ``sphinx.util.display``Adam Turner2023-01-031-1/+2
| | | | | - Merge `old_status_iterator` into ``status_iterator``. ``old_status_iterator`` was deprecated in version 1.6.
* Run pyupgrade (#11070)Adam Turner2023-01-021-2/+2
|
* Use PEP 604 typesAdam Turner2023-01-014-11/+8
|
* Use PEP 595 typesAdam Turner2023-01-014-26/+26
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-015-0/+10
|
* remove blanket 'noqas'Daniel Eades2022-12-162-3/+7
|
* LaTeX: switch to some nicer defaults for tables and code-blocks (#10924)Jean-François B2022-10-171-1/+1
|
* LaTeX: support for booktabs-style and zebra-striped tables (#10759)Jean-François B2022-10-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination of 2 + 28 + 7 + and some more commits... * Cherry-pick: Add support for booktabs-style tables to LaTeX builder * Cherry-pick: Add support for zebra-striped tables to LaTeX builder Co-authored-by: Stefan Wiehler <stefan.wiehler@missinglinkelectronics.com> Above work originally initiated by @sephalon (thanks!) Development refactored and continued by @jfbu * latex_table_style configuration, support booktabs, colorrows, borderless Some details: - Simplify a bit a conditional in the longtable template This also puts the target for a longtable with a label but no caption above the toprule for better hyperlinking (testing shows hyperlink target can not end up alone at bottom of previous page). - Extend allowed syntax for colour assignments via 'sphinxsetup' - latex_table_style new configuration value and coloured rows For the user interface I tried to look for inspiration in https://docutils.sourceforge.io/docs/user/config.html#table-style which mentions booktabs and borderless. They also mention captionbelow which we can implement later, now that architecture is here. They don't mention coloured rows. - Test on our own document... looks fine! - Work-around an incompatibility of \cline with row colours - Reverse priority of classes to allow overruling booktabs by standard after parsing source but before letting LaTeX writer act - Closes #8220 Commit https://github.com/sphinx-doc/sphinx/commit/bb859c669679baebd8cc8d10c99382478c0d1647 already improved a bit, this finishes it (as :rst:dir:`rst-class` was actually not linking to anywhere). - Let booktabs style defaults to *not* using \cmidrule. They actually don't make much sense there, as all \hline's are removed. - Add \sphinxnorowcolor which allows construct such as this one in a tabularcolumns directive: >{\columncolor{blue}\sphinxnorowcolor} else LaTeX always overrides column colour by row colour - Add TableMergeColorHeader, TableMergeColorOdd, TableMergeColorEven so single-row merged cells can be styled especially - Extend row colours to all header rows not only the first one (all header rows will share same colour settings) - Auto-adjust to a no '|'-colspec for optimal handling of merged cell - Add \sphinxcolorblend - Workaround LaTeX's \cline features and other grid tables matters - Add \sphinxbuildwarning for important warnings - Fix some white gaps in merged cells of tables with vlines and colorrows - Work around LaTeX's \cline serious deficiencies for complex grid tables This commit corrects \cline badly impacting vertical spacing and making tables look even more cramped as they usually are in LaTeX (although one sees it clearly only with \arrarrulewidth a bit more than the LaTeX default of 0.4pt). Most importantly this commit solves the problem that \cline's got masked by colour panels from the row below. - Update CHANGES for PR #10759 - Improve documentation of new latex_table_style regarding colours
* Docstring clarifications (#9877)Arthur Milchior2022-09-241-1/+1
| | | | | Co-authored-by: Jakob Lykke Andersen <jakobandersen@users.noreply.github.com> Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Fix more strict static typing errors (#10681)danieleades2022-08-281-20/+20
|
* Further improve type annotations, reduce mypy whitelist (#10770)danieleades2022-08-282-11/+13
| | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* LaTeX: fix #10506 (make Pygments \PYG macro \protected)Jean-François B2022-06-301-1/+1
|
* `rawsource` is deprecated in `docutils.nodes.Text`Adam Turner2022-04-221-2/+2
|
* Catch `DeprecationWarning` for `docutils.frontend.OptionParser`Adam Turner2022-04-221-4/+9
|
* Specify encodingAdam Turner2022-04-222-2/+2
|
* Merge branch '4.x'Takeshi KOMIYA2022-03-196-54/+6
|\
| * Collapse single line docstringsAdam Turner2022-02-206-12/+6
| |
| * Remove copyright and licence fieldsAdam Turner2022-02-206-18/+0
| |
| * Fix module docstring indentationAdam Turner2022-02-206-12/+12
| |
| * Fix module docstring first lineAdam Turner2022-02-206-12/+6
| |
| * Remove module titles in docstringsAdam Turner2022-02-196-18/+0
| |
* | Merge branch '4.x'Takeshi KOMIYA2022-02-191-14/+17
|\ \ | |/
| * Fix #9529: LaTeX: named footnotes are converted to "?"Takeshi KOMIYA2022-02-061-14/+17
| | | | | | | | | | | | | | | | Named auto numbered footnote (ex. ``[#named]``) that is referred multiple times was rendered to a question mark. This calls `\sphinxstepexplicit` for every footnote node that is referred multiple times.
* | Close #10062: Change the default language to 'en'Takeshi KOMIYA2022-01-122-19/+13
| | | | | | | | | | Change the default language to `'en'` if any language is not set in `conf.py`.
* | Merge branch '4.x'Takeshi KOMIYA2022-01-032-16/+16
|\ \ | |/
| * Migrate to Node.findall() from Node.traverse()Takeshi KOMIYA2022-01-032-16/+16
| | | | | | | | | | | | | | | | Node.traverse() was marked as deprecated since docutils-0.18. Instead of it, Node.findall() has been added as successor of traverse(). This applies a patch to docutils-0.17 or older to be available Node.findall() and use it.
* | Merge branch '4.x'Takeshi KOMIYA2022-01-016-6/+6
|\ \ | |/
| * A happy new year!Takeshi KOMIYA2022-01-016-6/+6
| |
* | refactor: Remove RemovedInSphinx50Warning (partially)Takeshi KOMIYA2021-12-171-14/+0
|/
* Support docutils-0.18: Consume iterator of Element.traverse()Takeshi KOMIYA2021-10-271-5/+5
| | | | | | | Since 0.18, Element.traverse() returns an iterator instead of intermediate object. As a result, the return value is always considered as truthy value. And it becomes fragile when the caller modifies the doctree on the loop.
* Fix typos discovered by codespellChristian Clauss2021-09-081-1/+1
|
* Add xeCJKVerbAddon to default fvset config for Chinese documentsShengjing Zhu2021-07-091-0/+3
| | | | | | | | Prevent xeCJK from adding extra spaces in fancyvrb Verbatim enviroment. Fixes: #9414 Signed-off-by: Shengjing Zhu <i@zhsj.me>
* refactor: Use PEP-526 based variable annotation (sphinx.builders)Takeshi KOMIYA2021-03-134-23/+23
|
* Merge branch 'master' into latex_better_fix_pygmentsJean-François B2021-03-122-10/+10
|\
| * Merge branch '3.x'Takeshi KOMIYA2021-03-061-9/+9
| |\
| | * Fix #8936: LaTeX: A custom LaTeX builder fails with unknown node errorTakeshi KOMIYA2021-03-051-9/+9
| | | | | | | | | | | | | | | | | | At present, post transform components for LaTeX builder does not work for the custom LaTeX builder that inherits the original LaTeX builder. This allows them working with the custom LaTeX builders.