I would like to manually create a separate file with preamble "pre-compiled". I found a very simple example at:
ultrafast pdflatex with precompiling
where Jonas Stein describes their example:
book.tex %&preamble \begin{document} Hi \end{document}and
preamble.tex \documentclass{article}
They then proceed to instruct what to write at bash console, but I think that means they are on an OS other than Windows. Jonas suggests:
$ pdflatex -ini -jobname="preamble" "&pdflatex preamble.tex\dump $ latexmk -pdf -pvc -e '$latex=q/latex %O -shell-escape %S/' book.tex
Here are some other relevant articles, some with apparently other versions of the command:
- Custom format file: How to automate the generation of the "precompiled preamble" whenever one of the files that are used there are changed
pdflatex -ini -jobname=main "&pdflatex preamble.tex\dump" - Tool to handle "precompiling the preamble" automatically
pdflatex -ini &pdflatex mylatex.ltx tst.tex - Precompiled preamble with TikZ/Externalize
pdflatex -ini -job-name="main" "&pdflatex fmt.tex\dump" - http://magic.aladdin.cs.cmu.edu/2007/11/02/precompiled-preamble-for-latex/
latex -ini -job-name="main" "&latex preamble.tex\dump" - ultrafast pdflatex with precompiling
- Speeding up LaTeX compilation
I don't know if the location should be pertinent, they are in:
C:\Users\aUserName\Documents\MikTexDocs
EDIT:
Here is what I understand so far:
For the simple files suggested by Jonas, I use the command:
pdflatex -ini -jobname="book" "&pdflatex preamble.tex\dump
How I understand this is, in command prompt, pdflatex takes option -ini, I'm just going to toss words in, not sure how they go (from http://ccrma.stanford.edu/planetccrma/man/man1/tex.1.html), executable, precompile macros into an fmt file. So the command above takes macros in preamble.tex and dumps them precompiled into a new file book.fmt. Now that we have a format file, we want to apply it to the book.tex file. So the following command has "worked":
pdflatex -fmt book book
As I understand it, this command applies the book.fmt file to the book.tex file. The PDF will now reflect a recent typesetting.
Now, I thought I would be able to get this all to work with the typeset GUI in TeXworks, so that pressing typeset would result in faster typesetting than before. But so far, typesetting with the "external" preamble only works from command line. Am I headed nowhere I intended?
Also, I thought the "preamble" %&book would make the typesetting action would pull the preamble from the fmt file and allow the typeset to be successful.