Show HN: Weavon, 99.93% Pandoc in 9.3 MB of Rust, 15-50x faster, PDF without TeX (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
When you opt into --pdf-engine=embedded, Weavon skips generating .tex completely and lays out the Pandoc AST directly into PDF 1.7 in pure Rust inside crates/weavon-pdf/src/embedded/. The layout pass paginates headings, paragraphs, tables, footnotes, callouts, and two column layouts straight into zlib-compressed content streams. It embeds TrueType subsets as CID fonts with Unicode maps, using bundled Croscore Arimo and Cousine by default alongside optional font packs or custom fonts. It also converts SVGs directly into PDF vector form XObjects and writes structure trees and metadata for PDF/UA-1 and PDF/A-2u.
For TeX math, weavon-math parses each formula and lays it out against the actual glyph metrics of the embedded fonts, then draws positioned glyphs, rules, and vector paths in crates/weavon-pdf/src/embedded/math.rs.
For embedded raw LaTeX inside Markdown, crates/weavon-pdf/src/embedded/latex_boundary.rs acts as an explicit boundary scanner. It handles the common commands people put in Pandoc Markdown natively, including \newpage, \clearpage, \pagebreak, \vspace, \bigskip, \noindent, \hfill, line breaks, \textbf, \emph, \textit, \texttt, geometry options, and bounded \newcommand expansion inside math.
When it hits raw LaTeX outside that subset, --pdf-fallback controls what happens. The default mode, --pdf-fallback=off, skips the unsupported block and emits a W_PDF_UNSUPPORTED_RAW_LATEX warning. With --pdf-fallback=fragment, Weavon compiles just that raw block as a standalone fragment using lualatex, xelatex, or pdflatex and imports the resulting page as a vector form XObject via page_import.rs. With --pdf-fallback=document, it returns E_PDF_FALLBACK_DOCUMENT so a caller or build script can route the whole file to an external TeX engine instead.