LaTeX-generation stage in our pipeline
The part of our collection PDF pipeline I spend most of my time in is the stage where we convert CNXML+MathML to LaTeX. Most of the non-MathML work is done in two stylesheets: latex/tolatex.xsl, and latex/cnxml.xsl (which is imported by tolatex.xsl, along with stylesheets for handling math, indexes, and glossaries). tolatex.xsl is the driving stylesheet, and it is supposed to organize high-level document structure like chapters, while chunks from sections and smaller are handled in cnxml.xsl. Now that modules can be chapters, or sections, or subsections, or subsubsections, they are sometimes handled in the one stylesheet, sometimes in the other. I'm about to define a template that applies to all module document elements, whether they are chapters or not. Does its definition belong in tolatex.xsl, or in cnxml.xsl? Pragmatically, the transform should work either way, but the question suggests that it's time to rethink the division of labor between the two stylesheets for the sake of creating a more rational basis for future development of the print system. This in turn suggests that we rethink how we represent document elements outside of modules in collections (e.g. groups comprising modules, indexes, glossaries, bibliographies, lists of figures, etc.). It's kind of a hodge-podge at present.
