我有以下test.tex
文件:
\documentclass{article}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{cleveref}
\newtheorem{thm}{Theorem}[section]
\newtheorem{rmk}[thm]{Remark}
\begin{document}
\begin{rmk}
.
\end{rmk}
\end{document}
使用pdflatex
和latex
,一切正常:
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>
但是,使用时htlatex
出现错误:
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}
?
哪里出了问题?我该如何解决?
答案1
解决办法是使用\AtBeginDocument{\usepackage{cleveref}}
,确保它在各个包之后被加载。