Diagrams
texforge build intercepts embedded diagram environments before
compilation and replaces them with rendered figures. Your original .tex
files are never modified — rendering happens in the build/ copies.
Both renderers are pure Rust: no browser, no Node.js, no dot binary
required.
Mermaid
% Default: width=\linewidth, pos=H, no caption
\begin{mermaid}
flowchart LR
A[Input] --> B[Process] --> C[Output]
\end{mermaid}
% With options
\begin{mermaid}[width=0.6\linewidth, caption=System flow, pos=t]
flowchart TD
X --> Y --> Z
\end{mermaid}
Graphviz / DOT
\begin{graphviz}[caption=Pipeline]
digraph G {
rankdir=LR
A -> B -> C
B -> D
}
\end{graphviz}
Options
| Option | Default | Description |
|---|---|---|
width | \linewidth | Image width |
pos | H | Figure placement (H, t, b, h, p) |
caption | (none) | Figure caption |
When a caption is given the diagram is wrapped in a figure environment
at the requested position; without it the image is embedded inline.