Skip to content

Commit 9020577

Browse files
authored
Support SVG in Sphinx Latex building (lnis-uofu#220)
* [Doc] Try use image converter instead of svg2pdf which requires more dependencies * [Doc] Add img converter to conf.py * [Doc] Bug fix in importing imgconverter package * [Doc] Try to fix the bug when importing python packages * [Doc] bug fix * [Doc] Try to use imgconverter rather than cairo * [Doc] Add svg to latex config in sphinx configuration file * [Doc] Try cairo svg converter * [Doc] Correct bugs in compiling latexpdf * [Doc] Use latest image in building readthedocs * [Doc] Now use readthedocs docker image in building online documentation * [Doc] Correct typo in readthedocs setting * [Doc] Try to use inkscape converter as imgconverter converted SVG to black images * [Doc] Try RSVG
1 parent 9f7d03c commit 9020577

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

.readthedocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
# Required configuration file version
66
version: 2
77

8+
# Specify docker image for building the doc
9+
build:
10+
image: latest
11+
812
# Build documentation in the docs/ directory with Sphinx
913
sphinx:
1014
builder: dirhtml
@@ -16,5 +20,6 @@ formats: all
1620
# Optionally set the version of Python and requirements required to build your docs
1721
python:
1822
version: 3.7
23+
system_packages: true
1924
install:
2025
- requirements: docs/requirements.txt

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sphinxcontrib-bibtex<2.0.0
1111
# Package required to embed youtube video
1212
sphinxcontrib-yt
1313

14-
# Package required to convert svg for pdf builder
14+
# Package required to convert SVG for latex building
1515
sphinxcontrib-svg2pdfconverter
1616

1717
#Work-around bug "AttributeError: 'Values' object has no attribute 'character_level_inline_markup'" with docutils 0.13.1

docs/source/conf.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,12 @@
2323
#html_theme = "sphinx_rtd_theme"
2424
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
2525

26-
# Import sphinxcontrib.bibtex
27-
have_sphinxcontrib_bibtex = True
28-
try:
29-
import sphinxcontrib.bibtex
30-
except ImportError:
31-
have_sphinxcontrib_bibtex = False
32-
33-
# Import sphinxcontrib.yt
34-
have_sphinxcontrib_youtube = True
35-
try:
36-
import sphinxcontrib.yt
37-
except ImportError:
38-
have_sphinxcontrib_youtube = False
39-
40-
# Import sphinxcontrib.svg2pdfconverter
41-
have_sphinxcontrib_svg2pdfconverter = True
42-
try:
43-
import sphinxcontrib.svg2pdfconverter
44-
except ImportError:
45-
have_sphinxcontrib_svg2pdfconverter = False
26+
# For bibtex support
27+
import sphinxcontrib.bibtex
28+
# For embedded youtube
29+
import sphinxcontrib.yt
30+
# For converting SVG to PNG using rsvg
31+
import sphinxcontrib.rsvgconverter
4632

4733
# -- Project information -----------------------------------------------------
4834

@@ -72,6 +58,7 @@
7258
'sphinxcontrib.bibtex',
7359
'sphinx.ext.autosectionlabel',
7460
'sphinxcontrib.yt',
61+
'sphinxcontrib.rsvgconverter',
7562
]
7663

7764
# Add any paths that contain templates here, relative to this directory.

docs/source/manual/arch_lang/circuit_model_examples.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ Template
11601160

11611161
.. option:: <wire_param model_type="<string>" R="<float>" C="<float>" num_level="<int>"/>
11621162

1163-
- ``model_type="pi|T"`` Specify the type of RC models for this wire segement. Currently, OpenFPGA supports the π-type and T-type multi-level RC models.
1163+
- ``model_type="pi|T"`` Specify the type of RC models for this wire segement. Currently, OpenFPGA supports the :math:`\pi`-type and T-type multi-level RC models.
11641164
- ``R="<float>"`` Specify the total resistance of the wire
11651165
- ``C="<float>"`` Specify the total capacitance of the wire.
11661166
- ``num_level="<int>"`` Specify the number of levels of the RC wire model.
@@ -1193,7 +1193,7 @@ The code describing this wire is:
11931193
11941194
This example shows
11951195
- A routing track wire has 1 input and output
1196-
- The routing wire will be modelled as a 1-level π-type RC wire model with a total resistance of :math:`103.84\Omega` and a total capacitance of :math:`13.89fF`
1196+
- The routing wire will be modelled as a 1-level :math:`\pi`-type RC wire model with a total resistance of :math:`103.84\Omega` and a total capacitance of :math:`13.89fF`
11971197

11981198
I/O pads
11991199
~~~~~~~~

0 commit comments

Comments
 (0)