Well, after a good bit of wrangling, here is another round. We have URLs pointing to static sources; I got upstream to fix things so we don't need a patch; and now we're generating the doc output's pdf from the TeX source. The latter is what made this take so much time and effort. On the one hand, it required packaging up 6 texlive dependencies, which are included in the attached patches. On the other hand, it turns out that the texlive-amsfonts package is broken, which we need to typset the metamath doc output. This caused me tons of grief but turns out to be a known issue: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40558 Thus, as of commit a1f84aca, the attached patch for metamath actually breaks. However, with the proposed patched included in issue #40558 above, it builds just fine. Regarding the patches for the texlive packages, I did all of them as simple-texlive-package templates with #:trivial? #t, grabbing the files from tex/latex and doc/latex. Is this reasonable? Looking at other packages, I cannot tell whether it'd be preferable to directly generate everything from the *.dtx and *.sty sources. Also, regarding texlive-mathstyle and texlive-flexisym, their files reside under latex/breqn, but since they have their own ctan pages, I opted to split them into separate packages and make the dependencies explicit. Does that seem reasonable? Anyway, thanks for taking a look! Hopefully, these look mergeable apart from the texlive-amsfonts issue.