docs: conf.py: properly escape backslashes for latex_elements

There are some syntax warnings returned by Python:
"""
yocto-docs/documentation/conf.py:162: SyntaxWarning: invalid escape sequence '\P'
  'passoptionstopackages': '\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
yocto-docs/documentation/conf.py:163: SyntaxWarning: invalid escape sequence '\s'
  'preamble': '\setcounter{tocdepth}{2}',
"""

Backslashes must be doubled in Python string literals to avoid
interpretation as escape sequence, c.f.
https://www.sphinx-doc.org/en/master/latex.html#module-latex.

Cc: Quentin Schulz <foss+yocto@0leil.net>
(From yocto-docs rev: 037f99339a4bae60f41f89df37911690b507c9a1)

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Quentin Schulz
2024-03-28 16:07:14 +01:00
committed by Steve Sakoman
parent 73955d9954
commit 9d7485f8bf

View File

@@ -159,8 +159,8 @@ html_last_updated_fmt = '%b %d, %Y'
html_secnumber_suffix = " "
latex_elements = {
'passoptionstopackages': '\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
'preamble': '\setcounter{tocdepth}{2}',
'passoptionstopackages': '\\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
'preamble': '\\setcounter{tocdepth}{2}',
}
# Make the EPUB builder prefer PNG to SVG because of issues rendering Inkscape SVG