dialoa / imagify

Pandoc/Quarto filter to convert selected LaTeX elements to images in other output formats
https://dialoa.github.io/imagify/
MIT License
15 stars 1 forks source link
pandoc pandoc-crossref pandoc-filter quarto quarto-extension tikz

Imagify - Pandoc/Quarto filter to convert selected LaTeX into images

GitHub build status

Lua filter to convert some or all LaTeX code in a document into images and to use .tex/.tikz files as image sources.

Copyright 2021-2023 Philosophie.ch under MIT License, see LICENSE file for details.

Maintained by Julien Dutant.

Overview

Imagify turns selected LaTeX elements into images in non-LaTeX/PDF output. This is useful for web output if you use MathJAX but it doesn't handle all of your LaTeX code.

It also allows you to use .tex or .tikz elements as image source files, which is useful to create cross-referenceable figures with Pandoc-crossref or Quarto without having to convert your LaTeX/TikZ code into images first.

Imagify tries to match your document's LaTeX output settings (fonts, LaTeX packages, etc.). Its rendering options are otherwise extensively configurable, and different rendering options can be used for different elements. It can embed its images within HTML output or provide them as separate image files.

Requirements: Pandoc or Quarto, a LaTeX installation (with dvisvgm and, recommended, latexmk, which are included in common LaTeX distributions).

Limitations

Use cases

The filter is used to produce the academic journal Dialectica. See for instance this article.

Demonstration

See the manual's example HTML output.

For a quick try-out, clone the repository and try:

Pandoc : make generate && open example-pandoc/expected.html

Or:

Quarto : make quarto && open example-quarto/example.html

You'll need either Pandoc or Quarto and a standard LaTeX distribution (that includes dvisvgm).

Installation and usage

See the manual.

Issues and contributing

Issues and PRs welcome.

Acknowledgements

Development funded by Philosophie.ch.