Open xworld21 opened 10 months ago
@xworld21 could we double-check the intended behavior here? The PDF build shows:
where the pdflatex build also prints the warning:
LaTeX Warning: Cref reference format for label type `thm' undefined on input li
ne 8.
[1{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux)
LaTeX Warning: There were undefined references.
LaTeXML currently seems to show the linked 1
part of the ref, but doesn't print ???
to signal thm
was an unknown label. Maybe we should, and also raise a warning?
Edit: changing thm
to theorem
fixes both PDF and HTML builds, for what that's worth.
Oh, I mistyped the example. The \newtheorem
needs to be in the preamble. Then the PDF will show the expected label.
I investigated a little bit. cleveref.sty patches \newtheorem
in order to automatically set the names, so of course LaTeXML won't pick that up. The binding has to do some work to attach itself to defineNewTheorem
, or wrap the LaTeXML version of \newtheorem
, I suppose.
I'd say the labels should also return ??
, ????
so that the missing definitions are visible? At least with ??
one can see the missing tags and fix the problem by calling \crefname
manually.
It appears that cleveref is not working as intended.
If I understand correctly, the problem is somewhere around here:
I gather that there should be a tag with role
creftypecap
... ? E.g. loading hyperref adds a tag with role"autoref"
, but for some reason cleveref does not have the same effect.Edit: fixed location of
\newtheorem
.