是否可以更改 tex4ht 中的 dvi 编译设置?我问这个问题是因为当我尝试为我的 latex 文件生成 html 时,出现了一个奇怪的错误:
! Use of \leftmargin doesn't match its definition.
[exec] \@listi ...argin \leftmargini \parsep 4\p@ \@plus
[exec] 2\p@ \@minus \p@ \topsep 8...
[exec] l.18 \begin{itemize}
[exec]
[exec] ?
[exec] ! Emergency stop.
[exec] \@listi ...argin \leftmargini \parsep 4\p@ \@plus
[exec] 2\p@ \@minus \p@ \topsep 8...
[exec] l.18 \begin{itemize}
生成 pdf 或 dvi(使用 texify.exe)时,我没有遇到类似错误
更新。我创建了一个产生错误的示例文本:
\documentclass[10pt]{book}
\usepackage{float}
\usepackage{hyperref}
\usepackage{tabularx}
\usepackage[style=altlist, %Verwendung eines Glossars
nonumberlist,
numberedsection,
acronym,
toc]{glossaries}
\newacronym{ie}{{\small IE}}{}
\newacronym{ml}{{\small ML}}{}
\makeglossaries
\begin{document}
\chapter{Example}
\glsresetall
\subsection{Fundamentals}
\gls{ie}
\begin{table}[tpb]
\begin{center}
\begin{tabularx}{\columnwidth}{|l|X|}
\hline
\textbf{Doc No} & \textbf{Text} \\ \hline
5641 & Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium \\ \hline
9382 & Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium \\ \hline
\end{tabularx}
\end{center}
\caption{AAA \label{tbl:unstr_example}}
\end{table}
\gls{ie}
\appendix
\printglossary[toctitle=Acronyms,type=\acronymtype]
\printglossary[toctitle=Glossary, type=main]
\bibliographystyle{apalike}
\bibliography{}
\clearpage
\pagestyle{empty}
\end{document}
示例文档的错误消息是(运行:htlatex test_doc.tex):
! Use of \leftmargin doesn't match its definition.
\@listi ...argin \leftmargini \parsep 4\p@ \@plus
2\p@ \@minus \p@ \topsep 8...
l.2 \begin{theglossary}
\glossaryheader
?
! Emergency stop.
\@listi ...argin \leftmargini \parsep 4\p@ \@plus
2\p@ \@minus \p@ \topsep 8...
l.2 \begin{theglossary}
\glossaryheader
如果我从首字母缩略词定义中删除,则不会出现错误\small
:\newacronym{ie}{{\small IE}}{information extraction}
答案1
这不是 tex4ht 的问题。这个简化的示例已经与 pdflatex + makeglossaries 不兼容:
\documentclass[10pt]{book}
\usepackage[style=altlist, %Verwendung eines Glossars
nonumberlist,
numberedsection,
acronym,
toc]{glossaries}
\newacronym{ie}{{\small IE}}{}
%\newacronym{ie}{{\protect\small IE}}{}
\makeglossaries
\begin{document}
\gls{ie}
\gls{ie}
\printglossary[toctitle=Acronyms,type=\acronymtype]
\end{document}
解决办法是保护命令\small
。