Features

markdown-academic extends Markdown with features essential for academic and technical writing—while preserving the plain-text simplicity that makes Markdown a joy to write.

Math Rendering

Inline and display equations with configurable backends (KaTeX, MathJax, MathML).

Citations

BibTeX integration with automatic bibliography generation.

Cross-References

Label anything, reference it anywhere. Automatic numbering included.

Environments

Theorems, proofs, definitions, figures, and custom environments.

Table of Contents

Auto-generated navigation from document headings.

Multiple Outputs

Render to HTML or PDF from the same source document.

Quick Example

A markdown-academic document looks like this:

+++
title = "My Paper"
[macros]
R = "\\mathbb{R}"
+++

# Introduction {#sec:intro}

Let $x \in \R$ be a real number. The Euler identity states:

$$e^{i\pi} + 1 = 0$$ {#eq:euler}

As shown in @eq:euler, this connects five fundamental constants.

::: theorem {#thm:main}
Every natural number greater than 1 is either prime or 
can be factored into primes.
:::

See @thm:main and [@knuth1984] for details.

Documents use the .mda file extension and remain readable as plain text, even without specialized rendering.

Try It Live

Edit the markdown below and see it rendered in real-time. This demo runs entirely in your browser using WebAssembly—loaded directly from npm via unpkg.

Loading markdown-academic from npm...
Output (rendered HTML)

No build step required! Add markdown-academic to any webpage with a single import:

<script type="module">
import { init, render } from 'https://unpkg.com/markdown-academic?module';
await init();
const html = render('# Hello $E=mc^2$');
</script>

Installation

Rust

Add to your Cargo.toml:

[dependencies]
markdown-academic = "0.1"

From Source

git clone https://github.com/quinnjr/markdown-academic.git
cd markdown-academic/rust
cargo build --release

Optional Features

Feature Description
mathml Enable MathML rendering backend
wasm Enable WebAssembly bindings for JavaScript
pdf Enable PDF output generation

Documentation

Basic Usage

use markdown_academic::render;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let input = r#"
# Introduction {#sec:intro}

The equation $E = mc^2$ is famous. See @sec:intro.
"#;

    let html = render(input, None, None)?;
    println!("{}", html);
    Ok(())
}

For more detailed usage, see the Rust API documentation.