Skip to content

Commit

Permalink
Cleanup PDF build job on Read the Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Aug 29, 2023
1 parent 279cf4a commit f5004e6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@ build:
- git fetch --unshallow
# Altered PDF build and upload job, attributed to
# https://stackoverflow.com/a/76992101/14001839
# This also runs on PR builds, but does not upload the PDF
post_build:
- mkdir --parents $READTHEDOCS_OUTPUT/pdf/
# Generate LaTeX files in docs/build/ and doctrees in docs/_build/doctrees, skipping notebooks
- python -m sphinx -T -E -b latex -d docs/_build/doctrees -D language=en docs docs/build/
- cd docs/build/ && cat latexmkrc
# Map non-zero exit codes to zero
- cd docs/build/ && latexmk -r latexmkrc -pdf -f -dvi- -ps- -jobname=pybamm -interaction=nonstopmode || true
# Check if pybamm.pdf exists
- test -f docs/build/pybamm.pdf && echo "pybamm.pdf exists. Copying source file to $READTHEDOCS_OUTPUT/pdf/."
- ls $READTHEDOCS_OUTPUT/pdf/
- cp "docs/build/pybamm.pdf" $READTHEDOCS_OUTPUT/pdf/
- ls $READTHEDOCS_OUTPUT/pdf/

# Optionally declare the Python requirements required to build your docs
python:
Expand Down

0 comments on commit f5004e6

Please sign in to comment.