The preview tool renders Feynman’s generated artifacts — research briefs, paper drafts, and any document with LaTeX math, tables, or complex formatting — as polished HTML or PDF. This is particularly useful for artifacts that do not render well in a terminal.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/getcompanion-ai/feynman/llms.txt
Use this file to discover all available pages before exploring further.
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:| Command | Description |
|---|---|
/preview | Preview the most recent artifact in the browser |
/preview --file <path> | Preview a specific file |
/preview-browser | Force browser preview |
/preview-pdf | Export to PDF via pandoc |
/preview-clear-cache | Clear the rendered preview cache |
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.