0

I have the following test.tex document:

\documentclass{article}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{cleveref}
\newtheorem{thm}{Theorem}[section]
\newtheorem{rmk}[thm]{Remark}
\begin{document}
\begin{rmk}
.
\end{rmk}
\end{document}

With pdflatex and latex, everything works fine:

D:\Documents\GitHub\book>latex test.tex
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\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 (default): hdvips.

("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hdvips.def"
("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\pdfmark.def"
("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty")))
("D:\Program Files\MiKTeX 2.9\tex\latex\amscls\amsthm.sty")
(D:\Documents\GitHub\book\cleveref.sty)
No file test.aux.
("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\nameref.sty"
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\gettitlestring.sty"))

Package hyperref Warning: Rerun to get /PageLabels entry.

[1] (D:\Documents\GitHub\book\test.aux)

Package rerunfilecheck Warning: File `test.out' has changed.
(rerunfilecheck)                Rerun to get outlines right
(rerunfilecheck)                or use package `bookmark'.

 )
Output written on test.dvi (1 page, 2332 bytes).
Transcript written on test.log.

D:\Documents\GitHub\book>pdflatex test.tex
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\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:\Program Files\MiKTeX 2.9\tex\latex\amscls\amsthm.sty")
(D:\Documents\GitHub\book\cleveref.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)
[1{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
(D:\Documents\GitHub\book\test.aux) )<D:/Program Files/MiKTeX 2.9/fonts/type1/p
ublic/amsfonts/cm/cmbx10.pfb><D:/Program Files/MiKTeX 2.9/fonts/type1/public/am
sfonts/cm/cmr10.pfb><D:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm
/cmti10.pfb>
Output written on test.pdf (1 page, 28695 bytes).
Transcript written on test.log.

D:\Documents\GitHub\book>

However, with htlatex, I get errors:

D:\Documents\GitHub\book>htlatex test.tex

D:\Documents\GitHub\book>latex  \makeatletter\def\HCode{\futurelet\HCode\HChar}\
def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafte
r\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#
1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HC
ode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentsty
le[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode .a.
b.c.\input  test.tex
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)
entering extended mode
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:\Documents\GitHub\book\test.tex
("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\generic\tex4ht\tex4ht.sty")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\usepackage.4ht")
("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"

Package auxhook Warning: Cannot patch \document,
(auxhook)                using \AtBeginDocument instead.

) ("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: Stopped early.

)

Package hyperref Message: Driver: htex4ht.

("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\htex4ht.def")
("D:\Program Files\MiKTeX 2.9\tex\latex\amscls\amsthm.sty")
(D:\Documents\GitHub\book\cleveref.sty)
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.4ht"
::::::::::::::::::::::::::::::::::::::::::
 TeX4ht info is available in the log file
::::::::::::::::::::::::::::::::::::::::::
) ("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\tex4ht.sty"
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\color.sty"
("D:\Program Files\MiKTeX 2.9\tex\latex\00miktex\color.cfg")
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\dvips.def")
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\dvipsnam.def"))
--- needs --- tex4ht test ---
(D:\Documents\GitHub\book\test.tmp)
l.1437 --- TeX4ht warning --- No file test.xref ---
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\latex.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\fontmath.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\article.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\hyperref.4ht"
("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\nameref.sty"
("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\gettitlestring.sty"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\nameref.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\pd1enc.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\url.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\amsthm.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\color.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\dvips.4ht"
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\dvipsnam.4ht"
("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\dvipsnam.def")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4.4ht")
("D:\Program Files\MiKTeX 2.9\tex\generic\tex4ht\html4-math.4ht"))
No file test.aux.
! Argument of \eorem:syle has an extra }.
<inserted text>
                \par
l.8 \begin{rmk}

?

What went wrong, and how do I fix it?

6
  • i'm not sure what's different using \newaliascnt{rmk}{thm} that wouldn't be provided by amsthm's \newtheorem{rmk}[thm]{Remark}? (i also suggest using a different \theoremstyle, either remark or definition, so the text isn't set in italic.) Mar 26 '14 at 18:37
  • Indeed, \newaliascnt{rmk}{thm} is not necessary to produce the error. I've updated the question statement. The \theoremstyle is, indeed, changed in my source material, but I cut out that command for my minimal (non-)working example. Mar 27 '14 at 0:18
  • i'm not familiar with htlatex, but the error message makes me wonder if there's something in the interaction between amsthm and cleveref that's triggering it. what happens if cleveref is omitted? also, i've always gone by the principle that hyperref should almost always be loaded last, since its redefinitions of many "core" commands can be changed only at one's peril. (not in a position where i can test anything now; can only make suggestions.) Mar 27 '14 at 0:32
  • If cleveref is omitted, everything works fine. If I load hyperref after cleveref, then I get a different error: tex.stackexchange.com/questions/167849/…. Mar 27 '14 at 0:37
  • And if I do \AtBeginDocument{\usepackage{cleveref}}, then htlatex works fine. Mar 27 '14 at 0:38
3

The solution is to use \AtBeginDocument{\usepackage{cleveref}}, to ensure that it is loaded after various packages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.