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.


\usepackage[nonumberlist, acronym, toc, section, shortcuts, nopostdot, nogroupskip]{glossaries}
\renewcommand*{\arraystretch}{1.3}  % sets the line indent in glossaries

\newglossary[ilg]{indices}{iyi}{iyg}{List of indices}

\newacronym{ECD}{ECD}{equivalent circuit diagram}
\newacronym{RES}{RES}{renewable energy source}
  description={Equivalent series resistance},
  sort=Rx1, type=symbols
  description={Indicates reference value},
  sort=ref, type=indices

\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]

Some & Text
\gls{ref}, \gls{ECD}, \gls{Rx1}

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.

1 Answer 1


let me know how to show this in a more presentable manner.

I love fast efficient combos too. The combo with mylatexformat is tricky but nevertheless amazing. Package documentation seems like a terrible copy of mylatex and needs updating.

I see the glossaries package (with the makeglossaries command) as a dynamic build. So I follow the instructions in: http://www.howtotex.com/tips-tricks/faster-latex-part-iv-use-a-precompiled-preamble/ They recommend packages such as minitoc to be located after the command \endofdump. For me it will be easier to split the work into two separate files. I don't like the idea of un/commenting a line and compiling differently the same file The first file should be precompile with commnad:

pdftex -ini -jobname="fastformat" "&pdflatex" mylatexformat.ltx """example with a space.tex"""

This name has 3 quote marks only if the document has a space. (But sometimes works for OS systems) The file example1.tex has the following

% Add here more pacakges
% add here those packages after hyperref

% 'saves' everything above into one precompiled preamble
%% or
%\csname endofdump\endcsname

% No glossaries needed here. You could though. They shouldn't be read

This shouldn't be read either on the precompilation
It does work if you comment the endofdump command 
and compile normally with pdflatex

Now, the secondfile that does compile the information has the Glossaries combo AFTER A \endofdump. The second file that should only be compiled with the common commands, say pdflatex, but you might want to try makeglossaries for the glossaries to work. [I haven't it try it with a makeindex or xindy.]

% the name above should match the name on the precompilation.

%add packages taht have problem with mylatexformat

\input{dictionary} % dictionary.tex is the file with glossary and acronyms

First use \gls{api}\    subsequent \gls{api}

%%% \newpage just to demonstrate that links are correct


This last example of glossaries file I found somewhere in tex.stackexchange

Since I use hyperref, all glossaries calls should have a hyperlink. You can remove hyperref but then you migth lose all other hyperlinks in the whole document.

Run once, Compile twice and Reboot three times. Done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .