Browse code

convert SVG to PDF when using latex builder

Joseph Weston authored on 15/05/2019 15:17:08
Showing 2 changed files
... ...
@@ -239,7 +239,8 @@ build documentation:
239 239
     - build:latest
240 240
   stage: test
241 241
   script:
242
-    - pip install git+https://github.com/jupyter-widgets/jupyter-sphinx
242
+    - apt-get update && apt-get install -y librsvg2-bin  # for converting svgs to pdfs
243
+    - pip install git+https://github.com/jupyter-widgets/jupyter-sphinx sphinxcontrib-svg2pdfconverter
243 244
     - python -m ipykernel install --user --name kwant-latest
244 245
     - make -C doc clean; make -C doc html SPHINXOPTS='-A website_deploy=True -n -W -D jupyter_execute_default_kernel=kwant-latest' SOURCE_LINK_TEMPLATE="$CI_PROJECT_URL"/blob/\$\$r/\$\$f
245 246
   artifacts:
... ...
@@ -253,7 +254,8 @@ build PDF documentation:
253 254
     - build:latest
254 255
   stage: test
255 256
   script:
256
-    - pip install git+https://github.com/jupyter-widgets/jupyter-sphinx
257
+    - apt-get update && apt-get install -y librsvg2-bin  # for converting svgs to pdfs
258
+    - pip install git+https://github.com/jupyter-widgets/jupyter-sphinx sphinxcontrib-svg2pdfconverter
257 259
     - python -m ipykernel install --user --name kwant-latest
258 260
     - make -C doc latex SPHINXOPTS='-n -W -D jupyter_execute_default_kernel=kwant-latest'
259 261
     - cd doc/build/latex
... ...
@@ -38,7 +38,8 @@ sys.path.insert(0, os.path.abspath('../sphinxext'))
38 38
 
39 39
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary',
40 40
               'sphinx.ext.todo', 'sphinx.ext.mathjax', 'numpydoc',
41
-              'kwantdoc', 'sphinx.ext.linkcode', 'jupyter_sphinx.execute']
41
+              'kwantdoc', 'sphinx.ext.linkcode', 'jupyter_sphinx.execute',
42
+              'sphinxcontrib.rsvgconverter']
42 43
 
43 44
 # Add any paths that contain templates here, relative to this directory.
44 45
 templates_path = ['../templates']