Contents

About

The project

About

ReflowTEX is an experiment: LA TEX documents on the web, typeset by TEX, but with the lines broken for the reader’s screen instead of fixed in a PDF.

Plans

Now. The viewer breaks paragraphs with its own JavaScript version of the Knuth–Plass algorithm. It uses TEX’s badness, demerits and fitness classes, but its arithmetic and line packing are its own, and its microtype support is simplified. It usually picks the same breaks as TEX, but not always.

Next. Replace it with TEX’s own paragraph builder, compiled to WebAssembly and run in the browser.

This can work because TEX hyphenates a paragraph, forms its ligatures and kerns it before breaking it into lines, and none of that depends on the line width. The node list the build already exports is what the line breaker takes as input. So after one TEX run, TEX’s own code can break the paragraph at any width, and hyphenation, languages and fonts need not be ported to the browser.

How it is built

LuaLA TEX records the finished node list, Protocol Buffers carry it to the page, and the browser breaks it into lines. The repository’s README and docs/ describe the design.

Licence

ReflowTEX is free software under the GNU Affero General Public License, version 3 or later (AGPL-3.0-or-later). Bundled third-party components (the protobuf.js runtime, the fonts a build ships) keep their own permissive licences.

Privacy

This site keeps your settings – the colour theme, the text size and column width, where the inspector is, how the render tests page is set out – in your browser’s storage, so that they are there on your next visit. They are not cookies, they stay on your device, and they are never sent anywhere. The site has no analytics, adverts or other trackers, and loads nothing from other sites. It is served by GitHub Pages, whose servers are covered by GitHub’s own privacy statement.

Source and contact

The source code is at github.com/radek-p/reflowtex. Report bugs and ask questions on the issue tracker. Report security problems privately, through the Security tab.