From e802b06490badb78ecb48e7e79a92eea6058f7c0 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Thu, 28 Mar 2024 16:07:14 +0100 Subject: 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 (From yocto-docs rev: a78d9bde7f90f860aa969b7d8e47350de9106183) Signed-off-by: Quentin Schulz Reviewed-by: Michael Opdenacker Signed-off-by: Richard Purdie --- documentation/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/conf.py b/documentation/conf.py index a64685ec9b..35c5c14535 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -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 -- cgit v1.2.3-54-g00ecf