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-to-Myst Current supports:
- All amsthm blocks,
- Display Math
- 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.
There are some known issues need to be addressed.
This module uses panflute heavily.