Skip to main content

Turning markdown notes with formulas into LaTeX PDFs

Project description

NoTeX

NoTeX is a CLI application to convert Markdown files into LaTeX-processed PDF files.

Installation

pip install notex

NoTeX supports Python 3.6 and 3.7, and requires pandoc.

Usage

You can generate a PDF for the markdown file notes/machine_learning.md with the command below. The output is stored in notes/machine_learning.pdf.

notex notes/machine_learning.md

The title for the LaTeX PDF is taken from the first-level header (# Header) or the metadata. Metadata is optional and is declared at the top of the markdown file using pandoc-style yaml metadata.

For example:

---
abstract: This is the abstract.
table-of-contents: true
---

# Title

Introduction.

## Paragraph Header

Paragraph body.

Philosophy

When in 2004 John Gruber created the Markdown language, he intended the language to be used both to write and read content, with simplicity in mind.

Since then Markdown has been extended, both in terms of syntax and of content. In particular, MathJax allowed to type formulas thus making Markdown a more convenient way to write scientific notes when the additional features of LaTeX were not required.

However, using (complex) formulas made reading Markdown files as they are written an overly inconvenient task. Sometimes, being able to render Markdown files into LaTeX-processed files can help strike a compromise between ease of writing and ease of reading.

Moreover, rendered files enable writers to share their formula-heavy content with others who might not be familiar with the MathJax syntax.

NoTeX was created to make writing and reading scientific Markdown files easy.

Implementation

NoTeX is Python CLI application based on pandoc, another CLI application to convert between markup file formats, including Markdown and LaTeX. NoTeX narrows down pandoc's scope so that using it becomes dead-simple, also adding support for LaTeX titles extracted from Markdown.

Development

After cloning the repo, install the application including development requirements.

make install

All Python code is formatted using black and linted using flake8.

make format
make lint

Both formatting and linting checks are performed within the test suite.

make test

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

notex-0.0.3.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

notex-0.0.3-py3-none-any.whl (5.8 kB view hashes)

Uploaded 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