Contents

Reference

Companion package

Reference

\ifreflowtex true only in the pipeline’s compile.

webonly, printonly body kept only on the web, or only in print.

webstream[key=value]{kind} typeset the body as a stream of that kind; parameters become data-key, except class (CSS classes) and --name (a CSS custom property); transparent in print.

\webaction{verb:arg}{text} a control; pressed, it goes to the innermost instance around it handling verb (instance.onAction, useAction), then outward, and bubbles as a reflowtex:action event; nothing in print.

\webwidget[key=value, default=text]{kind} an inline instance of kind with those parameters, drawn by the kind the page defines (defineInline, or the host API’s define with measure), which reports its size and where it may break; the line breaker may break it across lines. Nothing in print, unless given a default. (The first form, \webwidget[text]{kind:key}, still works.)

\webpart{role}{text} text typeset out of the flow as a part of an instance, instance.part(role): in running text of the \webwidget just before it, between paragraphs of the environment around it. Left out in print.

\webspan[id=…, class={…}]{text} a mark: the text named, for reflowtex.host.mark(id) to find, and given CSS classes (spaces or commas between them, inside the braces); marks nest. Just the text in print.

\webid{id}{text}, \webclass{classes}{text} short for \webspan[id=…] and \webspan[class={…}].

\NewWebEnvironment{env}{kind}{print begin}{print end} an environment of your own: on the web a block of kind, with its [key=value] parameters taken as written; in print, the body between the print code.

\NewWebAside{\cmd}{kind}{print form} a command \cmd[key=value]{text} of your own: on the web an aside of kind (place=margin puts it in the margin); in print, the print form, #1 its text.

\webaside[key=value]{kind}{text} text typeset out of the flow, in running text too, for a page to show where it likes (a popover, a margin note); left out in print. A detached instance: reflowtex.host.instances({kind, …}), its text part('body'), drawn with <Typeset> or part.mount(el, {width}); with place=margin the viewer sets it in the margin, drawn by its kind if the page defines one. Example: \mysidenote on the page Side notes.

\webtext{name}{default} text a page may replace: reflowtex.host.setText(name, text), or one instance’s setText(text); null for the default again; the default in print.

webaccordion[initial=,print=] one webpane[name] shown at a time.

\webpanelink, \webnextpane, \webprevpane switch pane: a name, a number, next, prev, first, last.

webnote, webhint a note; a hint blurred until clicked, and again on the next click.

leantheorem[decl=,url=,show=] a theorem with its proof and Lean code: switches in the theorem’s frame open either or both beneath it.

leanproof[decl=,url=,show=], leancode a proof and its Lean code in one frame, each shown or hidden by its own switch; option leanprint=false leaves the code out of print. The macros of leanblueprint – \lean, \leanok, \uses and the rest – compile as markers. (The Lean environments are reflowtex-lean.sty, loaded with the package.)

\DeclareWebBox[new]{env}[options] draw env (or a copy of it named new) as a box; options kind, accent, background, class.

[boxed] package option: every \newtheorem environment and proof boxed.

.latex-stream[data-kind=…] a stream’s element; its first child holds the laid-out content.

reflowtex.host.define(kind, {render, measure?}) how a kind is drawn, for every placement: a block in the flow, a note in the margin, a widget’s pieces. The companion package’s define and defineInline do it with a Preact component. The contract, with every type: src/viewer/src/host/types.ts.

A webstream is block-level: it starts and ends a paragraph. A \webaside is not: it may stand in a sentence. The DOM contract is in src/viewer/README.md, section Streams, and the wire format in src/schema/latex.proto, message Stream.