
2014 年の最初の htlatex 号、しかも初日です :)
この行を追加しました
\chapter*{\centering \begin{normalsize}my chapter title\end{normalsize}}
これはpdflatexでは問題なく動作しますが、htlatexでは
! TeX capacity exceeded, sorry [input stack size=5000].
を削除すると\centering
、htlatex はこのエラーを返しました
(./foo2.aux) [1] [2] [1] [2] [3] [1] [2]
! Argument of \im:g has an extra }.
<inserted text>
\par
l.12 ...begin{normalsize}Abstract\end{normalsize}}
それで、何が問題なのかよく分かりません。私は基本的に、本のスタイルでアブストラクトのようなページを作りたかったのですが、上記の解決策はこちらこれは pdflatex では非常にうまく機能しますが、何らかの理由で htlatex はエントリ内のこれらのコマンドを解析する際に問題が発生します\chapter
。引数内の Latex コマンドが気に入らないようです\chapter{....}
。これらを保護する必要があるのでしょうか? 脆弱な問題でしょうか? しかし、pdflatex はこれらを問題なく処理しますか?
htlatex を使用してページの中央にタイトルを配置できる回避策はありますか?
MWE:
\documentclass[12pt]{book}%
\usepackage{lipsum}
\begin{document}
\frontmatter
\title{htlatex issue 010114}
\author{me}
\maketitle
\chapter*{\centering \begin{normalsize}my chapter title\end{normalsize}} %crash
%\chapter*{\begin{normalsize}Abstract\end{normalsize}} %parse error
%\chapter*{Abstract} %only this work
\noindent
\lipsum[75]
\clearpage
\tableofcontents
\mainmatter
\chapter{one}
\section{one}
\lipsum[75]
\end{document}
コンパイルするコマンド:
>htlatex foo2.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
restricted \write18 enabled.
.....
(/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/html4.4ht)
(/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(./foo2.aux) [1] [2] [1] [2] [3] [1] [2]
! TeX capacity exceeded, sorry [input stack size=5000].
\centering ->\let \\
\@centercr \rightskip \@flushglue \leftskip \@flushglue ...
l.10 ...rmalsize}my chapter title\end{normalsize}}
%crash
Output written on foo2.dvi (7 pages, 13108 bytes).
Transcript written on foo2.log.
問題の場所を示すログ ファイルからのテキストの一部:
LaTeX Font Info: ... okay on input line 3.
--- file foo2.css ---
[1
] [2
] [1] [2
] [3]
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <14.4> on input line 8.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 8.
[1] [2]
! TeX capacity exceeded, sorry [input stack size=5000].
\centering ->\let \\
\@centercr \rightskip \@flushglue \leftskip \@flushglue ...
l.10 ...rmalsize}my chapter title\end{normalsize}}
%crash
If you really absolutely need more capacity,
Linux mint で TexLive 2013 を使用する。
タイトルを中央に配置するには、htlatex で次のようにします。
\begin{center}
\chapter*{Abstract} %only this work
\end{center}
したがって、上記の解決策を使用して、必要なことを行うことができます。ただし、問題が示されているため、この質問はここに残しておきます。
答え1
私が言ったように別の質問、セクションコマンドのパラメータとして何も置くことはできません。 . を作成するために処理されるため、TOC
通常の LaTeX では機能しますが、tex4ht では機能しません。したがって、概念的な観点からは、回避策は最初の試みよりもはるかに優れています。\chapter
コマンドを誤用するのではなく、印刷という問題を解決するために他の手段を使用する方が良いと思います。 および をドキュメント本体に配置abstract
する必要性も解決する新しい環境はどうでしょうか?noindent
clearpage
\documentclass[12pt]{book}%
\usepackage{lipsum}
\def\abstracttitle{Abstract}
\newenvironment{abstract}{\begin{center}\abstracttitle\end{center}\par\noindent}{\clearpage}
\begin{document}
\frontmatter
\title{htlatex issue 010114}
\author{me}
\maketitle
\begin{abstract}
\lipsum[75]
\end{abstract}
\tableofcontents
\mainmatter
\chapter{one}
\section{one}
\lipsum[75]
\end{document}
新しい環境 を定義しました。abstract
見出しテキストはマクロに保存される\abstracttitle
ため、必要に応じて再定義できます。このソリューションは、 ですぐに使用できますtex4ht
。