Newborn Programming Monsters

npm

Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

1.3.0 • Public • Published

An opinionated Markdown to Latex Converter

Warning: This Code is a total mess! I am sorry for that. But it has 100% test coverage so whenever someone introduces a new hack to get it working, we can be confident that nothing unexpectedly breaks.

All features were developed for compatibility with the modernthesis template.

How to use it

As a standalone converter

Usage

• The pathToSrcMdFile default to ./in.md.
• The pathToTargetTexFile default to ./out.tex.

If you provide a directory path instead of a file for both paths, all .md files will get converted to the output directory. The Filestructure will remain the same.

Features

You can use a codeblock with the language latex to write latex code directly in your markdown files. This Code is getting directly copied into the output without any further conversion.

Input:

Output:

Text Styles

Input:

Output:

Links get converted to footnotes or BibLatex Source References

Input:

Output:

Input:

Output:

Codeblocks

🌟 Please note the special syntax for captions.

Input:

Output:

Input:

Output:

Known Limitations

• Currently, this code can't convert tables
• It is also not possible to use inline styles in headlines like # _italic_ headline
• Not all characters get escaped correctly. It's not working inside headlines and normal text without any formatting.

Contribute

You wan't to contribute? Feel free to do so!

If you have found a bug, just add a snapshot test to the tests located at __tests__/md2tex.test.js and open a pull request.

Install

npm i @adrianjost/md2tex

0

1.3.0

MIT

51.1 kB

7