diff options
author | Matthew Treinish <mtreinish@kortar.org> | 2015-07-07 18:32:59 -0400 |
---|---|---|
committer | Matthew Treinish <mtreinish@kortar.org> | 2015-07-14 16:13:47 -0400 |
commit | 62575dd40e5b7698d9ba54641558246489f0614e (patch) | |
tree | e4171b69127936baa62e63a7961d95bec8c0f21e /tools/build_latex_pdf.sh | |
parent | 42d91ebee0a2b162d9711be5e8b5a04486d63a63 (diff) | |
download | nova-62575dd40e5b7698d9ba54641558246489f0614e.tar.gz |
Add tool to build a doc latex pdf
The sphinx latex generation generates invalid latex that won't compile
when you try to use it.[1][2] This commit adds a helper script to generate
the sphinx latex and then modify it so it'll work. It depends on
ImageMagick convert and sed being available to work.
[1] https://github.com/sphinx-doc/sphinx/issues/1907
[2] https://github.com/sphinx-doc/sphinx/issues/1959
Change-Id: Id289c10907aaddae2483f18b39063852ec699d66
Diffstat (limited to 'tools/build_latex_pdf.sh')
-rwxr-xr-x | tools/build_latex_pdf.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/build_latex_pdf.sh b/tools/build_latex_pdf.sh new file mode 100755 index 0000000000..1d745afd6a --- /dev/null +++ b/tools/build_latex_pdf.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Build tox venv and use it +tox -edocs --notest +source .tox/docs/bin/activate + +# Build latex source +sphinx-build -b latex doc/source doc/build/latex + +pushd doc/build/latex + +# Workaround all the sphinx latex bugs + +# Convert svg to png (requires ImageMagick) +convert architecture.svg architecture.png + +# Update the latex to point to the new image, switch unicode chars to latex +# markup, and add packages for symbols +sed -i -e 's/architecture.svg/architecture.png/g' -e 's/\\code{✔}/\\checkmark/g' -e 's/\\code{✖}/\\ding{54}/g' -e 's/\\usepackage{multirow}/\\usepackage{multirow}\n\\usepackage{amsmath,amssymb,latexsym}\n\\usepackage{pifont}/g' Nova.tex + +# To run the actual latex build you need to ensure that you have latex installed +# on ubuntu the texlive-full package will take care of this +make + +deactivate +popd + +cp doc/build/latex/Nova.pdf . |