![用語集と mylatexformat は互換性がありませんか?](https://rvso.com/image/281573/%E7%94%A8%E8%AA%9E%E9%9B%86%E3%81%A8%20mylatexformat%20%E3%81%AF%E4%BA%92%E6%8F%9B%E6%80%A7%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%81%8B%3F.png)
私は、mylatexformat を使用して、多数のパッケージを含む大きなプリアンブルを高速化しようとしています。そして、多くのエラーが発生しており、その大部分は、glossaries パッケージに起因しています。
私のMWE:
\documentclass[11pt,onecolumn,twoside,draft,titlepage,fleqn,a4paper,openright]{book}
\usepackage{titlesec}
\usepackage{longtable}
\usepackage{makeidx}
\usepackage[nonumberlist, acronym, toc, section, shortcuts, nopostdot, nogroupskip]{glossaries}
\renewcommand*{\arraystretch}{1.3} % sets the line indent in glossaries
\setlength{\glsdescwidth}{12.5cm}
\setlength\LTleft{0pt}
\endofdump
\newglossary[slg]{symbols}{syi}{syg}{Nomenclature}
\newglossary[ilg]{indices}{iyi}{iyg}{List of indices}
\makeglossaries
\newacronym{ECD}{ECD}{equivalent circuit diagram}
\newacronym{RES}{RES}{renewable energy source}
\newglossaryentry{Rx1}
{
name={\ensuremath{R_{x1}}},
description={Equivalent series resistance},
sort=Rx1, type=symbols
}
\newglossaryentry{ref}
{
name={*},
description={Indicates reference value},
sort=ref, type=indices
}
\begin{document}
\glsaddall
\printglossary[type=\acronymtype, style=long, title=List of Abbreviations and Acronyms]
\printglossary[type=symbols, style=long, title=Nomenclature]
\printglossary[type=indices, style=long, title=List of indices]
\section*{Sample}
\begin{longtable}{ll}
Some & Text
\end{longtable}
\gls{ref}, \gls{ECD}, \gls{Rx1}
\end{document}
\endofdump コマンドは、Latex の「通常の」使用を禁止するため、通常の実行ではコメント アウトする必要があります。ただし、ターミナルから起動する mylatexformat (*.tex ファイルと同じフォルダーで開く) には必要です。ターミナルで、makeformat マニュアルに記載されているコマンドを入力しました。
etex -initialize -save-size=20000 -stack-size=20000 -jobname="mlt" "&pdflatex" mylatexformat.ltx """mlt.tex"""
ここで、mlt.tex は *.tex ファイルの名前であり、想定される *.fmt ファイルの名前でもあります (-jobname="mlt")。*.fmt ファイル mlt.fmt はありますが、(mlt.tex の最初の行で %&mlt を使用して) それを含めようとしましたが、結果は得られませんでした (エラーが多数発生しました)。
用語集なしのサンプル例も試してみました (つまり、他の多くのパッケージは含まれていますが、このパッケージは含まれていません)。成功しました。
答え1
これをもっと見やすい形で表示する方法をお知らせください。
私も高速で効率的なコンボが大好きです。mylatexformat との組み合わせはトリッキーですが、それでも素晴らしいです。パッケージのドキュメントは mylatex のひどいコピーのようで、更新が必要です。
私は、glossaries パッケージ (makeglossaries コマンドを使用) を動的ビルドとして認識しています。そのため、次の指示に従います。 http://www.howtotex.com/tips-tricks/faster-latex-part-iv-use-a-precompiled-preamble/ minitocなどのパッケージをコマンドの後に配置することを推奨しています。\endofdump私にとっては、作業を 2 つのファイルに分割する方が簡単です。行のコメントを解除したり、同じファイルを別の方法でコンパイルしたりするアイデアは好きではありません。最初のファイルは、コマンドを使用して事前コンパイルする必要があります。
pdftex -ini -jobname="fastformat" "&pdflatex" mylatexformat.ltx """example with a space.tex"""
この名前には引用符が3つあります場合にのみ文書にスペースがあります。(ただしOSシステムでは機能する場合もあります)ファイルexample1.texには次の内容があります。
\documentclass{article}
% Add here more pacakges
\usepackage{hyperref}
% add here those packages after hyperref
% 'saves' everything above into one precompiled preamble
\endofdump
%% or
%\csname endofdump\endcsname
% No glossaries needed here. You could though. They shouldn't be read
\begin{document}
\noindent
Hola.
This shouldn't be read either on the precompilation
It does work if you comment the endofdump command
and compile normally with pdflatex
Done
\end{document}
さて、情報をコンパイルする2番目のファイルには、用語集コンボがAの後に存在します。\endofdump2 番目のファイルは、pdflatex などの一般的なコマンドでのみコンパイルする必要がありますが、用語集を機能させるには makeglossaries を試す必要があるかもしれません。[makeindex または xindy で試したことがありません。]
%&fastformat
% the name above should match the name on the precompilation.
\endofdump
%add packages taht have problem with mylatexformat
%\usepackage{minitoc}
\usepackage[acronym]{glossaries}
\makeglossaries
\input{dictionary} % dictionary.tex is the file with glossary and acronyms
\begin{document}
\noindent
First use \gls{api}\ subsequent \gls{api}
\newpage
\printglossary[type=\acronymtype]
%%% \newpage just to demonstrate that links are correct
\newpage
\printglossary[type=main]
\end{document}
この用語集ファイルの最後の例は、tex.stackexchangeのどこかで見つけたものです。
私は hyperref を使用しているため、すべての用語集呼び出しにハイパーリンクが必要です。hyperref を削除することはできますが、その場合、ドキュメント全体の他のすべてのハイパーリンクが失われる可能性があります。
1回実行、2回コンパイル、3回再起動。完了