Introduction

At Markup UK 2023, I discussed various methods for converting XML to TeX and presented our own approach using the transpect library xml2tex, which can be configured to convert arbitrary XML into TeX [8]. xml2tex and its associated libraries are based on XProc and XSLT and are used at le-tex for several applications, such as a converter for converting Word to TeX, an equation renderer, and for our typesetting system xerif[9].

For the latter, the schema-independent configurability of xml2tex helps to meet the diverse content requirements of our xerif clients. The configuration allows us to use several different XML schemas and map them to customer-specific TeX macros. While the xml2tex configuration allows us to map XML to TeX very flexibly with xerif , the layout setup, e.g. setting up the page format, selecting fonts, specifying spacing, etc. is still done conventionally in TeX.

In xerif, CoCoTeX serves this purpose. It’s a custom-tailored TeX framework that facilitates the setup of these parameters and extends LaTeX with numerous custom macros, a custom metadata and table model, accessibility support, and more. However, TeX’s complexity and the steep learning curve of our CoCoTeX framework presenting a major hurdle for external newcomers attempting to use xerif effortlessly.

A language for formatting page-based media that is considered much easier to learn is PrintCSS. Unlike TeX, PrintCSS is accessible and user-friendly, leveraging the familiar CSS syntax. This approach has led to its widespread adoption in automated publishing workflows. PrintCSS introduces a set of CSS specifications tailored for print media, enabling precise control over page layouts, content fragmentation (such as pages, columns, or regions), and content generation (including running headers, page numbers, and listings). By utilizing PrintCSS, HTML or XML content can be formatted for paged media output in a manner akin to styling conventional web pages with CSS.

However, it's important to note that PrintCSS has certain limitations: the existing specifications lack specific features, and in some areas, they remain underspecified. Moreover, there are only a limited number of implementations of these specifications, and the two available open-source renderers implement only a subset of the common CSS paged media features. Instead, these implementations address the absence of certain functionalities through the use of proprietary extensions. Leading developers of browser engines—namely Google, Mozilla, and Apple—do not provide support for PrintCSS in their browsers and show little motivation to include this feature in the future.

Nevertheless, the advantages of PrintCSS's ease of learning outweigh the disadvantages of its ambiguous specifications, so we sought to investigate the feasibility of incorporating PrintCSS support within the xerif framework. Starting from October 2024, Christine took on the task as part of her bachelor thesis and was able to implement a prototypic support for PrintCSS in xerif . This paper aims to outline the steps undertaken to implement their solution, discuss how we addressed the conceptual and technological differences between PrintCSS and TeX, and identify potential directions for future research.



[8] 1 Martin Kraetke (2023): Bridging the Gaps Between XML and TEX. Available at https://markupuk.org/2023/webhelp/index.html (Accessed: May 15, 2025)

[9] le-tex publishing services (2025): xerif. automatic is better. Available at: https://www.le-tex.de/en/xerif.html (Accessed: May 15, 2025)