Skip to content
Browse files
Added LaTeX formula renderer plugin.
  • Loading branch information
felixfontein committed Jan 14, 2017
1 parent c8f4a70 commit 2fc1fb6acce43e5b83d25dee9f8549d43ec522f7
Show file tree
Hide file tree
Showing 5 changed files with 868 additions and 0 deletions.
@@ -0,0 +1,17 @@
The `latex_formula_renderer` plugin provides a static LaTeX formula rendering infrastructure, generating images which can be included in a website and do not depend on client-side rendering of formulae (as with [MathJax]( and [KaTeX]( This plugin is not for end-users, but provided as a service for other plugins which can use it to not having to define their own formula-rendering functionality.

The plugin has support for
* inline formulae, display-style formulae,
* `align` environments (see the [AMSMath documentation](,
* XY-pic diagrams (in `xymatrix` environments inside any of the previous; see the [XY-Pic user guide](,
* pstricks graphics (see [here]( for more information), and for
* tikzpicture graphics (see [here]( for more information).

It allows to generate formulae in different output formats:
* as `.png` bitmap images;
* as `.svg` vector graphics;
* as compressed `.svgz` vector graphics.

The generated images do not require the user to have a certain font installed, and should render the same in all browsers and on all output devices (assuming they support the chosen graphics format and don't screw up basic things).

To see how the plugin can be used, please check out the docstring of `LaTeXFormulaRendererPlugin` in ``.
@@ -0,0 +1,40 @@
# The folder relative to OUTPUT_FOLDER in which the rendered formulae are stored.
# Defaults to /formula/.

# Whether to store the rendered formulae as images or to insert them with data URIs.
# Warning: data URIs can seriously blow up the generated HTML, especially if you
# use may formulae or repeatingly the same one!

# The output format used for the images. Possible values:
# * "png" for PNG images with transparency;
# * "svg" for SVG vector graphics;
# * "svgz" for SVG vector graphics compressed with gzip.
# Note that depending on your web server's configuration, you might experience
# problems with .svgz files as the web server might treat them similar to .svg.gz
# files and deliver them claiming that they are .svg files.

# Allows to include packages and define things in the preamble of the .tex files
# used to render the formulae. When generating a temporary .tex file, the plugin
# looks for the contents of the following keys:
# * "": will always be included;
# * "tikz": will be included when formula_type is ("tikzpicture", ...);
# * "pstricks": will be included when formula_type is ("pstricks", ...);
# * "xy": will be included if the formula contains "\xymatrix";
# * "pdflatex": will be included if the .tex file is processed by pdflatex
# to convert it to a .pdf file;
# * "latex": will be included if the .tex file is processed by latex to convert
# it to a .dvi file.
# The default is {}, which means no preamble additions. The following example
# shows how to define some macros for all formulae:
"": r"""
@@ -0,0 +1,13 @@
Name = latex_formula_renderer
Module = latex_formula_renderer

PluginCategory = Task
MinVersion = 7.8.2

Author = Felix Fontein
Version = 1.0
Website =
Description = Provides a LaTeX formula rendering infrastructure

0 comments on commit 2fc1fb6

Please sign in to comment.