
Estoy intentando compilar el libro HoTT con htlatex y estaba intentando reproducir un problema que ocurre con htlatex pero no con pdflatex. Sin embargo, ni siquiera pude conseguir un pequeño ejemplo funcional utilizando pdflatex.
Me gustaría saber por qué este código no funciona y cómo solucionarlo.
\documentclass{article}
\usepackage{amsthm}
\usepackage{aliascnt}
\usepackage[capitalize]{cleveref}
\usepackage{hyperref}
\newtheorem{thm}{Theorem}[section]
\crefname{thm}{Theorem}{Theorems}
\theoremstyle{remark}
\newaliascnt{rmk}{thm}
\newtheorem{rmk}[rmk]{Remark}
\aliascntresetthe{rmk}
\crefname{rmk}{Remark}{Remarks}
\begin{document}
.
\begin{thm}
.
\end{thm}
\begin{rmk}
.
\end{rmk}
\end{document}
Me da
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
entering extended mode
(D:\Documents\GitHub\book\test.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("D:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("D:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
("D:\Program Files\MiKTeX 2.9\tex\latex\amscls\amsthm.sty")
("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\aliascnt.sty"
("D:\Program Files\MiKTeX 2.9\tex\latex\carlisle\remreset.sty"))
(D:\Documents\GitHub\book\cleveref.sty)
("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hyperref.sty"
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-hyperref.sty"
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-generic.sty"))
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
(D:\Documents\GitHub\book\ifxetex.sty)
("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\auxhook.sty")
("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty")
("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\pd1enc.def")
("D:\Program Files\MiKTeX 2.9\tex\latex\00miktex\hyperref.cfg")
("D:\Program Files\MiKTeX 2.9\tex\latex\ltxmisc\url.sty"))
Package hyperref Message: Driver (autodetected): hpdftex.
("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hpdftex.def"
("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty"))
(D:\Documents\GitHub\book\test.aux)
("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\nameref.sty"
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\gettitlestring.sty"))
(D:\Documents\GitHub\book\test.out) (D:\Documents\GitHub\book\test.out)
! LaTeX Error: No counter 'r' defined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.20 \begin{rmk}
?
! Emergency stop.
...
l.20 \begin{rmk}
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.
¿Por qué busca un contador "r" y cómo soluciono este problema?
Respuesta1
No puedo dar una respuesta técnica profunda, pero según sumanual sección 13:
El paquete Cleveref debe cargarse después de todos los demás paquetes que no lo soportan específicamente, es decir, el
\usepackage{cleveref}
La línea normalmente debería ser el último comando \usepackage en el preámbulo de su documento.
Respuesta2
La solución fue llegar \usepackage{hyperref}
a la cima. Si alguien quiere explicarme por qué es así, estaré encantado de marcarlo como respuesta aceptada.