
Estou tentando compilar o livro HoTT com htlatex e estava tentando reproduzir um problema que ocorre com o htlatex, mas não com o pdflatex. No entanto, não consegui nem um pequeno exemplo prático usando pdflatex.
Gostaria de saber por que esse código não funciona e como corrigi-lo.
\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}
Isso me dá
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 que está procurando um contador "r" e como faço para corrigir isso?
Responder1
Não posso fornecer uma resposta técnica profunda, mas de acordo com suamanual seção 13:
O pacote intelligentef deve ser carregado depois de todos os outros pacotes que não o suportam especificamente, ou seja, o pacote
\usepackage{inteligente}
A linha geralmente deve ser o último comando \usepackage no preâmbulo do seu documento.
Responder2
A solução foi subir \usepackage{hyperref}
para o topo. Se alguém quiser me explicar por que isso acontece, ficarei feliz em marcar isso como uma resposta aceita.