I'm trying to speed up my big preamble with many packages by using mylatexformat. And I have lots of errors, the majority of which comes from the glossaries package.
My 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}
The \endofdump command prohibits the "normal" use of Latex, so it should be commented out for normal runs. But it is needed for mylatexformat that should be started from terminal (opened in the same folder as the *.tex file). I've typed the command presented in the makeformat manual in the terminal:
etex -initialize -save-size=20000 -stack-size=20000 -jobname="mlt" "&pdflatex" mylatexformat.ltx """mlt.tex"""
where mlt.tex is the name of the *.tex file and also the name of the supposed *.fmt file (-jobname="mlt"). I've got the *.fmt file mlt.fmt, but as I tried to include it (by %&mlt in the very first line of mlt.tex), I've got no result (and so many errors).
I also tried a sample example without glossaries (i.e. many other packages were included, but not this one), and it was successful.