SVG files are not handled directly in the *.tex files.
This commit adds sphinxcontrib.inkscapeconverter (from the 
sphinxcontrib-svg2pdfconverter package) to sphinx's extensions in conf.py to 
ensure SVG files are converted to PDF before the compilation of *.tex files.
The needed steps are also updated and inkscape is specified as a dependency.

If I don't add sphinxcontrib.inkscapeconverter to sphinx's extensions, this is 
what I get with 
docker.io/trini/u-boot-gitlab-ci-runner:jammy-20250714-25Jul2025:

uboot@35c89b9ab70e:~/u-boot$ make pdfdocs
[...]
xelatex  'android.tex'
[...]
Output written on android.pdf (28 pages).
[...]
xelatex  'api.tex'
[...]
Output written on api.pdf (431 pages).
[...]
xelatex  'arch.tex'
[...]
Output written on arch.pdf (62 pages).
[...]
xelatex  'board.tex'
[...]

[152]
Chapter 14.

! LaTeX Error: Cannot determine size of graphic in boot_diagram_am62.svg (no Bo
undingBox).

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.11422 ...ncludegraphics{{boot_diagram_am62}.svg}

? Output written on board.pdf (156 pages).
Transcript written on board.log.
make[2]: *** [Makefile:29: board.pdf] Error 1
make[1]: *** [doc/Makefile:95: pdfdocs] Error 2
make: *** [Makefile:2686: pdfdocs] Error 2

NOTE: This won't completely fix the pdfdocs target. See next commit(s).

Signed-off-by: Adriano Carvalho <adrianocarvalho...@gmail.com>
---
 doc/build/documentation.rst | 3 +++
 doc/conf.py                 | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/build/documentation.rst b/doc/build/documentation.rst
index 69e0dc418b1..1e97085fc89 100644
--- a/doc/build/documentation.rst
+++ b/doc/build/documentation.rst
@@ -18,6 +18,8 @@ the following dependencies are needed to build the 
documentation:
 
 * texlive-xetex (if building the `PDF documentation`_ through the *pdfdocs* 
target)
 
+* inkscape (if building the `PDF documentation`_ through the *pdfdocs* target)
+
 HTML documentation
 ------------------
 
@@ -32,6 +34,7 @@ The *htmldocs* target is used to build the HTML 
documentation. It uses the
     . myenv/bin/activate
     # Install build requirements
     python3 -m pip install -r doc/sphinx/requirements.txt
+    python3 -m pip install sphinxcontrib-svg2pdfconverter
     python3 -m pip install pytest
     # Build the documentation
     make htmldocs
diff --git a/doc/conf.py b/doc/conf.py
index 84d028feda8..43472d5dc3d 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -48,7 +48,9 @@ extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include',
               'kfigure', 'sphinx.ext.ifconfig', # 'automarkup',
               'maintainers_include', 'sphinx.ext.autosectionlabel',
               'kernel_abi', 'kernel_feat', 'sphinx-prompt',
-              'sphinx_reredirects', 'sphinx.ext.autodoc' ]
+              'sphinx_reredirects', 'sphinx.ext.autodoc',
+              'sphinx_reredirects', 'sphinx.ext.autodoc',
+              'sphinxcontrib.inkscapeconverter' ]
 
 #
 # cdomain is badly broken in Sphinx 3+.  Leaving it out generates *most*
-- 
2.48.1

Reply via email to