atomec-project / atoMEC

Python-based average-atom code for simulations of high energy density phenomena such as in warm dense matter.
https://atomec-project.github.io/atoMEC/
BSD 3-Clause "New" or "Revised" License
17 stars 12 forks source link

Find a way to catch TeX rendering issues within docs build step in the CI #132

Open DanielKotik opened 2 years ago

DanielKotik commented 2 years ago

At the moment, if math (TeX) expressions in the docs contain errors that lead to invalid TeX, those errors will become visible only when after the docs are built. It would be nice to allow the CI to catch such errors before the documentations goes online.

I have already done some research, but have not found a quick or easy solution.

See also: https://docs.mathjax.org/en/latest/options/input/tex.html#tex-formaterror

DanielKotik commented 2 years ago

A solution might be

  1. add 'sphinx.ext.imgconverter' to conf.py
  2. in /docs run make latex
  3. cd ./_build/latex
  4. latexmk -pdf -halt-on-error

It probably becomes necessary to adjust .gitignore to ignore files such as source.aux, source.fdb_latexmk, texput.fls, output.log. Also check that only the html part of the build directory will be moved to gh pages artifact.