Skip to main content

math-svg: A Plugin for Pelican

Build Status PyPI Version License

Render math expressions to svg and embed them.

Installation

This plugin can be installed via:

python -m pip install pelican-math-svg

Requirements

  • required LaTeX tools (all included in TeX Live and possibly other LaTeX distributions):
    • lualatex (or another LaTeX compiler if changed in the settings, see below)
    • pdfcrop
    • dvisvgm
  • scour (optional)
  • svgo (optional)

Configuration

In your pelicanconf.py you can use the following options to tweak the behavior of the plugin:

Setting Description Default Value
MATH_SVG["scale_inline"] scaling factor for inline math 1.0
MATH_SVG["scale_display"] scaling factor for display math 1.0
MATH_SVG["latex"]["args"] CLI arguments of the invoked LaTeX compiler "--interaction=errorstopmode", "--halt-on-error"
MATH_SVG["latex"]["preamble"] preamble of the generated LaTeX document [r"\documentclass[crop,border={2pt 0pt}]{standalone}",r"\usepackage{amsmath}",r"\usepackage{amssymb}",]
MATH_SVG["latex"]["program"] LaTeX compiler to use lualatex
MATH_SVG["pdfcrop"]["args"] CLI arguments for pdfcrop --hires
MATH_SVG["dvisvgm"]["args"] CLI arguments for dvisvgm ["--pdf", "--optimize=all", "--no-fonts", "--exact-bbox"]
MATH_SVG["scour"]["args"] CLI arguments for scour ["--strip-xml-prolog", "--remove-titles", "--remove-descriptions", "--remove-metadata", "--remove-descriptive-elements", "--enable-comment-stripping", "--strip-xml-space", "--enable-id-stripping",]
MATH_SVG["scour"]["enabled"] whether to use scour to optimize SVG output True if scour is in $PATH, False otherwise
MATH_SVG["svgo"]["args"] CLI arguments for svgo ["--multipass", "--precision", "5"]
MATH_SVG["svgo"]["enabled"] whether to use svgo to optimize SVG output True if svgo is in $PATH, False otherwise

Contributing

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.

To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.

License

This project is licensed under the GPLv3 license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelican-math-svg-0.5.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pelican_math_svg-0.5.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file pelican-math-svg-0.5.0.tar.gz.

File metadata

  • Download URL: pelican-math-svg-0.5.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.7.11 Linux/5.8.0-1039-azure

File hashes

Hashes for pelican-math-svg-0.5.0.tar.gz
Algorithm Hash digest
SHA256 60f241d4e96e0a8f2740308108cd7c99346247e3a7ac37f9d11a995aa3505013
MD5 dcdee60a8edd7e651fa349b2d257cb6a
BLAKE2b-256 6049df58a2c151195bf50ba0065a1decb993235fe1964813cba6625af5217258

See more details on using hashes here.

File details

Details for the file pelican_math_svg-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pelican_math_svg-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.7.11 Linux/5.8.0-1039-azure

File hashes

Hashes for pelican_math_svg-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b9b66ae080a9d8a4aeb9f3ba3ec775fec39aa7291fb4b4c13073396f06100d8
MD5 49e8eb208eebc9c1fddb51bd2893cc49
BLAKE2b-256 e9f911e50d94a5e385b239ec57812014853e86f69f9ad782f08313495a0582c3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.10.5

2 files

0.10.4

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

This release

0.5.0 This release

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.4

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page