Coming from
WebFluent for LaTeX and Typst authors
WebFluent prints PDFs and slide decks from the same language it builds websites with, with no TeX installation and no browser. If you know LaTeX or Typst, the shapes are familiar — a document, headings, a table of contents, page headers and footers — but the layout is the web's: rows, stacks and grids, styled with CSS.
The paper
You write
\documentclass[a4paper]{article} / #set page(paper: "a4")
In WebFluent
Document(size: "A4", margin: "20mm") { … }
Title and author
You write
\title{…}\author{…} / #set document(title: …)
In WebFluent
Document(title: "Q1 report", author: "Acme")
A section
You write
\section{Results} / = Results
In WebFluent
Heading("Results").h2 (the title is the h1)
A subsection
You write
\subsection{Method} / == Method
In WebFluent
Heading("Method").h3
A paragraph
You write
a blank line between paragraphs
In WebFluent
Text("…"), or Markdown("…") for several
Bold and italic
You write
\textbf{x}, \emph{x} / *x*, _x_
In WebFluent
Text("x").bold, Text("x").italic, or **x** in Markdown
A list
You write
itemize / - item
In WebFluent
List { List.Item { Text("…") } }
The contents
You write
\tableofcontents / #outline()
In WebFluent
TableOfContents(levels: 2)
A new page
You write
\newpage / #pagebreak()
In WebFluent
PageBreak
Keep together
You write
\begin{minipage} / block(breakable: false)
In WebFluent
style { break-inside: avoid }
Headers and footers
You write
fancyhdr / #set page(header: …)
In WebFluent
Header { … } … Footer { Text("Page {page} of {pages}") }
A table
You write
tabular / #table(…)
In WebFluent
Table { Table.Head { … } Table.Body { … } }
A figure
You write
\includegraphics{chart.png} / #image("chart.png")
In WebFluent
Image(src: "/chart.png", alt: "…")
A chart
You write
pgfplots
In WebFluent
Chart(kind: .bar, data: SALES, x: "month", y: "web")
A macro
You write
\newcommand{\price}[1]{…} / #let price(x) = …
In WebFluent
component Price(_ amount: Number) { … }
Data
You write
\input{data}, datatool / #let data = json("data.json")
In WebFluent
data sales: [Sale] = "sales.json", held to its type when the build reads it, or a const
Fonts
You write
fontspec / #set text(font: …)
In WebFluent
a .ttf or .otf under fonts/, named in font-family
Slides
You write
Beamer frames / Touying
In WebFluent
Presentation { Slide { … } }, with "output_type": "slides"
Building
You write
pdflatex, latexmk / typst compile
In WebFluent
wf build, with "output_type": "pdf" in the config
Things that work differently
The layout is CSS. A document is laid out from the same HTML and CSS a web page would get: Row, Stack and Grid place things side by side, and a style { } block or a .css file styles them. There are no TeX boxes and glue to tune.
Breaking across pages is a rule, not a command. Paragraphs keep two lines on each side of a break, a heading moves with what follows it, and a table repeats its header row on every page it continues on. Ask for the rest with break-inside: avoid and PageBreak.
There is no math typesetting. A formula is a picture or an SVG you place with Image. There is no bibliography system either; references are text you write.
Arabic and right-to-left work out of the box. A document whose lang is ar, he, fa or ur is laid out right to left, and shaping comes with it — no extra packages.
One source, three outputs. The page that prints as a PDF can also be a web page, and a Presentation is a deck from the same components (PDF and slides).
A component, ported
A short report with a footer and a table, in LaTeX and in WebFluent.
\documentclass[a4paper]{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\cfoot{Page \thepage}
\title{Quarterly report}
\author{Acme Studio}
\begin{document}
\maketitle
\section{Sales}
Revenue grew in every region.
\begin{tabular}{lr}
Region & Revenue \\
North & \$2.4M \\
South & \$1.9M \\
\end{tabular}
\end{document}
page Report(path: "/", title: "Quarterly report", description: "Sales for the quarter.") {
Document(size: "A4", title: "Quarterly report", author: "Acme Studio") {
Footer { Text("Page {page} of {pages}").muted.sm.center }
Heading("Quarterly report").h1
Text("Acme Studio").muted
Heading("Sales").h2
Text("Revenue grew in every region.")
Table(caption: "Revenue by region") {
Table.Head { Table.Row { Table.Cell("Region") Table.Cell("Revenue") } }
Table.Body {
Table.Row { Table.Cell("North") Table.Cell("$2.4M") }
Table.Row { Table.Cell("South") Table.Cell("$1.9M") }
}
}
}
}
- The footer is an element, drawn on every page, with
pageandpagesin scope. - The table is the web's table, broken between rows and with its header repeated when it spans pages.