Better quality PDFs from Gemini pages
I have made some updates to "gemtext2latex", my tool for making LaTeX files from Gemini files. Since LaTeX can produce high-quality PDF output, gemtext2latex constitutes the first and critical stage in a pipeline that allows Gemini-formatted files to be turned into PDFs.
Obviously, this provides a labour-saving device for pathologically lazy people who want to write reasonable-quality PDFs by typing out Gemini source text. Like me.
Apart from a bugfix, the updates add a handler for non-standard "quote" extensions in Gemini, which begin with "> ". By default, gemtext2latex does not handle the other major non-standard extension, which is the use of paired asterisks for italics/emphasis. This is disabled by default, but necessary for serious writing.
Usage
In my own usage, the pipeline looks like this:
$ gemtext2latex.py --file some-file.gmi | tex2pdf | view-streamed-pdf
Now the two filters above are not standard UNIX, and deal with the fact that TeX and PDFs do not play nicely with pipes. A more standard invocation would be:
$ gemtext2latex.py --file some-file.gmi > some-file.tex $ pdflatex some-file.tex $ whatever-you-use-to-view-pdfs some-file.pdf
Actually enabling italics
Since italics are not standard Gemini, and because the algorithm for trying to match random asterisks on a line is not infallible, they're disabled by default. To enable them requires the following ungainly runes:
$ gemtext2latex.py --file some-file.gmi --italics-char '*' > some-file.tex
Packaging it up
The whole thing requires Python, Latex, and a bespoke LaTeX class file. So it's a bit ungainly. Anyone with bright ideas about how to package it up, e.g., via Docker, please get in touch.