diff --git a/README.md b/README.md index 80a2650..6d896ac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # preview.nvim -**Universal document previewer for Neovim** +**Universal previewer for Neovim** An extensible framework for compiling and previewing _any_ documents (LaTeX, Typst, Markdown, etc.)—diagnostics included. @@ -81,3 +81,8 @@ vim.g.preview = { typst = { open = { 'sioyek', '--new-instance' } }, } ``` + +**Q: How do I set up SyncTeX (forward/inverse search)?** + +See `:help preview-synctex` for full recipes covering Zathura, Sioyek, and +Okular. diff --git a/doc/preview.txt b/doc/preview.txt index 383a8f5..f16b1ae 100644 --- a/doc/preview.txt +++ b/doc/preview.txt @@ -22,10 +22,12 @@ CONTENTS *preview-contents* 3. Install ............................................... |preview-install| 4. Configuration ........................................... |preview-config| 5. Presets ............................................... |preview-presets| + - Math rendering ....................................... |preview-math| 6. Commands ............................................. |preview-commands| 7. Lua API ................................................... |preview-api| 8. Events ............................................... |preview-events| 9. Health ............................................... |preview-health| + 10. SyncTeX ............................................. |preview-synctex| ============================================================================== REQUIREMENTS *preview-requirements* @@ -68,6 +70,10 @@ Provider fields: ~ receives a |preview.Context| and returns a string[]. + {extra_args} (string[]|function) Appended to {args} after evaluation. + Useful for adding flags to a preset + without replacing its defaults. + {cwd} (string|function) Working directory. If a function, receives a |preview.Context|. Default: git root or file directory. @@ -177,13 +183,49 @@ override individual fields by passing a table instead: >lua `latex` latexmk -pdf → PDF (with clean support) `pdflatex` pdflatex → PDF (single pass, no latexmk) `tectonic` tectonic → PDF (Rust-based LaTeX engine) - `markdown` pandoc → HTML (standalone, embedded) - `github` pandoc → HTML (GitHub-styled, `-f gfm` input) + `markdown` pandoc → HTML (standalone, KaTeX math) + `github` pandoc → HTML (GitHub-styled, `-f gfm`, KaTeX math) `asciidoctor` asciidoctor → HTML (AsciiDoc with SSE reload) `plantuml` plantuml → SVG (UML diagrams, `.puml`) `mermaid` mmdc → SVG (Mermaid diagrams, `.mmd`) `quarto` quarto render → HTML (scientific publishing) +Math rendering (pandoc presets): ~ + *preview-math* + +The `markdown` and `github` presets use `--katex` by default, which inserts a +`