# Is it possible to use mylatex or mylatexformat for documents with preambles almost the same?

I have documents of this form:

\documentclass{article}

\newlength{\variableLength}
\setlength{\variableLength}{xxxx cm}

\usepackage{package1}
\usepackage{package2}
\usepackage{package3}

\makeatletter
% some macros
\makeatletter

\begin{document}
\input{...}
\end{document}


where xxxx can take multiple values.

Is it still possible to make benefit (I have to make the compilations multiple times) of mylatex or mylatexformat?

## Remark

The value is used as follows

\usepackage[paperwidth=10cm,
paperheight=\variableLength,
left=5mm,
right=5mm,
top=5mm,
bottom=5mm]{geometry}


and that's all.

• What are "mylatex" and "mylatexformat"? Please advise. – Mico Sep 23 '15 at 13:47
• – Colas Sep 23 '15 at 14:01
• If \setlength{\variableLength}{xxxx cm} is the only preamble instruction that can vary, have you considered moving it out of the preamble, i.e., placing it after \begin{document}? – Mico Sep 23 '15 at 14:21
• I think using mylatexformat instead of mylatex will do the trick. – Colas Sep 23 '15 at 14:24
• @Mico that's impossible because I use \variableLength in a package. – Colas Sep 23 '15 at 18:07

There is a command in mylatexformat for this purpose. In your preamble, use the command \endofdump to delimit the end of the common part of your preambles.