Repository navigation
Conversation
d52dd16 to
29097a2
Compare
|
If you use Claude to directly open new PRs, maybe you need to ask Claude to follow the PR template proposed in #963. |
Add a "latexml" Makefile target that builds a multi-page HTML version of each engine's manual in html-<engine>/, as a replacement for the single-page tex4ht build (which is left unchanged for now): - one page per section (LATEXML_SPLITAT=subsection for shorter pages), named after the section labels, with a navigation menu on the left that expands the current section - MathML output, typeset by MathJax by default (LATEXML_MATHJAX=no to use the browsers' native MathML rendering) - stylesheet with the colors of the PDF (sections, keywords, examples) - index entries link directly to the keywords (latexml/fix_index.py) - relative links between the manuals of different engines and to the PDF doc/latexml/ holds the LaTeXML bindings of the manual's macros, stubs for packages that LaTeXML cannot process, the stylesheet, and a README with the design, the status and the remaining work (installing on the website, keeping old URLs working). In colvars-refman.tex, \iflatexml skips the LaTeX definitions of the macros reimplemented for LaTeXML, and \ifcvhtml is true for any HTML build. [update-doc] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29097a2 to
80e88c0
Compare
There was a problem hiding this comment.
I tried this offline using our current container, and I got:
$ make latexml
convert -flatten -resize 512x576 eulerangles.pdf eulerangles-512px.png
WARNING: The convert command is deprecated in IMv7, use "magick" instead of "convert" or "magick convert"
Building html-gromacs/index.html with release label "doc_latexml"
rm -rf html-gromacs ; mkdir -p html-gromacs
latexmlc --path=latexml --preload=colvars-latexml.sty --css=latexml/colvars-refman.css --javascript=https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js --format=html5 --split --splitat=section --splitnaming=labelrelative --urlstyle=file --navigationtoc=context --log=html-gromacs/latexml.log --destination=html-gromacs/index.html colvars-refman-gromacs.tex \
> html-gromacs/latexml.out 2>&1 || (tail -20 html-gromacs/latexml.out; false)
/bin/sh: line 1: latexmlc: command not found
make: *** [Makefile:107: html-gromacs/index.html] Error 1
Can you please create a new container with the necessary toolkit and use it for the CI tests (which also need updating to run make latexml)?
Once everything works and the switch is made we can delete the Fedora container that we are using currently (and to which I don't think anyone is particularly attached)
There was a problem hiding this comment.
🟡 Changes recommended
The HTML build rule omits required TeX input dependencies, causing incremental builds to silently retain stale version and command-reference content.
1 open issue
What changed in this PR
Adds an optional LaTeXML build for multi-page, engine-specific HTML manuals alongside the existing PDF and tex4ht builds.
Changes:
- Adds
make latexmlwith configurable page splitting, MathJax rendering, and URL styles. - Introduces macro bindings, responsive styling, and index-link post-processing.
- Adapts shared manual sources for LaTeXML and documents setup and remaining migration work.
| File | Description |
|---|---|
doc/Makefile |
Adds LaTeXML build options, targets, and cleanup. |
doc/latexml/README.md |
Documents design, installation, usage, and limitations. |
doc/latexml/mdframed.sty.ltxml |
Provides a lightweight framed-block binding. |
doc/latexml/fix_index.py |
Rewrites index links with meaningful labels. |
doc/latexml/colvars-refman.css |
Styles navigation, headings, keywords, and examples. |
doc/latexml/colvars-latexml.sty.ltxml |
Implements manual macros and copyable example blocks. |
doc/latexml/catchfile.sty.ltxml |
Supports release-label and file-content loading. |
doc/latexml/babel.sty.ltxml |
Provides an English-only babel compatibility stub. |
doc/colvars-refman.tex |
Adds HTML conditionals and shared title-page macros. |
doc/colvars-refman-main.tex |
Selects HTML-friendly figures and removes an unused heading label. |
doc/.gitignore |
Ignores generated LaTeXML output directories. |
Review effort: Balanced
| latexml: images $(LATEXML_HTML) | ||
|
|
||
| html-%/index.html: colvars-refman-%.tex colvars-refman-main.tex colvars-refman.tex \ | ||
| $(BIBTEX) colvars-code-refs.bib $(IMAGES) $(wildcard latexml/*) Makefile |

Depends on #995 (this PR targets its branch, and GitHub will retarget it to
masteronce #995 is merged).Adds a
make latexmltarget that builds a multi-page HTML version of each engine's manual with LaTeXML, indoc/html-<engine>/. The existing tex4ht build (make html) and the website install targets are left unchanged for now.Output
sec_colvarbias/index.html);LATEXML_SPLITAT=subsectiongives shorter pages. The navigation menu is a sidebar on the left that expands the current page's sub-items; on narrow screens it moves above the content.LATEXML_MATHJAX=nouses the browsers' native MathML rendering and no JavaScript.$<$...$>$placeholders become literal<...>, and quotes stay ASCII.latexml/fix_index.py).../html-<engine>/index.html).Source changes
doc/latexml/: LaTeXML bindings of the manual's macros (\cvsec,\key,\keydef, example environments, ...), stubs for packages LaTeXML can't process (babel, mdframed, catchfile), the stylesheet, and a README with the design, the LaTeXML pitfalls found, and the remaining work.colvars-refman.tex:\iflatexmlskips the LaTeX definitions of the macros reimplemented for LaTeXML;\ifcvhtmlis true for any HTML build (LaTeXML or tex4ht) and selects PNG figures. The title page and the links to the other manuals were factored into macros shared by all builds.colvars-refman-main.tex:\ifcvhtmlfor the two PNG figures; removed an unused\labelkeyon a section heading, which LaTeXML would use as the page name.Testing
make -j5 latexml(about 90 s): all five engines build with 0 errors and 2 warnings (one multi-linealignedequation that LaTeXML's math parser doesn't fully understand; it still displays). A link checker over all pages found no broken internal links.masteras well.Not in this PR (see
doc/latexml/README.md)colvars-refman-vmd.html#sec:dashboardworking, e.g. with a redirect page. Keyword anchors already use the original labels (#abf|fullSamples).Requires LaTeXML ≥ 0.8.8 (installation notes in the README).
🤖 Generated with Claude Code