2016-06-18 13:25:48 -05:00
|
|
|
|
LaTeX customization
|
|
|
|
|
===================
|
|
|
|
|
|
|
|
|
|
.. module:: latex
|
|
|
|
|
:synopsis: LaTeX specifics.
|
|
|
|
|
|
2016-10-29 09:30:33 -05:00
|
|
|
|
.. raw:: latex
|
|
|
|
|
|
|
|
|
|
\begingroup
|
2017-02-05 13:02:19 -06:00
|
|
|
|
\sphinxsetup{%
|
|
|
|
|
verbatimwithframe=false,
|
|
|
|
|
VerbatimColor={named}{OldLace},
|
|
|
|
|
TitleColor={named}{DarkGoldenrod},
|
|
|
|
|
hintBorderColor={named}{LightCoral},
|
|
|
|
|
attentionborder=3pt,
|
|
|
|
|
attentionBorderColor={named}{Crimson},
|
|
|
|
|
attentionBgColor={named}{FloralWhite},
|
|
|
|
|
noteborder=2pt,
|
|
|
|
|
noteBorderColor={named}{Olive},
|
|
|
|
|
cautionborder=3pt,
|
|
|
|
|
cautionBorderColor={named}{Cyan},
|
|
|
|
|
cautionBgColor={named}{LightCyan}}
|
2016-10-29 09:30:33 -05:00
|
|
|
|
\relax
|
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Unlike :ref:`the HTML builders <html-themes>`, the ``latex`` builder does not
|
|
|
|
|
benefit from prepared themes. The :ref:`latex-options`, and particularly the
|
|
|
|
|
:ref:`latex_elements <latex_elements_confval>` variable, provides much of the
|
|
|
|
|
interface for customization. For example:
|
2016-10-28 14:45:44 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. code-block:: python
|
2017-06-05 05:11:41 -05:00
|
|
|
|
|
|
|
|
|
# inside conf.py
|
|
|
|
|
latex_engine = 'xelatex'
|
|
|
|
|
latex_elements = {
|
|
|
|
|
'fontpkg': r'''
|
|
|
|
|
\setmainfont{DejaVu Serif}
|
|
|
|
|
\setsansfont{DejaVu Sans}
|
|
|
|
|
\setmonofont{DejaVu Sans Mono}
|
|
|
|
|
''',
|
|
|
|
|
'preamble': r'''
|
|
|
|
|
\usepackage[titles]{tocloft}
|
|
|
|
|
\cftsetpnumwidth {1.25cm}\cftsetrmarg{1.5cm}
|
|
|
|
|
\setlength{\cftchapnumwidth}{0.75cm}
|
|
|
|
|
\setlength{\cftsecindent}{\cftchapnumwidth}
|
|
|
|
|
\setlength{\cftsecnumwidth}{1.25cm}
|
|
|
|
|
''',
|
|
|
|
|
'fncychap': r'\usepackage[Bjornstrup]{fncychap}',
|
|
|
|
|
'printindex': r'\footnotesize\raggedright\printindex',
|
|
|
|
|
}
|
|
|
|
|
latex_show_urls = 'footnote'
|
2016-10-11 11:16:47 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
Keep in mind that backslashes must be doubled in Python string literals to
|
|
|
|
|
avoid interpretation as escape sequences. Alternatively, you may use raw
|
|
|
|
|
strings as is done above.
|
2016-10-29 09:30:33 -05:00
|
|
|
|
|
2019-01-10 09:43:54 -06:00
|
|
|
|
.. _latex_elements_confval:
|
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The ``latex_elements`` configuration setting
|
|
|
|
|
--------------------------------------------
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
|
|
|
|
A dictionary that contains LaTeX snippets overriding those Sphinx usually puts
|
|
|
|
|
into the generated ``.tex`` files. Its ``'sphinxsetup'`` key is described
|
2019-01-13 03:49:16 -06:00
|
|
|
|
:ref:`separately <latexsphinxsetup>`.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Keys that you may want to override include:
|
|
|
|
|
|
|
|
|
|
``'papersize'``
|
|
|
|
|
Paper size option of the document class (``'a4paper'`` or
|
|
|
|
|
``'letterpaper'``)
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'letterpaper'``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
``'pointsize'``
|
|
|
|
|
Point size option of the document class (``'10pt'``, ``'11pt'`` or
|
|
|
|
|
``'12pt'``)
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'10pt'``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
``'pxunit'``
|
|
|
|
|
The value of the ``px`` when used in image attributes ``width`` and
|
|
|
|
|
``height``. The default value is ``'0.75bp'`` which achieves
|
|
|
|
|
``96px=1in`` (in TeX ``1in = 72bp = 72.27pt``.) To obtain for
|
|
|
|
|
example ``100px=1in`` use ``'0.01in'`` or ``'0.7227pt'`` (the latter
|
|
|
|
|
leads to TeX computing a more precise value, due to the smaller unit
|
|
|
|
|
used in the specification); for ``72px=1in``, simply use ``'1bp'``; for
|
|
|
|
|
``90px=1in``, use ``'0.8bp'`` or ``'0.803pt'``.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'0.75bp'``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5
|
|
|
|
|
|
|
|
|
|
``'passoptionstopackages'``
|
|
|
|
|
A string which will be positioned early in the preamble, designed to
|
|
|
|
|
contain ``\\PassOptionsToPackage{options}{foo}`` commands.
|
|
|
|
|
|
2021-01-21 12:51:59 -06:00
|
|
|
|
.. hint::
|
|
|
|
|
|
|
|
|
|
It may be also used for loading LaTeX packages very early in the
|
|
|
|
|
preamble. For example package ``fancybox`` is incompatible with
|
|
|
|
|
being loaded via the ``'preamble'`` key, it must be loaded earlier.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``''``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.4
|
|
|
|
|
|
|
|
|
|
``'babel'``
|
|
|
|
|
"babel" package inclusion, default ``'\\usepackage{babel}'`` (the
|
|
|
|
|
suitable document language string is passed as class option, and
|
|
|
|
|
``english`` is used if no language.) For Japanese documents, the
|
|
|
|
|
default is the empty string.
|
|
|
|
|
|
|
|
|
|
With XeLaTeX and LuaLaTeX, Sphinx configures the LaTeX document to use
|
|
|
|
|
`polyglossia`_, but one should be aware that current `babel`_ has
|
|
|
|
|
improved its support for Unicode engines in recent years and for some
|
|
|
|
|
languages it may make sense to prefer ``babel`` over ``polyglossia``.
|
|
|
|
|
|
|
|
|
|
.. _`polyglossia`: https://ctan.org/pkg/polyglossia
|
|
|
|
|
.. _`babel`: https://ctan.org/pkg/babel
|
|
|
|
|
|
|
|
|
|
.. hint::
|
|
|
|
|
|
|
|
|
|
After modifiying a core LaTeX key like this one, clean up the LaTeX
|
|
|
|
|
build repertory before next PDF build, else left-over auxiliary
|
|
|
|
|
files are likely to break the build.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\usepackage{babel}'`` (``''`` for Japanese documents)
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5
|
|
|
|
|
For :confval:`latex_engine` set to ``'xelatex'``, the default
|
|
|
|
|
is ``'\\usepackage{polyglossia}\n\\setmainlanguage{<language>}'``.
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.6
|
|
|
|
|
``'lualatex'`` uses same default setting as ``'xelatex'``
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.7.6
|
|
|
|
|
For French, ``xelatex`` and ``lualatex`` default to using
|
|
|
|
|
``babel``, not ``polyglossia``.
|
|
|
|
|
|
|
|
|
|
``'fontpkg'``
|
2021-01-20 09:48:35 -06:00
|
|
|
|
Font package inclusion. The default is::
|
|
|
|
|
|
|
|
|
|
r"""\usepackage{tgtermes}
|
|
|
|
|
\usepackage{tgheros}
|
|
|
|
|
\renewcommand\ttdefault{txtt}
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
For ``'xelatex'`` and ``'lualatex'`` however the default is to use
|
|
|
|
|
the GNU FreeFont.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.2
|
|
|
|
|
Defaults to ``''`` when the :confval:`language` uses the Cyrillic
|
|
|
|
|
script.
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 2.0
|
2021-01-20 09:48:35 -06:00
|
|
|
|
Incorporates some font substitution commands to help support occasional
|
|
|
|
|
Greek or Cyrillic in a document using ``'pdflatex'`` engine.
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 4.0.0
|
2021-04-24 04:37:30 -05:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
- The font substitution commands added at ``2.0`` have been moved
|
|
|
|
|
to the ``'fontsubstitution'`` key, as their presence here made
|
|
|
|
|
it complicated for user to customize the value of ``'fontpkg'``.
|
|
|
|
|
- The default font setting has changed: it still uses Times and
|
|
|
|
|
Helvetica clones for serif and sans serif, but via better, more
|
|
|
|
|
complete TeX fonts and associated LaTeX packages. The
|
|
|
|
|
monospace font has been changed to better match the Times clone.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
``'fncychap'``
|
|
|
|
|
Inclusion of the "fncychap" package (which makes fancy chapter titles),
|
|
|
|
|
default ``'\\usepackage[Bjarne]{fncychap}'`` for English documentation
|
|
|
|
|
(this option is slightly customized by Sphinx),
|
|
|
|
|
``'\\usepackage[Sonny]{fncychap}'`` for internationalized docs (because
|
|
|
|
|
the "Bjarne" style uses numbers spelled out in English). Other
|
|
|
|
|
"fncychap" styles you can try are "Lenny", "Glenn", "Conny", "Rejne" and
|
|
|
|
|
"Bjornstrup". You can also set this to ``''`` to disable fncychap.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\usepackage[Bjarne]{fncychap}'`` for English documents,
|
2021-01-20 14:15:52 -06:00
|
|
|
|
``'\\usepackage[Sonny]{fncychap}'`` for internationalized documents, and
|
|
|
|
|
``''`` for Japanese documents.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
``'preamble'``
|
|
|
|
|
Additional preamble content. One may move all needed macros into some file
|
|
|
|
|
:file:`mystyle.tex.txt` of the project source repertory, and get LaTeX to
|
|
|
|
|
import it at run time::
|
|
|
|
|
|
|
|
|
|
'preamble': r'\input{mystyle.tex.txt}',
|
|
|
|
|
# or, if the \ProvidesPackage LaTeX macro is used in a file mystyle.sty
|
|
|
|
|
'preamble': r'\usepackage{mystyle}',
|
|
|
|
|
|
|
|
|
|
It is then needed to set appropriately :confval:`latex_additional_files`,
|
|
|
|
|
for example:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
latex_additional_files = ["mystyle.sty"]
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``''``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
``'figure_align'``
|
|
|
|
|
Latex figure float alignment. Whenever an image doesn't fit into the current
|
|
|
|
|
page, it will be 'floated' into the next page but may be preceded by any
|
|
|
|
|
other text. If you don't like this behavior, use 'H' which will disable
|
|
|
|
|
floating and position figures strictly in the order they appear in the
|
|
|
|
|
source.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'htbp'`` (here, top, bottom, page)
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.3
|
|
|
|
|
|
|
|
|
|
``'atendofbody'``
|
|
|
|
|
Additional document content (right before the indices).
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``''``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5
|
|
|
|
|
|
|
|
|
|
``'extrapackages'``
|
|
|
|
|
Additional LaTeX packages. For example:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
latex_elements = {
|
|
|
|
|
'packages': r'\usepackage{isodate}'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
The specified LaTeX packages will be loaded before
|
|
|
|
|
hyperref package and packages loaded from Sphinx extensions.
|
|
|
|
|
|
|
|
|
|
.. hint::
|
|
|
|
|
If you'd like to load additional LaTeX packages after hyperref, use
|
|
|
|
|
``'preamble'`` key instead.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``''``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 2.3
|
|
|
|
|
|
|
|
|
|
``'footer'``
|
|
|
|
|
Additional footer content (before the indices).
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``''``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. deprecated:: 1.5
|
|
|
|
|
Use ``'atendofbody'`` key instead.
|
|
|
|
|
|
|
|
|
|
Keys that don't need to be overridden unless in special cases are:
|
|
|
|
|
|
|
|
|
|
``'extraclassoptions'``
|
|
|
|
|
The default is the empty string. Example: ``'extraclassoptions':
|
|
|
|
|
'openany'`` will allow chapters (for documents of the ``'manual'``
|
|
|
|
|
type) to start on any page.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``''``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.2
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.6
|
|
|
|
|
Added this documentation.
|
|
|
|
|
|
|
|
|
|
``'maxlistdepth'``
|
|
|
|
|
LaTeX allows by default at most 6 levels for nesting list and
|
|
|
|
|
quote-like environments, with at most 4 enumerated lists, and 4 bullet
|
|
|
|
|
lists. Setting this key for example to ``'10'`` (as a string) will
|
|
|
|
|
allow up to 10 nested levels (of all sorts). Leaving it to the empty
|
|
|
|
|
string means to obey the LaTeX default.
|
|
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
|
|
- Using this key may prove incompatible with some LaTeX packages
|
|
|
|
|
or special document classes which do their own list customization.
|
|
|
|
|
|
|
|
|
|
- The key setting is silently *ignored* if ``\usepackage{enumitem}``
|
|
|
|
|
is executed inside the document preamble. Use then rather the
|
|
|
|
|
dedicated commands of this LaTeX package.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``6``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5
|
|
|
|
|
|
|
|
|
|
``'inputenc'``
|
|
|
|
|
"inputenc" package inclusion.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\usepackage[utf8]{inputenc}'`` when using pdflatex, else
|
2021-06-13 05:29:39 -05:00
|
|
|
|
``''``.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
If using ``utf8x`` in place of ``utf8`` it is mandatory to extend the
|
|
|
|
|
LaTeX preamble with suitable ``\PreloadUnicodePage{<number>}`` commands,
|
|
|
|
|
as per the ``utf8x`` documentation (``texdoc ucs`` on a TeXLive based
|
|
|
|
|
TeX installation). Else, unexpected and possibly hard-to-spot problems
|
|
|
|
|
(i.e. not causing a build crash) may arise in the PDF, in particular
|
|
|
|
|
regarding hyperlinks.
|
|
|
|
|
|
|
|
|
|
Even if these precautions are taken, PDF build via ``pdflatex`` engine
|
|
|
|
|
may crash due to upstream LaTeX not being fully compatible with
|
|
|
|
|
``utf8x``. For example, in certain circumstances related to
|
|
|
|
|
code-blocks, or attempting to include images whose filenames contain
|
|
|
|
|
Unicode characters. Indeed, starting in 2015, upstream LaTeX with
|
|
|
|
|
``pdflatex`` engine has somewhat enhanced native support for Unicode and
|
|
|
|
|
is becoming more and more incompatible with ``utf8x``. In particular,
|
|
|
|
|
since the October 2019 LaTeX release, filenames can use Unicode
|
|
|
|
|
characters, and even spaces. At Sphinx level this means e.g. that the
|
|
|
|
|
:dudir:`image` and :dudir:`figure` directives are now compatible with
|
|
|
|
|
such filenames for PDF via LaTeX output. But this is broken if
|
|
|
|
|
``utf8x`` is in use.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.4.3
|
|
|
|
|
Previously ``'\\usepackage[utf8]{inputenc}'`` was used for all
|
|
|
|
|
compilers.
|
|
|
|
|
|
|
|
|
|
``'cmappkg'``
|
|
|
|
|
"cmap" package inclusion.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\usepackage{cmap}'``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.2
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``'fontenc'``
|
2021-01-20 09:48:35 -06:00
|
|
|
|
Customize this from its default ``'\\usepackage[T1]{fontenc}'`` to:
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
- ``'\\usepackage[X2,T1]{fontenc}'`` if you need occasional
|
|
|
|
|
Cyrillic letters (физика частиц),
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
- ``'\\usepackage[LGR,T1]{fontenc}'`` if you need occasional
|
|
|
|
|
Greek letters (Σωματιδιακή φυσική).
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
Use ``[LGR,X2,T1]`` rather if both are needed.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. attention::
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
- Do not use this key for a :confval:`latex_engine` other than
|
|
|
|
|
``'pdflatex'``.
|
2016-10-11 11:16:47 -05:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
- If Greek is main language, do not use this key. Since Sphinx 2.2.1,
|
|
|
|
|
``xelatex`` will be used automatically as :confval:`latex_engine`.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
- The TeX installation may need some extra packages. For example,
|
|
|
|
|
on Ubuntu xenial, packages ``texlive-lang-greek`` and ``cm-super``
|
|
|
|
|
are needed for ``LGR`` to work. And ``texlive-lang-cyrillic`` and
|
|
|
|
|
``cm-super`` are needed for support of Cyrillic.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionchanged:: 1.5
|
|
|
|
|
Defaults to ``'\\usepackage{fontspec}'`` when
|
|
|
|
|
:confval:`latex_engine` is ``'xelatex'``.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionchanged:: 1.6
|
|
|
|
|
``'lualatex'`` uses ``fontspec`` per default like ``'xelatex'``.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionchanged:: 2.0
|
|
|
|
|
``'lualatex'`` executes
|
|
|
|
|
``\defaultfontfeatures[\rmfamily,\sffamily]{}`` to disable TeX
|
|
|
|
|
ligatures transforming `<<` and `>>` as escaping working with
|
|
|
|
|
``pdflatex/xelatex`` failed with ``lualatex``.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionchanged:: 2.0
|
|
|
|
|
Detection of ``LGR``, ``T2A``, ``X2`` to trigger support of
|
2021-01-20 09:48:35 -06:00
|
|
|
|
occasional Greek or Cyrillic letters (``'pdflatex'``).
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionchanged:: 2.3.0
|
2021-01-20 09:48:35 -06:00
|
|
|
|
``'xelatex'`` executes
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``\defaultfontfeatures[\rmfamily,\sffamily]{}`` in order to avoid
|
|
|
|
|
contractions of ``--`` into en-dash or transforms of straight quotes
|
|
|
|
|
into curly ones in PDF (in non-literal text paragraphs) despite
|
|
|
|
|
:confval:`smartquotes` being set to ``False``.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
``'fontsubstitution'``
|
|
|
|
|
Ignored if ``'fontenc'`` was not configured to use ``LGR`` or ``X2`` (or
|
|
|
|
|
``T2A``). In case ``'fontpkg'`` key is configured for usage with some
|
|
|
|
|
TeX fonts known to be available in the ``LGR`` or ``X2`` encodings, set
|
|
|
|
|
this one to be the empty string. Else leave to its default.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
Ignored with :confval:`latex_engine` other than ``'pdflatex'``.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
.. versionadded:: 4.0.0
|
2019-10-26 04:33:59 -05:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
``'textgreek'``
|
|
|
|
|
For the support of occasional Greek letters.
|
|
|
|
|
|
|
|
|
|
It is ignored with ``'platex'``, ``'xelatex'`` or ``'lualatex'`` as
|
|
|
|
|
:confval:`latex_engine` and defaults to either the empty string or
|
|
|
|
|
to ``'\\usepackage{textalpha}'`` for ``'pdflatex'`` depending on
|
|
|
|
|
whether the ``'fontenc'`` key was used with ``LGR`` or not. Only
|
|
|
|
|
expert LaTeX users may want to customize this key.
|
|
|
|
|
|
|
|
|
|
It can also be used as ``r'\usepackage{textalpha,alphabeta}'`` to let
|
|
|
|
|
``'pdflatex'`` support Greek Unicode input in :rst:dir:`math` context.
|
|
|
|
|
For example ``:math:`α``` (U+03B1) will render as :math:`\alpha`.
|
2019-10-26 04:33:59 -05:00
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\usepackage{textalpha}'`` or ``''`` if ``fontenc`` does not
|
2021-01-20 14:15:52 -06:00
|
|
|
|
include the ``LGR`` option.
|
2019-10-26 04:33:59 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionadded:: 2.0
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``'geometry'``
|
|
|
|
|
"geometry" package inclusion, the default definition is:
|
2016-10-11 11:16:47 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``'\\usepackage{geometry}'``
|
2016-10-11 11:16:47 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
with an additional ``[dvipdfm]`` for Japanese documents.
|
|
|
|
|
The Sphinx LaTeX style file executes:
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``\PassOptionsToPackage{hmargin=1in,vmargin=1in,marginpar=0.5in}{geometry}``
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
which can be customized via corresponding :ref:`'sphinxsetup' options
|
|
|
|
|
<latexsphinxsetup>`.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\usepackage{geometry}'`` (or
|
2021-01-20 14:15:52 -06:00
|
|
|
|
``'\\usepackage[dvipdfm]{geometry}'`` for Japanese documents)
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionadded:: 1.5
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5.2
|
|
|
|
|
``dvipdfm`` option if :confval:`latex_engine` is ``'platex'``.
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5.3
|
|
|
|
|
The :ref:`'sphinxsetup' keys for the margins
|
|
|
|
|
<latexsphinxsetuphmargin>`.
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5.3
|
|
|
|
|
The location in the LaTeX file has been moved to after
|
|
|
|
|
``\usepackage{sphinx}`` and ``\sphinxsetup{..}``, hence also after
|
|
|
|
|
insertion of ``'fontpkg'`` key. This is in order to handle the paper
|
|
|
|
|
layout options in a special way for Japanese documents: the text
|
|
|
|
|
width will be set to an integer multiple of the *zenkaku* width, and
|
|
|
|
|
the text height to an integer multiple of the baseline. See the
|
|
|
|
|
:ref:`hmargin <latexsphinxsetuphmargin>` documentation for more.
|
|
|
|
|
|
|
|
|
|
``'hyperref'``
|
|
|
|
|
"hyperref" package inclusion; also loads package "hypcap" and issues
|
|
|
|
|
``\urlstyle{same}``. This is done after :file:`sphinx.sty` file is
|
|
|
|
|
loaded and before executing the contents of ``'preamble'`` key.
|
|
|
|
|
|
|
|
|
|
.. attention::
|
|
|
|
|
|
|
|
|
|
Loading of packages "hyperref" and "hypcap" is mandatory.
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5
|
|
|
|
|
Previously this was done from inside :file:`sphinx.sty`.
|
|
|
|
|
|
|
|
|
|
``'maketitle'``
|
|
|
|
|
"maketitle" call. Override if you want to generate a differently styled
|
|
|
|
|
title page.
|
|
|
|
|
|
|
|
|
|
.. hint::
|
|
|
|
|
|
|
|
|
|
If the key value is set to
|
|
|
|
|
``r'\newcommand\sphinxbackoftitlepage{<Extra
|
|
|
|
|
material>}\sphinxmaketitle'``, then ``<Extra material>`` will be
|
|
|
|
|
typeset on back of title page (``'manual'`` docclass only).
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\sphinxmaketitle'``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.8.3
|
|
|
|
|
Original ``\maketitle`` from document class is not overwritten,
|
|
|
|
|
hence is re-usable as part of some custom setting for this key.
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.8.3
|
|
|
|
|
``\sphinxbackoftitlepage`` optional macro. It can also be defined
|
|
|
|
|
inside ``'preamble'`` key rather than this one.
|
|
|
|
|
|
|
|
|
|
``'releasename'``
|
|
|
|
|
Value that prefixes ``'release'`` element on title page. As for *title* and
|
|
|
|
|
*author* used in the tuples of :confval:`latex_documents`, it is inserted as
|
|
|
|
|
LaTeX markup.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'Release'``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
``'tableofcontents'``
|
|
|
|
|
"tableofcontents" call. The default of ``'\\sphinxtableofcontents'`` is a
|
|
|
|
|
wrapper of unmodified ``\tableofcontents``, which may itself be customized
|
|
|
|
|
by user loaded packages. Override if you want to generate a different table
|
|
|
|
|
of contents or put content between the title page and the TOC.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\sphinxtableofcontents'``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5
|
|
|
|
|
Previously the meaning of ``\tableofcontents`` itself was modified
|
|
|
|
|
by Sphinx. This created an incompatibility with dedicated packages
|
|
|
|
|
modifying it also such as "tocloft" or "etoc".
|
|
|
|
|
|
|
|
|
|
``'transition'``
|
|
|
|
|
Commands used to display transitions. Override if you want to display
|
|
|
|
|
transitions differently.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\n\n\\bigskip\\hrule\\bigskip\n\n'``
|
2017-02-06 07:20:25 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionadded:: 1.2
|
2016-10-11 11:16:47 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionchanged:: 1.6
|
|
|
|
|
Remove unneeded ``{}`` after ``\\hrule``.
|
2018-04-02 12:46:40 -05:00
|
|
|
|
|
2021-02-08 07:55:30 -06:00
|
|
|
|
``'makeindex'``
|
|
|
|
|
"makeindex" call, the last thing before ``\begin{document}``. With
|
|
|
|
|
``'\\usepackage[columns=1]{idxlayout}\\makeindex'`` the index will use
|
|
|
|
|
only one column. You may have to install ``idxlayout`` LaTeX package.
|
|
|
|
|
|
|
|
|
|
Default: ``'\\makeindex'``
|
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``'printindex'``
|
|
|
|
|
"printindex" call, the last thing in the file. Override if you want to
|
2021-02-08 07:55:30 -06:00
|
|
|
|
generate the index differently, append some content after the index, or
|
|
|
|
|
change the font. As LaTeX uses two-column mode for the index it is
|
|
|
|
|
often advisable to set this key to
|
|
|
|
|
``'\\footnotesize\\raggedright\\printindex'``. Or, to obtain a one-column
|
|
|
|
|
index, use ``'\\def\\twocolumn[#1]{#1}\\printindex'`` (this trick may fail
|
|
|
|
|
if using a custom document class; then try the ``idxlayout`` approach
|
|
|
|
|
described in the documentation of the ``'makeindex'`` key).
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``'\\printindex'``
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``'fvset'``
|
2021-01-20 09:48:35 -06:00
|
|
|
|
Customization of ``fancyvrb`` LaTeX package.
|
2019-09-30 04:52:34 -05:00
|
|
|
|
|
2021-01-20 09:48:35 -06:00
|
|
|
|
The default value is ``'\\fvset{fontsize=auto}'`` which means that the
|
|
|
|
|
font size will adjust correctly if a code-block ends up in a footnote.
|
|
|
|
|
You may need to modify this if you use custom fonts:
|
|
|
|
|
``'\\fvset{fontsize=\\small}'`` if the monospace font is Courier-like.
|
|
|
|
|
|
|
|
|
|
Default: ``'\\fvset{fontsize=auto}'``
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionadded:: 1.8
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. versionchanged:: 2.0
|
2021-01-20 09:48:35 -06:00
|
|
|
|
For ``'xelatex'`` and ``'lualatex'`` defaults to
|
|
|
|
|
``'\\fvset{fontsize=\\small}'`` as this
|
|
|
|
|
is adapted to the relative widths of the FreeFont family.
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 4.0.0
|
|
|
|
|
Changed default for ``'pdflatex'``. Previously it was using
|
|
|
|
|
``'\\fvset{fontsize=\\small}'``.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Keys that are set by other options and therefore should not be overridden are:
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``'docclass'``
|
|
|
|
|
``'classoptions'``
|
|
|
|
|
``'title'``
|
|
|
|
|
``'release'``
|
|
|
|
|
``'author'``
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. _latexsphinxsetup:
|
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The ``sphinxsetup`` configuration setting
|
|
|
|
|
-----------------------------------------
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5
|
2019-01-10 09:43:54 -06:00
|
|
|
|
|
|
|
|
|
The ``'sphinxsetup'`` key of :ref:`latex_elements <latex_elements_confval>`
|
|
|
|
|
provides a LaTeX-type customization interface::
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
latex_elements = {
|
|
|
|
|
'sphinxsetup': 'key1=value1, key2=value2, ...',
|
|
|
|
|
}
|
2016-10-29 07:03:12 -05:00
|
|
|
|
|
2019-01-10 09:43:54 -06:00
|
|
|
|
It defaults to empty. If non-empty, it will be passed as argument to the
|
|
|
|
|
``\sphinxsetup`` macro inside the document preamble, like this::
|
2017-06-05 05:11:41 -05:00
|
|
|
|
|
|
|
|
|
\usepackage{sphinx}
|
|
|
|
|
\sphinxsetup{key1=value1, key2=value2,...}
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The colors used in the above are provided by the ``svgnames`` option of the
|
|
|
|
|
"xcolor" package::
|
2016-10-28 14:45:44 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
latex_elements = {
|
|
|
|
|
'passoptionstopackages': r'\PassOptionsToPackage{svgnames}{xcolor}',
|
|
|
|
|
}
|
2016-10-29 09:30:33 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
It is possible to insert further uses of the ``\sphinxsetup`` LaTeX macro
|
|
|
|
|
directly into the body of the document, via the help of the :rst:dir:`raw`
|
|
|
|
|
directive. This chapter is styled in the PDF output using the following at the
|
|
|
|
|
start of the chaper::
|
2016-10-29 09:30:33 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. raw:: latex
|
2016-10-28 14:45:44 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
\begingroup
|
|
|
|
|
\sphinxsetup{%
|
|
|
|
|
verbatimwithframe=false,
|
|
|
|
|
VerbatimColor={named}{OldLace},
|
|
|
|
|
TitleColor={named}{DarkGoldenrod},
|
|
|
|
|
hintBorderColor={named}{LightCoral},
|
|
|
|
|
attentionborder=3pt,
|
|
|
|
|
attentionBorderColor={named}{Crimson},
|
|
|
|
|
attentionBgColor={named}{FloralWhite},
|
|
|
|
|
noteborder=2pt,
|
|
|
|
|
noteBorderColor={named}{Olive},
|
|
|
|
|
cautionborder=3pt,
|
|
|
|
|
cautionBorderColor={named}{Cyan},
|
|
|
|
|
cautionBgColor={named}{LightCyan}}
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The below is included at the end of the chapter::
|
2016-10-29 17:08:17 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
.. raw:: latex
|
2016-10-29 17:08:17 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
\endgroup
|
2017-01-16 08:15:07 -06:00
|
|
|
|
|
2021-02-09 09:04:01 -06:00
|
|
|
|
LaTeX syntax for boolean keys requires *lowercase* ``true`` or ``false``
|
2021-02-09 05:03:55 -06:00
|
|
|
|
e.g ``'sphinxsetup': "verbatimwrapslines=false"``. If setting the
|
|
|
|
|
boolean key to ``true``, ``=true`` is optional.
|
2019-01-10 09:43:54 -06:00
|
|
|
|
Spaces around the commas and equal signs are ignored, spaces inside LaTeX
|
|
|
|
|
macros may be significant.
|
2021-02-18 05:47:14 -06:00
|
|
|
|
Do not use quotes to enclose values, whether numerical or strings.
|
|
|
|
|
|
|
|
|
|
``bookmarksdepth``
|
|
|
|
|
Controls the depth of the collapsable bookmarks panel in the PDF.
|
|
|
|
|
May be either a number (e.g. ``3``) or a LaTeX sectioning name (e.g.
|
|
|
|
|
``subsubsection``, i.e. without backslash).
|
|
|
|
|
For details, refer to the ``hyperref`` LaTeX docs.
|
|
|
|
|
|
|
|
|
|
Default: ``5``
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 4.0.0
|
2017-01-16 08:15:07 -06:00
|
|
|
|
|
2017-02-06 07:20:25 -06:00
|
|
|
|
.. _latexsphinxsetuphmargin:
|
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
``hmargin, vmargin``
|
|
|
|
|
The dimensions of the horizontal (resp. vertical) margins, passed as
|
2018-10-05 04:26:22 -05:00
|
|
|
|
``hmargin`` (resp. ``vmargin``) option to the ``geometry`` package.
|
|
|
|
|
Example::
|
2017-02-03 17:00:05 -06:00
|
|
|
|
|
|
|
|
|
'sphinxsetup': 'hmargin={2in,1.5in}, vmargin={1.5in,2in}, marginpar=1in',
|
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
Japanese documents currently accept only the one-dimension format for
|
|
|
|
|
these parameters. The ``geometry`` package is then passed suitable options
|
|
|
|
|
to get the text width set to an exact multiple of the *zenkaku* width, and
|
|
|
|
|
the text height set to an integer multiple of the baselineskip, with the
|
|
|
|
|
closest fit for the margins.
|
2017-02-03 17:00:05 -06:00
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``1in`` (equivalent to ``{1in,1in}``)
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2017-02-06 06:55:25 -06:00
|
|
|
|
.. hint::
|
2017-02-03 17:00:05 -06:00
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
For Japanese ``'manual'`` docclass with pointsize ``11pt`` or ``12pt``,
|
|
|
|
|
use the ``nomag`` extra document class option (cf.
|
|
|
|
|
``'extraclassoptions'`` key of :confval:`latex_elements`) or so-called
|
2017-06-05 12:42:47 -05:00
|
|
|
|
TeX "true" units::
|
2017-02-03 17:00:05 -06:00
|
|
|
|
|
2017-02-05 13:02:19 -06:00
|
|
|
|
'sphinxsetup': 'hmargin=1.5truein, vmargin=1.5truein, marginpar=5zw',
|
2017-02-03 17:00:05 -06:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5.3
|
|
|
|
|
|
|
|
|
|
``marginpar``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The ``\marginparwidth`` LaTeX dimension. For Japanese documents, the value
|
|
|
|
|
is modified to be the closest integer multiple of the *zenkaku* width.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``0.5in``
|
2017-02-03 17:00:05 -06:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5.3
|
|
|
|
|
|
2016-10-27 13:24:33 -05:00
|
|
|
|
``verbatimwithframe``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Boolean to specify if :rst:dir:`code-block`\ s and literal includes are
|
|
|
|
|
framed. Setting it to ``false`` does not deactivate use of package
|
|
|
|
|
"framed", because it is still in use for the optional background colour.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``true``.
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``verbatimwrapslines``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Boolean to specify if long lines in :rst:dir:`code-block`\ 's contents are
|
|
|
|
|
wrapped.
|
|
|
|
|
|
2021-02-09 05:03:55 -06:00
|
|
|
|
If ``true``, line breaks may happen at spaces (the last space before the
|
|
|
|
|
line break will be rendered using a special symbol), and at ascii
|
|
|
|
|
punctuation characters (i.e. not at letters or digits). Whenever a long
|
|
|
|
|
string has no break points, it is moved to next line. If its length is
|
|
|
|
|
longer than the line width it will overflow.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``true``
|
2016-10-29 07:03:12 -05:00
|
|
|
|
|
2021-02-09 08:47:15 -06:00
|
|
|
|
.. _latexsphinxsetupforcewraps:
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2021-02-08 16:13:46 -06:00
|
|
|
|
``verbatimforcewraps``
|
|
|
|
|
Boolean to specify if long lines in :rst:dir:`code-block`\ 's contents
|
2021-02-09 05:03:55 -06:00
|
|
|
|
should be forcefully wrapped to never overflow due to long strings.
|
2017-06-16 07:24:40 -05:00
|
|
|
|
|
2021-02-09 05:28:03 -06:00
|
|
|
|
.. note::
|
2021-02-09 05:03:55 -06:00
|
|
|
|
|
|
|
|
|
It is assumed that the Pygments_ LaTeXFormatter has not been used with
|
|
|
|
|
its ``texcomments`` or similar options which allow additional
|
|
|
|
|
(arbitrary) LaTeX mark-up.
|
|
|
|
|
|
|
|
|
|
Also, in case of :confval:`latex_engine` set to ``'pdflatex'``, only
|
|
|
|
|
the default LaTeX handling of Unicode code points, i.e. ``utf8`` not
|
|
|
|
|
``utf8x`` is allowed.
|
2021-02-08 16:13:46 -06:00
|
|
|
|
|
2021-02-09 05:33:16 -06:00
|
|
|
|
.. _Pygments: https://pygments.org/
|
|
|
|
|
|
2021-02-08 16:13:46 -06:00
|
|
|
|
Default: ``false``
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.5.0
|
|
|
|
|
|
2021-02-09 05:03:55 -06:00
|
|
|
|
``verbatimmaxoverfull``
|
|
|
|
|
A number. If an unbreakable long string has length larger than the total
|
|
|
|
|
linewidth plus this number of characters, and if ``verbatimforcewraps``
|
|
|
|
|
mode is on, the input line will be reset using the forceful algorithm
|
|
|
|
|
which applies breakpoints at each character.
|
|
|
|
|
|
|
|
|
|
Default: ``3``
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.5.0
|
|
|
|
|
|
|
|
|
|
``verbatimmaxunderfull``
|
|
|
|
|
A number. If ``verbatimforcewraps`` mode applies, and if after applying
|
|
|
|
|
the line wrapping at spaces and punctuation, the first part of the split
|
|
|
|
|
line is lacking at least that number of characters to fill the available
|
|
|
|
|
width, then the input line will be reset using the forceful algorithm.
|
|
|
|
|
|
|
|
|
|
As the default is set to a high value, the forceful algorithm is triggered
|
|
|
|
|
only in overfull case, i.e. in presence of a string longer than full
|
|
|
|
|
linewidth. Set this to ``0`` to force all input lines to be hard wrapped
|
|
|
|
|
at the current avaiable linewidth::
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2021-02-09 05:03:55 -06:00
|
|
|
|
latex_elements = {
|
|
|
|
|
'sphinxsetup': "verbatimforcewraps, verbatimmaxunderfull=0",
|
|
|
|
|
}
|
2017-06-16 07:24:40 -05:00
|
|
|
|
|
2021-02-09 05:03:55 -06:00
|
|
|
|
This can be done locally for a given code-block via the use of raw latex
|
2021-02-09 08:47:15 -06:00
|
|
|
|
directives to insert suitable ``\sphinxsetup`` (before and after) into the
|
|
|
|
|
latex file.
|
2021-02-09 05:03:55 -06:00
|
|
|
|
|
|
|
|
|
Default: ``100``
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.5.0
|
2017-06-16 07:24:40 -05:00
|
|
|
|
|
2017-05-23 08:58:03 -05:00
|
|
|
|
``verbatimhintsturnover``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Boolean to specify if code-blocks display "continued on next page" and
|
|
|
|
|
"continued from previous page" hints in case of pagebreaks.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``true``
|
2017-05-23 08:58:03 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.6.3
|
2017-06-16 07:24:40 -05:00
|
|
|
|
.. versionchanged:: 1.7
|
|
|
|
|
the default changed from ``false`` to ``true``.
|
|
|
|
|
|
|
|
|
|
``verbatimcontinuedalign``, ``verbatimcontinuesalign``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Horizontal position relative to the framed contents: either ``l`` (left
|
|
|
|
|
aligned), ``r`` (right aligned) or ``c`` (centered).
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``r``
|
2017-06-16 07:24:40 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.7
|
2017-05-23 08:58:03 -05:00
|
|
|
|
|
2017-01-14 05:32:20 -06:00
|
|
|
|
``parsedliteralwraps``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Boolean to specify if long lines in :dudir:`parsed-literal`\ 's contents
|
|
|
|
|
should wrap.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``true``
|
2017-01-14 05:32:20 -06:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5.2
|
|
|
|
|
set this option value to ``false`` to recover former behaviour.
|
|
|
|
|
|
2016-11-05 10:43:13 -05:00
|
|
|
|
``inlineliteralwraps``
|
2020-05-30 09:22:57 -05:00
|
|
|
|
Boolean to specify if line breaks are allowed inside inline literals: but
|
2018-10-05 04:26:22 -05:00
|
|
|
|
extra potential break-points (additionally to those allowed by LaTeX at
|
|
|
|
|
spaces or for hyphenation) are currently inserted only after the characters
|
2019-11-06 11:42:52 -06:00
|
|
|
|
``. , ; ? ! /`` and ``\``. Due to TeX internals, white space in the line
|
2018-10-05 04:26:22 -05:00
|
|
|
|
will be stretched (or shrunk) in order to accommodate the linebreak.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``true``
|
2016-11-05 10:43:13 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5
|
2017-01-14 05:32:20 -06:00
|
|
|
|
set this option value to ``false`` to recover former behaviour.
|
2016-11-05 10:43:13 -05:00
|
|
|
|
|
2019-11-06 11:42:52 -06:00
|
|
|
|
.. versionchanged:: 2.3.0
|
|
|
|
|
added potential breakpoint at ``\`` characters.
|
|
|
|
|
|
2016-10-28 14:45:44 -05:00
|
|
|
|
``verbatimvisiblespace``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
When a long code line is split, the last space character from the source
|
|
|
|
|
code line right before the linebreak location is typeset using this.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``\textcolor{red}{\textvisiblespace}``
|
2016-10-28 14:45:44 -05:00
|
|
|
|
|
|
|
|
|
``verbatimcontinued``
|
2017-06-05 05:11:41 -05:00
|
|
|
|
A LaTeX macro inserted at start of continuation code lines. Its
|
|
|
|
|
(complicated...) default typesets a small red hook pointing to the right::
|
2016-10-29 07:03:12 -05:00
|
|
|
|
|
2016-10-29 09:30:33 -05:00
|
|
|
|
\makebox[2\fontcharwd\font`\x][r]{\textcolor{red}{\tiny$\hookrightarrow$}}
|
2016-10-29 07:03:12 -05:00
|
|
|
|
|
2016-10-28 14:45:44 -05:00
|
|
|
|
.. versionchanged:: 1.5
|
2017-06-05 05:11:41 -05:00
|
|
|
|
The breaking of long code lines was added at 1.4.2. The default
|
|
|
|
|
definition of the continuation symbol was changed at 1.5 to accomodate
|
|
|
|
|
various font sizes (e.g. code-blocks can be in footnotes).
|
2016-10-28 14:45:44 -05:00
|
|
|
|
|
2016-10-27 13:24:33 -05:00
|
|
|
|
``TitleColor``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The colour for titles (as configured via use of package "titlesec".)
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{0.126,0.263,0.361}``
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|
2021-02-09 11:29:56 -06:00
|
|
|
|
.. warning::
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|
2021-02-09 11:29:56 -06:00
|
|
|
|
Colours set via ``'sphinxsetup'`` must obey the syntax of the
|
|
|
|
|
argument of the ``color/xcolor`` packages ``\definecolor`` command.
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``InnerLinkColor``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
A colour passed to ``hyperref`` as value of ``linkcolor`` and
|
|
|
|
|
``citecolor``.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{0.208,0.374,0.486}``.
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``OuterLinkColor``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
A colour passed to ``hyperref`` as value of ``filecolor``, ``menucolor``,
|
|
|
|
|
and ``urlcolor``.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{0.216,0.439,0.388}``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``VerbatimColor``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The background colour for :rst:dir:`code-block`\ s.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{1,1,1}`` (white)
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``VerbatimBorderColor``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The frame color.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{0,0,0}`` (black)
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-12-10 05:16:35 -06:00
|
|
|
|
``VerbatimHighlightColor``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The color for highlighted lines.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{0.878,1,1}``
|
2017-12-10 05:16:35 -06:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.6.6
|
|
|
|
|
|
2021-02-09 11:25:37 -06:00
|
|
|
|
.. note::
|
2017-12-11 16:09:19 -06:00
|
|
|
|
|
2021-02-09 11:25:37 -06:00
|
|
|
|
Starting with this colour, and for all others following, the
|
|
|
|
|
names declared to "color" or "xcolor" are prefixed with "sphinx".
|
2017-12-11 16:09:19 -06:00
|
|
|
|
|
2016-10-27 13:24:33 -05:00
|
|
|
|
``verbatimsep``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The separation between code lines and the frame.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``\fboxsep``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``verbatimborder``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The width of the frame around :rst:dir:`code-block`\ s.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``\fboxrule``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``shadowsep``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The separation between contents and frame for :dudir:`contents` and
|
|
|
|
|
:dudir:`topic` boxes.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``5pt``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``shadowsize``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The width of the lateral "shadow" to the right.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``4pt``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``shadowrule``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The width of the frame around :dudir:`topic` boxes.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``\fboxrule``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|notebdcolors|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The colour for the two horizontal rules used by Sphinx in LaTeX for styling
|
|
|
|
|
a :dudir:`note` type admonition.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{0,0,0}`` (black)
|
2016-10-29 07:03:12 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
``noteborder``, ``hintborder``, ``importantborder``, ``tipborder``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The width of the two horizontal rules.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``0.5pt``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
.. only:: not latex
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|warningbdcolors|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The colour for the admonition frame.
|
|
|
|
|
|
2021-01-20 14:15:52 -06:00
|
|
|
|
Default: ``{rgb}{0,0,0}`` (black)
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
.. only:: latex
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|wgbdcolorslatex|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The colour for the admonition frame.
|
|
|
|
|
|
2021-01-20 14:15:52 -06:00
|
|
|
|
Default: ``{rgb}{0,0,0}`` (black)
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|warningbgcolors|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The background colours for the respective admonitions.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``{rgb}{1,1,1}`` (white)
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|warningborders|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
The width of the frame.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``1pt``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``AtStartFootnote``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
LaTeX macros inserted at the start of the footnote text at bottom of page,
|
|
|
|
|
after the footnote number.
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``\mbox{ }``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
``BeforeFootnote``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
LaTeX macros inserted before the footnote mark. The default removes
|
|
|
|
|
possible space before it (else, TeX could insert a line break there).
|
|
|
|
|
|
2020-05-30 09:42:46 -05:00
|
|
|
|
Default: ``\leavevmode\unskip``
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5
|
|
|
|
|
|
|
|
|
|
``HeaderFamily``
|
2016-10-29 09:30:33 -05:00
|
|
|
|
default ``\sffamily\bfseries``. Sets the font used by headings.
|
|
|
|
|
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|
|
|
|
|
.. |notebdcolors| replace:: ``noteBorderColor``, ``hintBorderColor``,
|
|
|
|
|
``importantBorderColor``, ``tipBorderColor``
|
|
|
|
|
|
|
|
|
|
.. |warningbdcolors| replace:: ``warningBorderColor``, ``cautionBorderColor``,
|
|
|
|
|
``attentionBorderColor``, ``dangerBorderColor``,
|
|
|
|
|
``errorBorderColor``
|
|
|
|
|
|
2021-02-09 11:11:24 -06:00
|
|
|
|
.. |wgbdcolorslatex| replace:: ``warningBorderColor``, and
|
|
|
|
|
``(caution|attention|danger|error)BorderColor``
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|
|
|
|
|
.. else latex goes into right margin, as it does not hyphenate the names
|
|
|
|
|
|
|
|
|
|
.. |warningbgcolors| replace:: ``warningBgColor``, ``cautionBgColor``,
|
|
|
|
|
``attentionBgColor``, ``dangerBgColor``,
|
|
|
|
|
``errorBgColor``
|
|
|
|
|
|
2018-12-11 07:06:48 -06:00
|
|
|
|
.. |warningborders| replace:: ``warningborder``, ``cautionborder``,
|
|
|
|
|
``attentionborder``, ``dangerborder``,
|
|
|
|
|
``errorborder``
|
2017-06-05 09:30:14 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
LaTeX macros and environments
|
|
|
|
|
-----------------------------
|
2016-10-27 13:24:33 -05:00
|
|
|
|
|
2021-01-27 07:08:28 -06:00
|
|
|
|
The "LaTeX package" file :file:`sphinx.sty` loads various components
|
|
|
|
|
providing support macros (aka commands), and environments, which are used in
|
|
|
|
|
the mark-up produced on output from the ``latex`` builder, before conversion
|
|
|
|
|
to ``pdf`` via the LaTeX toolchain. Also the "LaTeX class" files
|
|
|
|
|
:file:`sphinxhowto.cls` and :file:`sphinxmanual.cls` define or customize some
|
|
|
|
|
environments. All of these files can be found in the latex build repertory.
|
|
|
|
|
|
|
|
|
|
Some of these provide facilities not available from pre-existing LaTeX
|
|
|
|
|
packages and work around LaTeX limitations with lists, table cells, verbatim
|
|
|
|
|
rendering, footnotes, etc...
|
|
|
|
|
|
|
|
|
|
Others simply define macros with public names to make overwriting their
|
|
|
|
|
defaults easy via user-added contents to the preamble. We will survey most of
|
|
|
|
|
those public names here, but defaults have to be looked at in their respective
|
|
|
|
|
definition files.
|
|
|
|
|
|
|
|
|
|
.. hint::
|
|
|
|
|
|
|
|
|
|
Sphinx LaTeX support code is split across multiple smaller-sized files.
|
|
|
|
|
Rather than adding code to the preamble via
|
|
|
|
|
`latex_elements <latex_elements_confval_>`_\ [``'preamble'``] it is
|
|
|
|
|
also possible to replace entirely one of the component files of Sphinx
|
|
|
|
|
LaTeX code with a custom version, simply by including a modified copy in
|
|
|
|
|
the project source and adding the filename to the
|
|
|
|
|
:confval:`latex_additional_files` list. Check the LaTeX build repertory
|
|
|
|
|
for the filenames and contents.
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 4.0.0
|
|
|
|
|
split of :file:`sphinx.sty` into multiple smaller units, to facilitate
|
|
|
|
|
customization of many aspects simultaneously.
|
2016-10-28 14:45:44 -05:00
|
|
|
|
|
2018-12-22 10:33:03 -06:00
|
|
|
|
.. _latex-macros:
|
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
Macros
|
|
|
|
|
~~~~~~
|
2016-10-11 11:16:47 -05:00
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
- Text styling commands:
|
2019-04-12 12:21:34 -05:00
|
|
|
|
|
|
|
|
|
- ``\sphinxstrong``,
|
|
|
|
|
- ``\sphinxbfcode``,
|
|
|
|
|
- ``\sphinxemail``,
|
|
|
|
|
- ``\sphinxtablecontinued``,
|
|
|
|
|
- ``\sphinxtitleref``,
|
|
|
|
|
- ``\sphinxmenuselection``,
|
|
|
|
|
- ``\sphinxaccelerator``,
|
|
|
|
|
- ``\sphinxcrossref``,
|
|
|
|
|
- ``\sphinxtermref``,
|
|
|
|
|
- ``\sphinxoptional``.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2017-03-01 15:26:49 -06:00
|
|
|
|
.. versionadded:: 1.4.5
|
|
|
|
|
Use of ``\sphinx`` prefixed macro names to limit possibilities of conflict
|
|
|
|
|
with LaTeX packages.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- More text styling:
|
2019-04-12 12:21:34 -05:00
|
|
|
|
|
|
|
|
|
- ``\sphinxstyleindexentry``,
|
|
|
|
|
- ``\sphinxstyleindexextra``,
|
|
|
|
|
- ``\sphinxstyleindexpageref``,
|
|
|
|
|
- ``\sphinxstyletopictitle``,
|
|
|
|
|
- ``\sphinxstylesidebartitle``,
|
|
|
|
|
- ``\sphinxstyleothertitle``,
|
|
|
|
|
- ``\sphinxstylesidebarsubtitle``,
|
|
|
|
|
- ``\sphinxstyletheadfamily``,
|
|
|
|
|
- ``\sphinxstyleemphasis``,
|
|
|
|
|
- ``\sphinxstyleliteralemphasis``,
|
|
|
|
|
- ``\sphinxstylestrong``,
|
|
|
|
|
- ``\sphinxstyleliteralstrong``,
|
|
|
|
|
- ``\sphinxstyleabbreviation``,
|
|
|
|
|
- ``\sphinxstyleliteralintitle``,
|
|
|
|
|
- ``\sphinxstylecodecontinued``,
|
|
|
|
|
- ``\sphinxstylecodecontinues``.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2016-06-18 13:25:48 -05:00
|
|
|
|
.. versionadded:: 1.5
|
2018-10-05 04:26:22 -05:00
|
|
|
|
These macros were formerly hard-coded as non customizable ``\texttt``,
|
2017-06-05 05:11:41 -05:00
|
|
|
|
``\emph``, etc...
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2017-05-07 04:10:41 -05:00
|
|
|
|
.. versionadded:: 1.6
|
|
|
|
|
``\sphinxstyletheadfamily`` which defaults to ``\sffamily`` and allows
|
|
|
|
|
multiple paragraphs in header cells of tables.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2017-05-23 08:58:03 -05:00
|
|
|
|
.. versionadded:: 1.6.3
|
|
|
|
|
``\sphinxstylecodecontinued`` and ``\sphinxstylecodecontinues``.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2020-03-05 08:46:58 -06:00
|
|
|
|
.. versionadded:: 3.0
|
2020-01-09 04:05:05 -06:00
|
|
|
|
``\sphinxkeyboard``
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- ``\sphinxtableofcontents``: A wrapper (defined differently in
|
|
|
|
|
:file:`sphinxhowto.cls` and in :file:`sphinxmanual.cls`) of standard
|
|
|
|
|
``\tableofcontents``. The macro ``\sphinxtableofcontentshook`` is executed
|
|
|
|
|
during its expansion right before ``\tableofcontents`` itself.
|
2017-06-05 05:11:41 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Formerly, the meaning of ``\tableofcontents`` was modified by Sphinx.
|
|
|
|
|
|
2018-12-22 10:33:03 -06:00
|
|
|
|
.. versionchanged:: 2.0
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Hard-coded redefinitions of ``\l@section`` and ``\l@subsection`` formerly
|
2018-12-22 10:33:03 -06:00
|
|
|
|
done during loading of ``'manual'`` docclass are now executed later via
|
|
|
|
|
``\sphinxtableofcontentshook``. This macro is also executed by the
|
|
|
|
|
``'howto'`` docclass, but defaults to empty with it.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- ``\sphinxmaketitle``: Used as the default setting of the ``'maketitle'``
|
|
|
|
|
:confval:`latex_elements` key.
|
|
|
|
|
Defined in the class files :file:`sphinxmanual.cls` and
|
|
|
|
|
:file:`sphinxhowto.cls`.
|
2018-12-21 14:38:27 -06:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.8.3
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Formerly, ``\maketitle`` from LaTeX document class was modified by
|
2018-12-21 14:38:27 -06:00
|
|
|
|
Sphinx.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- ``\sphinxbackoftitlepage``: For ``'manual'`` docclass, and if it is
|
2019-04-12 12:30:31 -05:00
|
|
|
|
defined, it gets executed at end of ``\sphinxmaketitle``, before the final
|
2018-12-21 14:38:27 -06:00
|
|
|
|
``\clearpage``. Use either the ``'maketitle'`` key or the ``'preamble'`` key
|
|
|
|
|
of :confval:`latex_elements` to add a custom definition of
|
|
|
|
|
``\sphinxbackoftitlepage``.
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.8.3
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- ``\sphinxcite``: A wrapper of standard ``\cite`` for citation references.
|
2017-06-05 05:11:41 -05:00
|
|
|
|
|
|
|
|
|
Environments
|
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
- A :dudir:`figure` may have an optional legend with arbitrary body
|
2017-05-04 02:36:04 -05:00
|
|
|
|
elements: they are rendered in a ``sphinxlegend`` environment. The default
|
|
|
|
|
definition issues ``\small``, and ends with ``\par``.
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.5.6
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Formerly, the ``\small`` was hardcoded in LaTeX writer and the ending
|
2017-05-04 02:36:04 -05:00
|
|
|
|
``\par`` was lacking.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- Environments associated with admonitions:
|
2019-04-12 12:30:31 -05:00
|
|
|
|
|
|
|
|
|
- ``sphinxnote``,
|
|
|
|
|
- ``sphinxhint``,
|
|
|
|
|
- ``sphinximportant``,
|
|
|
|
|
- ``sphinxtip``,
|
|
|
|
|
- ``sphinxwarning``,
|
|
|
|
|
- ``sphinxcaution``,
|
|
|
|
|
- ``sphinxattention``,
|
|
|
|
|
- ``sphinxdanger``,
|
|
|
|
|
- ``sphinxerror``.
|
|
|
|
|
|
|
|
|
|
They may be ``\renewenvironment``
|
2016-06-18 13:25:48 -05:00
|
|
|
|
'd individually, and must then be defined with one argument (it is the heading
|
|
|
|
|
of the notice, for example ``Warning:`` for :dudir:`warning` directive, if
|
|
|
|
|
English is the document language). Their default definitions use either the
|
2019-04-12 12:30:31 -05:00
|
|
|
|
*sphinxheavybox* (for the last 5 ones) or the *sphinxlightbox*
|
2016-06-18 13:25:48 -05:00
|
|
|
|
environments, configured to use the parameters (colours, border thickness)
|
2016-11-05 10:58:01 -05:00
|
|
|
|
specific to each type, which can be set via ``'sphinxsetup'`` string.
|
2016-06-18 13:25:48 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Use of public environment names, separate customizability of the
|
2017-06-05 05:11:41 -05:00
|
|
|
|
parameters, such as ``noteBorderColor``, ``noteborder``,
|
|
|
|
|
``warningBgColor``, ``warningBorderColor``, ``warningborder``, ...
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- The :dudir:`contents` directive (with ``:local:`` option) and the
|
2016-06-18 13:25:48 -05:00
|
|
|
|
:dudir:`topic` directive are implemented by environment ``sphinxShadowBox``.
|
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
.. versionadded:: 1.4.2
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Former code refactored into an environment allowing page breaks.
|
|
|
|
|
|
2016-06-18 13:25:48 -05:00
|
|
|
|
.. versionchanged:: 1.5
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Options ``shadowsep``, ``shadowsize``, ``shadowrule``.
|
|
|
|
|
|
|
|
|
|
- The literal blocks (via ``::`` or :rst:dir:`code-block`), are
|
2016-06-22 15:30:58 -05:00
|
|
|
|
implemented using ``sphinxVerbatim`` environment which is a wrapper of
|
|
|
|
|
``Verbatim`` environment from package ``fancyvrb.sty``. It adds the handling
|
|
|
|
|
of the top caption and the wrapping of long lines, and a frame which allows
|
2016-10-27 13:24:33 -05:00
|
|
|
|
pagebreaks. Inside tables the used
|
2016-06-22 15:30:58 -05:00
|
|
|
|
environment is ``sphinxVerbatimintable`` (it does not draw a frame, but
|
|
|
|
|
allows a caption).
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5
|
2017-06-05 05:11:41 -05:00
|
|
|
|
``Verbatim`` keeps exact same meaning as in ``fancyvrb.sty`` (also
|
|
|
|
|
under the name ``OriginalVerbatim``); ``sphinxVerbatimintable`` is used
|
|
|
|
|
inside tables.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2016-06-22 15:30:58 -05:00
|
|
|
|
.. versionadded:: 1.5
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Options ``verbatimwithframe``, ``verbatimwrapslines``,
|
2017-06-05 05:11:41 -05:00
|
|
|
|
``verbatimsep``, ``verbatimborder``.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
2017-12-12 03:56:54 -06:00
|
|
|
|
.. versionadded:: 1.6.6
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Support for ``:emphasize-lines:`` option
|
|
|
|
|
|
2017-12-12 03:56:54 -06:00
|
|
|
|
.. versionadded:: 1.6.6
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Easier customizability of the formatting via exposed to user LaTeX macros
|
2017-12-12 03:56:54 -06:00
|
|
|
|
such as ``\sphinxVerbatimHighlightLine``.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- The bibliography uses ``sphinxthebibliography`` and the Python Module index
|
2017-06-05 12:42:47 -05:00
|
|
|
|
as well as the general index both use ``sphinxtheindex``; these environments
|
|
|
|
|
are wrappers of the ``thebibliography`` and respectively ``theindex``
|
|
|
|
|
environments as provided by the document class (or packages).
|
2016-10-13 07:09:43 -05:00
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Formerly, the original environments were modified by Sphinx.
|
2016-06-18 13:25:48 -05:00
|
|
|
|
|
2017-06-05 05:11:41 -05:00
|
|
|
|
Miscellany
|
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
2021-01-30 14:14:02 -06:00
|
|
|
|
- Every text paragraph in document body starts with ``\sphinxAtStartPar``.
|
2021-01-29 03:09:36 -06:00
|
|
|
|
Currently, this is used to insert a zero width horizontal skip which
|
|
|
|
|
is a trick to allow TeX hyphenation of the first word of a paragraph
|
|
|
|
|
in a narrow context (like a table cell). For ``'lualatex'`` which
|
2021-01-30 14:14:02 -06:00
|
|
|
|
does not need the trick, the ``\sphinxAtStartPar`` does nothing.
|
2021-01-29 03:09:36 -06:00
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.5.0
|
|
|
|
|
|
2018-10-05 04:26:22 -05:00
|
|
|
|
- The section, subsection, ... headings are set using *titlesec*'s
|
2017-06-05 05:11:41 -05:00
|
|
|
|
``\titleformat`` command.
|
2018-10-05 04:26:22 -05:00
|
|
|
|
|
|
|
|
|
- For the ``'manual'`` docclass, the chapter headings can be customized using
|
2017-06-05 05:11:41 -05:00
|
|
|
|
*fncychap*'s commands ``\ChNameVar``, ``\ChNumVar``, ``\ChTitleVar``. File
|
|
|
|
|
:file:`sphinx.sty` has custom re-definitions in case of *fncychap*
|
|
|
|
|
option ``Bjarne``.
|
|
|
|
|
|
|
|
|
|
.. versionchanged:: 1.5
|
2018-10-05 04:26:22 -05:00
|
|
|
|
Formerly, use of *fncychap* with other styles than ``Bjarne`` was
|
2017-06-05 05:11:41 -05:00
|
|
|
|
dysfunctional.
|
2016-10-29 09:30:33 -05:00
|
|
|
|
|
2016-08-17 08:52:42 -05:00
|
|
|
|
.. hint::
|
|
|
|
|
|
|
|
|
|
As an experimental feature, Sphinx can use user-defined template file for
|
2017-05-11 15:50:58 -05:00
|
|
|
|
LaTeX source if you have a file named ``_templates/latex.tex_t`` in your
|
|
|
|
|
project.
|
2016-08-17 08:52:42 -05:00
|
|
|
|
|
2017-05-11 15:50:58 -05:00
|
|
|
|
Additional files ``longtable.tex_t``, ``tabulary.tex_t`` and
|
|
|
|
|
``tabular.tex_t`` can be added to ``_templates/`` to configure some aspects
|
|
|
|
|
of table rendering (such as the caption position).
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 1.6
|
|
|
|
|
currently all template variables are unstable and undocumented.
|
2016-10-29 09:30:33 -05:00
|
|
|
|
|
|
|
|
|
.. raw:: latex
|
|
|
|
|
|
|
|
|
|
\endgroup
|