PrintCSS Meets TeX

Christine Windeln and Martin Kraetke

Overview

  1. Building a PrintCSS Renderer
  2. Demo
  3. Outlook and Q/A

Building a PrintCSS Renderer

MarkupUK 2023

  • introduced xml2tex
  • schema-agnostic configuration
  • used for docx2tex and xerif

Creating Layouts for xerif

  • TeX: steep learning curve and abstract concepts (tokens, expansion control, and macro definitions)
  • TeX programmers are a rare species
  • need to learn CoCoTeX as well

Would PrintCSS serve as an alternative?

  • moderatly easy to learn
  • limited features, partly ambiguous specifications
  • dependent on Prince and AH for professional use

Render PrintCSS with TeX?

  • CSS: easy layout setup
  • TeX: powerful rendering engine

Render PrintCSS with TeX?

  • declarative vs procedural
  • TeX has no HTML or CSS parser
  • different concepts

PrintCSS prototype

I. Parsing PrintCSS

  • EBNF schema REx parser generator parser XSLT
  • Output: CSS XML and XHTML/CSSa

II. XSLT Transformations

  1. insert placeholder elements in XHTML
  2. generate xml2tex config from CSS XML and XHTML
  3. apply xml2tex on XHTML

Outlook

  • integrate in xerif
  • add xerif features as vendor-specific extensions
  • explore CSS modules such as grid, flexbox

Questions?