Skip to main content

LaTeX to MyST converter

Project description

LaTeX to MyST Pandoc Filter

Latex-to-MyST implements a pandoc filter that converts a subset of LaTeX environments to MyST directives. Although it is probably more pandoc compatible to write a custom pandoc writer instead of using RawBlocks and RawInline to mimics one, the existence of panflute makes it much easier for python developers like me to work with filters instead of writers.

To use this filter, install the package by:

pip install latex_to_myst

which adds a cli latex2myst, which can be used to convert latex file to myst by calling:

latex2myst latex_file.tex markdown_file.md

LaTex Environments to MyST Directives

Latex-to-Myst Current supports:

  1. All amsthm blocks,

  2. Display Math

  3. Subplots in the form of {list-table}.

Many LaTeX environments need to be converted in to MyST directives. amsthm for example, can be visualized using the experimental Sphinx-proof Directives.

Unfortunately, MyST does not have native support for subplots, and neither does pandoc. To circumvent the problem, the best solution for now is to use a {list-table} directive. However, this still needs to be fixed as there are some known issues that need to be addressed.

Work in Progress / Known Issues

There are some known issues need to be addressed.

Credits

This module uses panflute heavily.

History

0.0.1 (2021-11-04)

  • First release on PyPI.

Project details


Download files

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

Source Distribution

latex_to_myst-0.0.1.tar.gz (25.7 kB view hashes)

Uploaded Source

Built Distribution

latex_to_myst-0.0.1-py2.py3-none-any.whl (14.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page