Setup
Preview requirespandoc for Markdown-to-HTML and Markdown-to-PDF rendering. Install preview dependencies with:
- macOS with Homebrew — installs pandoc via
brew install pandoc - Windows — installs pandoc via
winget install JohnMacFarlane.Pandoc - Linux — installs pandoc via
apt-get install pandoc
feynman --setup-preview to verify the installation.
Usage
Inside the Feynman REPL, preview the most recent artifact:
If preview commands are not available, you can open files directly:
Supported formats
The preview tool handles three output formats:- Markdown
- HTML
- PDF
Converted to HTML with full LaTeX math support via KaTeX, syntax-highlighted code blocks, and clean typography. Opens in your default browser as a local file.
LaTeX math support
For documents with heavy math notation — common in research drafts — the preview ensures all LaTeX expressions render correctly:- Inline math:
$E = mc^2$ - Display math:
$$\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}$$
How it works
Thepi-markdown-preview package handles the rendering pipeline. For Markdown files, it converts to HTML with a clean stylesheet, proper code highlighting, and rendered math equations. The preview opens in your default browser as a local file.
The preview stylesheet is designed for research documents and includes styles for heading hierarchy, syntax-highlighted code blocks, tables, inline and display math equations, citation formatting, and blockquotes.