Skip to main content

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.

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.

Setup

Preview requires pandoc for Markdown-to-HTML and Markdown-to-PDF rendering. Install preview dependencies with:
feynman --setup-preview
Or as part of initial setup:
feynman setup
The setup command attempts to install pandoc automatically using your platform’s package manager:
  • 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
If the automatic install does not work, install pandoc manually from pandoc.org/installing.html and rerun feynman --setup-preview to verify the installation.

Usage

Inside the Feynman REPL, preview the most recent artifact:
/preview
Preview a specific file:
/preview outputs/scaling-laws-brief.md
Additional preview commands:
CommandDescription
/previewPreview the most recent artifact in the browser
/preview --file <path>Preview a specific file
/preview-browserForce browser preview
/preview-pdfExport to PDF via pandoc
/preview-clear-cacheClear the rendered preview cache
If preview commands are not available, you can open files directly:
open <file.md>   # macOS — opens in default app
open <file.pdf>  # macOS — opens in Preview

Supported formats

The preview tool handles three output formats:
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}$$
Tables, citation lists, and nested blockquotes all render with proper formatting.
HTML and PDF preview outputs are temporary render artifacts. The canonical saved result is always the Markdown file. Do not treat the rendered output as the primary deliverable — it is a view, not the source.

How it works

The pi-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.

Build docs developers (and LLMs) love