Overview#
The Koui Genji Monogatari (Collated Tale of Genji) Text Database publishes text data from “Koui Genji Monogatari.”
https://kouigenjimonogatari.github.io/
This time, I added PDF files like the following to the database.
https://kouigenjimonogatari.github.io/output/01/main.pdf

This article describes how to create such PDF files using XSLT and TeX.
Cloning the Repository#
Clone the repository as follows.
Then install xslt3 with the following command.
https://www.npmjs.com/package/xslt3
Creating the XSL File#
This time, we first convert the TEI/XML file to a TeX file.
I created the following XSL file.
https://github.com/kouigenjimonogatari/kouigenjimonogatari.github.io/blob/master/xsl/tex.xsl
Using the previously installed xslt3, you can convert the TEI/XML file to a TeX file as follows.
An excerpt of the converted TeX file is shown below.
Creating the PDF File#
Convert the TeX file to a PDF file using the following command.
Additionally, to use the Noto Serif CJK JP font on macOS, the following was necessary.
Summary#
In the following article, I created an HTML file that enables side-by-side display with IIIF images from the same TEI/XML file used in this article.
In this way, one advantage of creating text in TEI/XML is the ability to produce output tailored to different purposes using XSLT.
My understanding of TeX is still limited in many areas, but I hope this serves as a useful reference for working with TEI/XML.