paper.md
# A paper
Text + citations
```mermaid
Ikat turns Markdown, flowcharts, and plot data into LaTeX and PDF. Diagrams and charts stay editable as TeX-native source that uses the paper’s own fonts.
Python 3.10+RustTeX for PDF output — or texres, no install
Document assembly
Pipeline view / source to output
# A paper
Text + citations
```mermaid
Flowchart · plot values
Parse · lay out · emit
TikZ + pgfplots
PDF — local TeX, or the texres one-binary
Markdown and editable figure inputs pass through ikat’s Rust core, which emits LaTeX with TikZ and pgfplots figures. PDF compilation uses the local TeX installation, or the texres engine — a single Rust binary bundling LaTeX, packages, fonts, and BibTeX, needing no installation.
The parts are separated so each input and output is visible.
Write the flowchart once. Ikat’s Rust emitter turns the supported Mermaid flowchart subset into TikZ, ready for the same TeX build as the paper.
graph TD
md[Markdown] --> rust[Rust core]
rust --> tikz[TikZ + pgfplots]
tikz --> pdf[PDF]
\begin{tikzpicture}[>=Stealth,
every node/.style={align=center,font=\small},
box/.style={draw,rounded corners=2pt,fill=gray!8},
dia/.style={draw,diamond,aspect=2,fill=blue!8},
stad/.style={draw,rounded corners=10pt,fill=gray!8},
sub/.style={draw,double,fill=gray!8}]
\node (md) at (0.0,-0.0) [box] {Markdown};
\node (rust) at (0.0,-2.4) [box] {Rust core};
\node (tikz) at (0.0,-4.8) [box] {TikZ + pgfplots};
\node (pdf) at (0.0,-7.2) [box] {PDF};
\draw[->] (md) -- (rust);
\draw[->] (rust) -- (tikz);
\draw[->] (tikz) -- (pdf);
\end{tikzpicture}
A short excerpt from ikat’s actual flowchart emitter. The generated TikZ stays text, not a screenshot of a browser canvas.
Install the published wheel with pip, or build the current source with Python and Rust installed. The --no-pdf build writes LaTeX without TeX installed; for PDFs, point --engine texres at the single-binary texres distribution — or add TeX Live or TinyTeX and keep the default engine.
python -m pip install "ikat[mcp]"
ikat build site/hello-paper.md --outdir out --no-pdf
rem PDFs with no TeX install: get texres, then add --engine texres
git clone https://github.com/opticsWolf/ikat.git
cd ikat
python3 -m venv .venv
source .venv/bin/activate
python -m pip install maturin pytest
maturin develop
python -m pytest tests/
ikat build site/hello-paper.md --outdir out --no-pdf
git clone https://github.com/opticsWolf/ikat.git
cd ikat
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install maturin pytest
maturin develop
python -m pytest tests/
ikat build site/hello-paper.md --outdir out --no-pdf
For a PDF, install a TeX distribution and rerun the last command without --no-pdf. Add mcp>=1,<2 if you also want ikat’s optional MCP server.
Rust owns parsing, layout, and figure code generation. Python carries document strings and drives the tools.
graph TD / graph LR flowchart subset, laid out deterministically. Unsupported syntax fails fast.TeX boundary: ikat weave writes TeX without TeX installed. To compile a PDF, use a local pdflatex installation (bibtex too when a bibliography is staged), or skip installation entirely with --engine texres — one binary bundling LaTeX, packages, fonts, and BibTeX — or --engine tectonic, which fetches its bundle on first run.
Use the same Rust-backed pipeline from code, a shell, or an agent connection. Add the repository skill when an LLM needs ikat-specific workflow guidance.
The showcase manuscript exercises the pipeline with Mermaid diagrams, plots, tables, citations, math, Unicode, float controls, and templates. Its Markdown and build script are in the repository.