Repository navigation
Releases: sonv/TexViewer
Release list
v2.1.57: Citation notes
Citation notes
Citation notes are now displayed instead of being discarded. For example,
\cite[Lemma~7.3, p.~251]{Santambrogio2015} keeps the lemma and page after
the bibliography number. Two optional arguments retain both the prenote and
postnote.
- Notes preserve inline formatting, math, and nonbreaking spaces.
- The same behavior works in headings, captions, tables, and text macros.
- Bibliography links, hover previews, source navigation, and live edits remain
available with both manual bibliographies and BibTeX entries. - Empty notes, comments, protected brackets, and half-open math intervals are
handled without losing the citation link.
Verified with 692 Rust tests and 42 Chromium/WebKit bibliography and figure-sync
checks.
After updating the plugin and binary, run :MathPreviewRestart.
Prebuilt binaries are available for macOS and Linux on arm64 and x86_64, with
SHA-256 checksums for every archive.
v2.1.56
Figure and caption syncing
Figures now have separate source targets for their images, nested TikZ diagrams, and captions. Moving through a multiline caption follows its words and math. Clicking the preview jumps to the corresponding source location.
- Source anchors stay current after live edits, including figures in input files.
- Table floats distinguish their tabular content from the caption.
- Caption formatting, references, literal text, and labels are preserved. Captions with scoped font or color declarations keep a single sync target to preserve their appearance.
Verified with 678 Rust tests and 24 Chromium/WebKit figure and paragraph checks.
After updating, run :MathPreviewRestart. Existing viewer tabs reload onto the updated client when the daemon upgrades to protocol 92.
Prebuilt binaries are available for macOS and Linux on arm64 and x86_64, with SHA-256 checksums for every archive.
v2.1.55
MathPreview 2.1.55 improves equation references, adds native LaTeX bibliographies, and fixes paragraph headings. It includes the development changes from 2.1.49 through 2.1.55.
Equation references and numbering
- Reference previews render equations even when their source is far outside the visible page. Rendering stays lazy for unrelated equations.
- References to
alignandgatherdisplays highlight the matching row while keeping the full display for context. Labels and aliases stay current during live edits. - Hovering a displayed equation number shows its source labels without repeating the equation. Click a label to copy it. If the browser blocks clipboard access, the label is selected for Ctrl+C or Cmd+C instead.
- Choose per-section or continuous equation numbering in the config panel, independently of theorem numbering. The same option is available as
[viewer] equation-numberingin TOML.
Bibliographies
- Native
thebibliographyand\bibitemsupport includes custom labels, uncited entries, formatted text, math, citation previews, and margin cards. Bibliographies and their entries can come from included files. - Existing
.bibstyles remain available. Authored links and generated DOI/URL links use readable light and dark theme colors, with underlines and keyboard-focus outlines. Printed links remain dark on white paper.
Text and headings
\paragraphand\subparagraphrender as bold run-in headings, including inside proofs and lists. They are unnumbered by default. Use\setcounter{secnumdepth}{4}to number paragraphs, or5to include subparagraphs. Starred headings remain unnumbered.- Inline expressions such as
\emph{at or after} $a$retain their authored spacing. Nested paragraph headings also retain natural spacing in WebKit. - Markdown heading behavior and the existing numbering API remain unchanged.
Upgrade note
WebSocket protocol 91 makes older preview tabs reload onto the matching viewer after the daemon is upgraded. Update the plugin and binary, then run :MathPreviewRestart in existing Neovim sessions.
The four platform archives below contain mathpreview-cli for macOS and Linux, on arm64 and x86_64. Matching .sha256 files are provided for verification.
v2.1.48
MathPreview 2.1.48 makes equation labels easier to discover and keeps their hover previews current during live editing.
Highlights
- Labels above equation previews: hovering an automatically generated equation number shows its exact label keys in a header above the rendered math. Reference and citation previews use the same layout. Aliases and secondary
align/gatherrows resolve to the containing equation. - Reliable deferred rendering: a hover opened while MathJax is loading or updating refreshes when its math finishes. Leaving the hover cancels that refresh, without forcing unrelated or off-screen math to render.
- Correct labels during edits: moving a label between rows updates the hover and refkey overlay without reloading. Commented labels and labels inside inert TeX no longer appear as active equation keys.
- Browser regression coverage: the new
npm run test:hoversuite exercises the real viewer, daemon patches, and bundled MathJax, including delayed rendering, stale placeholders, aliases, cancellation, and row ownership.
Upgrade note
WebSocket protocol 84 makes older preview shells reload onto the matching client. This release includes the hover improvements from the unpublished 2.1.45–2.1.47 development versions and fixes found during their review.
Installation
The four platform archives below contain mathpreview-cli; matching .sha256 files are provided for verification. Existing Neovim sessions should run :MathPreviewRestart after upgrading so an older daemon is not left running.
v2.1.44
MathPreview 2.1.44 publishes the dev-api development line as a stable release.
Highlights
- Versioned converter API: LaTeX and Markdown now produce the same neutral
mathpreview.converter/v1document artifact. Rust integrations can implementDocumentConverter; process integrations can use the persistent NDJSONmathpreview-cli convertinterface. Artifacts carry HTML, patchable blocks, source maps, dependencies, assets, diagnostics, and viewer runtime requirements. - One live viewer pipeline: the existing viewer consumes that shared artifact without losing block patches, source navigation, preamble caching, bibliography updates, TikZ assets, or unsaved-buffer support.
- Markdown parity: multi-row math supports row selection, copy, cursor highlighting, and click-back using the same pipeline as TeX. Configured Jinja-style result blocks can capture titles, labels, and card overrides safely, alongside Bookdown, Quarto, and optional colon-fence styles.
- More faithful TeX: starred section commands render as unnumbered headings without advancing counters.
\DeclarePairedDelimiterX,\DeclarePairedDelimiterXPP, and\newdelimXare now extracted through recursive\inputand local-package chasing, including unsaved included files and common private-helper wrappers. - Reliability fixes: macro declarations retain lexical last-definition-wins behavior across declaration syntaxes, nested declaration factories stay inert until invoked, source coordinates remain UTF-8-byte accurate, and prospective/missing dependencies remain watchable.
- Maintainer documentation: the repository now records the converter/viewer boundary, artifact invariants, static and live data paths, capability fallbacks, versioning rules, and the steps required to add another converter.
Paired-delimiter compatibility
Plain paired-delimiter calls preserve argument counts, token or braced fences, \delimsize, empty fences, and XPP pre/post code. They are currently lowered to always-scaled fixed-arity MathJax macros; mathtools' starred-call and explicit-size-call syntax remains a documented preview limitation.
Installation
The four platform archives below contain mathpreview-cli; matching .sha256 files are provided for verification. Existing Neovim sessions should run :MathPreviewRestart after upgrading so an older daemon is not left running.
v2.1.38 — Markdown previews and extensible custom blocks
Highlights
Markdown previews, built in
.mdand.markdownfiles now use the full live viewer: CommonMark prose,
tables, task lists, strikethrough, code, links, local images, and MathJax math
all update through the same CLI and Neovim workflow as LaTeX.- No additional renderer is required. Markdown parsing and MathJax are bundled
in both Cargo-built and GitHub release binaries, while raw Markdown HTML
remains inert rather than being injected into the page.
Theorems, proofs, and project-defined blocks
- Markdown theorem fences understand both Bookdown and Quarto conventions,
including their native theorem references, forward references, numbering,
and titles. - Proof blocks can reveal blurred content on demand. Projects can define safe,
declarative block appearances, labels, colors, italics, and reveal behavior
through[markdown.blocks.NAME]. - Existing note syntax can be preserved with
[markdown.block-syntaxes.ID]:
literal start templates containing{name}and optional{title}, plus a
literal end marker, support forms such as Jinja-style
{% call result(...) %}/{% endcall %}without executing Jinja. - Config → Markdown config → Recognize
:::blocks controls compact
MathPreview, Bookdown, and Quarto colon fences. The same option is
[markdown] colon-fences; advanced custom formats and start/end templates
remain configurable through TOML. Layered Project, Global, and Custom saves
preserve inherited settings and existing config content.
More dependable source sync and navigation
- Markdown source sync is now token-precise across prose, formatting, tables,
and code. Rapid cursor and selection updates no longer get dropped, and
click-back preserves unsaved symlinked buffers. - Per-buffer snapshots prevent edits in multiple previews from cancelling or
rerouting one another. Heading fragment links, duplicate headings, Unicode
fragments, and footnotes now resolve reliably without colliding with
source-sync IDs. - Local Markdown assets resolve consistently in live and one-shot previews,
and macro-only edits refresh MathJax once without disturbing the compact
update path.
Safety and TeX compatibility
Custom delimiters, block formats, theorem attributes, titles, and colors remain
bounded, escaped, and data-only; malformed or ambiguous structures fail closed.
Markdown parsing, custom blocks, link aliases, and source-sync changes are
format-isolated: existing LaTeX HTML, hashes, IDs, syncing, and viewer behavior
remain unchanged.
Live-update compatibility
WebSocket protocol 77 → 80 carries the corrected Markdown sync, custom-block
interaction state, and live Markdown configuration. Stale tabs reload once to
adopt the matching client, then continue updating normally.
Prebuilt mathpreview-cli archives for macOS and GNU/Linux (arm64/x86_64), plus SHA-256 checksums, are attached below.
v2.1.31 — Readable, configurable reference previews
Highlights
Reference previews at the size you want
-
\ref,\eqref, and\citehover previews are no longer forced into a
fixed 13px font. At the default 100%, they use the configured document font
size as a floor and follow zoom when the page is enlarged, while retaining
the existing viewport bounds and overflow behavior. -
Config → Viewer config → Hover preview size (%) now lets users choose
100–300%. The equivalent TOML setting is:[viewer] hover-preview-scale = 150
Changes apply live. An already-open preview resizes and repositions to stay
inside the viewport, and inherited values are not copied into another config
scope unless edited.
Live-update compatibility
WebSocket protocol 76 → 77 carries the new viewer-config field. Stale tabs
reload once to adopt it, then continue receiving configuration changes live.
Prebuilt mathpreview-cli archives for macOS and GNU/Linux (arm64/x86_64), plus SHA-256 checksums, are attached below.
v2.1.29 — Verified, Rust-free installs
Highlights
Choose how MathPreview installs its daemon
MathPreview now has two explicit managed installation modes:
install_method = "cargo"remains the default and compiles the daemon locally with Cargo.install_method = "github"downloads the exact prebuilt daemon for the plugin version, so users do not need Rust.
For a Peek-style lazy.nvim install/update hook:
{
"sonv/TexViewer",
ft = { "tex", "plaintex", "latex" },
build = "sh scripts/install-prebuilt.sh",
opts = { install_method = "github" },
}The build hook is optional. Without it, GitHub mode downloads the binary on the first :MathPreview and refreshes stale managed binaries after plugin updates.
Self-contained and verified
Release binaries embed MathJax, fonts, JavaScript, and CSS, so normal previews need neither a separate MathJax/npm installation nor a Rust toolchain. Native TikZ rendering remains an opt-in feature that requires a local TeX installation.
Every GitHub download is checked against its published SHA-256 checksum, archive shape, target, and exact mathpreview-cli version before it atomically replaces the managed executable. A failed install leaves the previous executable untouched.
Prebuilt binaries support macOS and GNU/Linux on arm64 and x86_64. GNU/Linux requires glibc 2.34 or newer; Alpine/musl and stock NixOS users should keep the default Cargo mode or provide a compatible, user-managed cmd.
See :MathPreviewStatus for the selected install method, release target, resolved path, and plugin/binary versions.
Prebuilt mathpreview-cli archives for macOS and GNU/Linux (arm64/x86_64), plus SHA-256 checksums, are attached below.
v2.1.28
The preview lives at http://mathpreview.localhost:<port> — per-site browser settings that stick.
Viewer URL
- Previews open on
mathpreview.localhostinstead of a bare IP
(contributed by @gi1242, #6). Browser extensions and per-site settings —
zoom, vimium keybindings, dark-mode toggles — key on the hostname and
ignore ports, so previews no longer share a "site" with every other
localhost service, and onemathpreview.localhostrule covers every
preview port.*.localhostresolves to loopback inside every modern
browser (RFC 6761; Chrome/Firefox resolve it internally, Safari via the
macOS resolver — all verified), so it works with no setup on Linux and
macOS alike. - Rebinding-safe by construction. The daemon's Host/Origin guard
accepts any name whose last label islocalhost— public DNS cannot
serve the reserved.localhostTLD, andlocalhost.evil.comstays
rejected (new adversarial tests cover the edge cases). The plugin's
internal requests stay on127.0.0.1, so nothing depends on the OS
resolver. viewer_hostoption:setup({ viewer_host = "thesis.localhost" })
picks a fixed custom name,"127.0.0.1"reverts to the old address, and
the"{stem}.localhost"template gives each paper its own origin from
its filename (My Paper_v2.tex→http://my-paper-v2.localhost:<port>/)
— recognizable tabs and per-paper browser settings, where the shared
default gives one-time extension setup covering every preview. A
non-loopback value warns at setup instead of opening a tab the daemon
would reject.
Downloads. Prebuilt mathpreview-cli daemon tarballs for macOS (arm64,
x86_64) and Linux (x86_64, arm64), each paired with a SHA-256 checksum.
v2.1.27
The daemon no longer eats memory while you type; \resizebox-wrapped tables render natively.
Memory
- Typing bursts no longer ratchet the daemon's memory. Every keystroke
pushes the whole buffer, and every push used to render the whole document
— concurrently. On a long paper each render outlasts the typing debounce,
so a burst of keystrokes meant tens of full renders in flight at once
(each holding a parsed document plus its HTML), and the allocator kept
that peak: measured 122 → 467–510 MiB per burst on the release binary,
and on Linux it never came back. Over days of editing that is an
out-of-memory kill — as reported by a user whose editor session was
OOM-killed at 3.3 GB after nine hours. Renders are now strictly
one-at-a-time and pushes coalesce onto the newest keystroke: a push
superseded before it renders stores its buffer (a push for an\input
child is never dropped by a concurrent push for the root, or by a save)
but skips the render — the newest push renders everything. Peak memory
during a burst is bounded by one render, and it settles back down between
bursts instead of ratcheting; a sustained burst finishes in a fraction of
the time. - The editor plugin keeps at most one buffer upload in flight. A new
push used to spawn a freshcurlalongside any still-uploading one; on a
slow render that piled up 100+ concurrentcurlprocesses, each holding
the whole buffer in its pipe, inside the editor's own process tree — the
memory a systemd unit charges to the editor. A newer push now cancels the
in-flight upload before starting.
Rendering
\resizebox-wrapped tables render natively. A tabular inside
\resizebox{\textwidth}{!}{…}(or\scalebox/\rotatebox, starred
forms included) outside a float was left in prose, where it degraded into
unsupported-environment chips with raw&-separated cells — the common
\begin{center}\resizebox…{\begin{tabular}…pattern. The box transforms
now unwrap: sizing arguments are dropped (a reflowing HTML preview can't
honor them; comment-split and undelimited arguments scan correctly) and
the content parses normally, so the table renders as a real table at
natural size.
If you were hit by the memory issue: upgrade the daemon binary AND the
plugin (both changed), then :MathPreviewRestart so the running daemon is
the new one — a reused long-lived daemon keeps the old behavior.
Downloads. Prebuilt mathpreview-cli daemon tarballs for macOS (arm64,
x86_64) and Linux (x86_64, arm64), each paired with a SHA-256 checksum.