Skip to content

Commit

Permalink
Update build.sh for pandoc 2.0
Browse files Browse the repository at this point in the history
WeasyPrint was not renderring MathJax, so use --webtex to convert
equations to SVGs for PDF  output. See
Kozea/WeasyPrint#59
  • Loading branch information
dhimmel committed Nov 1, 2017
1 parent 46577a2 commit 9080547
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ echo "Exporting HTML manuscript"
pandoc --verbose \
--from=markdown \
--to=html5 \
--filter pandoc-fignos \
--filter pandoc-eqnos \
--filter pandoc-tablenos \
--filter=pandoc-fignos \
--filter=pandoc-eqnos \
--filter=pandoc-tablenos \
--bibliography=$BIBLIOGRAPHY_PATH \
--csl=$CSL_PATH \
--metadata link-citations=true \
Expand All @@ -43,29 +43,41 @@ pandoc --verbose \

# Create PDF output
echo "Exporting PDF manuscript"
weasyprint \
--verbose \
--presentational-hints \
webpage/index.html \
output/manuscript.pdf
ln --symbolic content/images images
pandoc \
--from=markdown \
--to=html5 \
--pdf-engine=weasyprint \
--pdf-engine-opt=--presentational-hints \
--filter=pandoc-fignos \
--filter=pandoc-eqnos \
--filter=pandoc-tablenos \
--bibliography=$BIBLIOGRAPHY_PATH \
--csl=$CSL_PATH \
--metadata link-citations=true \
--webtex=https://latex.codecogs.com/svg.latex? \
--css=webpage/github-pandoc.css \
--output=output/manuscript.pdf \
$INPUT_PATH
rm --recursive images

# Create DOCX output when user specifies to do so
if [ "$BUILD_DOCX" = "true" ];
then
echo "Exporting Word Docx manuscript"
ln --symbolic content/images images
pandoc --verbose \
--from=markdown \
--to=docx \
--filter pandoc-fignos \
--filter pandoc-tablenos \
--filter=pandoc-fignos \
--filter=pandoc-eqnos \
--filter=pandoc-tablenos \
--bibliography=$BIBLIOGRAPHY_PATH \
--csl=$CSL_PATH \
--metadata link-citations=true \
--reference-doc=$DOCX_PATH \
--resource-path=.:content \
--output=output/manuscript.docx \
$INPUT_PATH
rm --recursive images
fi

echo "Build complete"

0 comments on commit 9080547

Please sign in to comment.