私は現在、スクリプト化されたドキュメントの生成(.tex-> .pdfおよび.chm)の問題を調査しており、LaTeXの生成に関してはかなり無知であることを認めなければなりません。
短編小説:
PDFはを介して正しく生成されます
pdflatex -output-format=pdf -interaction=batchmode ourfile.tex
次に、スクリプトは3回呼び出します。
latex -interaction=batchmode \makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode html,5.a.b.c.\input ourfile.tex
これにより、次のファイルが生成されます。ourfile.4ct ourfile.4tc ourfile.aux ourfile.dvi ourfile.idx ourfile.log ourfile.xref
次に、スクリプトは、タイトルと参照を含むある種のTOCファイルのように見える.4ctファイルを処理します。スクリプトはこのデータを使用して、chmプロジェクトファイル(hhpファイル)のTOCデータを生成します。
ただし、(2)4回目、5回目、6回目からコマンドを交互に実行すると、コマンドを実行するたびに.4ctファイルと.4tcファイルの内容が入れ替わることがわかりました。あれは:
a)ラテックスを実行... => ourfile.4ct=126行/ourfile.4tc=793行
b)ラテックスを実行... => ourfile.4ct=793行/ourfile.4tc=126行
c)ラテックスを実行... => ourfile.4ct=126行/ourfile.4tc=793行
d)など
生成された.logファイルはourfile.4ctのみを参照し、最初に発生すると次の警告が表示されます...
---------------------------------------------------------
l.1 --- TeX4ht warning --- If not done so, the index is to be processed by
tex '\def\filename{{Td_g}{idx}{4dx}{ind}} \input idxmake.4ht'
makeindex -o Td_g.ind Td_g.4dx
instead of
makeindex -o Td_g.ind Td_g.idx
On some platforms, the quotation marks ' should be
replaced by double quotation marks " or eliminated.
--------------------------------------------------------- ---
...それが役に立ったら。
ポインタをありがとう!