Skip to content

Sphinx LaTeX PDF documentation bundle #1606

@weiji14

Description

@weiji14

Description of the desired feature

I have a friend who will be working remotely in the field (Antarctica) without internet access for a few weeks, and he asked me about a PDF copy of the documentation. Upstream GMT has dropped PDF builds in GMT v6.0 as mentioned in https://forum.generic-mapping-tools.org/t/gmt-6-install-complete-documentation-fails/251/2 and GenericMappingTools/gmt#805, but I think we could have it for PyGMT through sphinx's LaTeX PDF build, similar to what other Python packages do on readthedocs.

A few suggestions:

  1. Add a make latexpdf option to https://github.com/GenericMappingTools/pygmt/blob/v0.5.0/doc/Makefile so that people can build the PDF locally for any version.
  2. Build an official PDF only for each release, and have it as a downloadable release asset somewhere:

Here's a PDF I managed to build locally for v0.5.0: pygmt_v0.5.0_docs.pdf. It contains 465 pages and is ~13MB, including all the gallery examples, tutorials and API docs. The commands I ran locally were:

cd ~/path/to/pygmt/doc
make all  # build the API docs
PYGMT_USE_EXTERNAL_DISPLAY="false" sphinx-build -b latex -d _build/doctrees -j auto . _build/latex
cd _build/latex/
make  # build the LaTeX PDF docs

There were a few errors related to missing LaTeX fonts (e.g. I had to do sudo apt install latex-gyre), unicode characters (all the emojis in the changelog 😅) and SVG images (the DOI badges are SVG) which I had to skip through. It should be possible to work out those issues though with a bit of effort.

References:

Are you willing to help implement and maintain this feature? Yes, but want to see if there's demand for it, and whether to do just (1) or both (1) and (2).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions