Imagify
Pandoc/Quarto filter to convert selected LaTeX and TikZ elements to images in other output formats
Install / Use
/learn @dialoa/ImagifyREADME
Imagify - Pandoc/Quarto filter to convert selected LaTeX into images
Lua filter to convert some or all LaTeX and TikZ elements in a document into
images. Also enables using .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
- So far designed with HTML output in mind, LaTeX to SVG conversion,
and LaTeX/PDF outputs with separate
.tikzor.texfiles as image sources. In other output formats, the images will be inserted or linked as PDFs and may display in wrong sizes or not at all. - Embedding within HTML output isn't compatible with Pandoc's
extract-mediaoption.
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.
CI Tests
CI tests run on the [pandoc/latex][https://hub.docker.com/r/pandoc/latex] Docker image. The Dockerfile installs two LaTeX packages not included from the current TeXLive repository at https://mirror.ctan.org/systems/texlive/tlnet. If the pandoc/latex Docker image is not yet updated to the latest TeXLive version, the Dockerfile should point to a suitable TexLive repository archive.
Issues and contributing
Issues and PRs welcome.
Acknowledgements
Development funded by Philosophie.ch.
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
