7

On Windows there is a nice little tool called latexdaemon that can handle "precompiling the preamble" (and thus speeding up compilation) automatically. It doesn't require any additional setup: one can simply run latexdaemon --ini=pdflatex mytexfile.tex, and from there on it'll recompile the tex file each time it changes with the custom format file optimization (which I don't completely understand). It also provides a console where one can force recompilation manually, or force full recompilation (without the custom format file).

I am looking for similar tools that run on OS X.

On this site I have found several questions about precompiling the preamble, but none of them automate the process: they all require splitting the preamble into a separate file manually. I am looking for a tool that will spare me this trouble, and will let me start working on a new tex file with a single command, without the necessity to manually create multiple files and set up things each time.

Update: I tried to figure out how latexdaemon works, and the relevant bit for generating the format file is here. Looking at that code makes it clear that it's way above my level of (very basic) LaTeX knowledge though.

I think the main question which I haven't been able to solve on my own was how to generate and use a format file without splitting off the preamble into a separate file.

Szabolcs
  • 2,685
  • Let us know if this is indeed a duplicate of the question I linked to above, and if not, please edit your question to include why it is not a duplicate. – Peter Grill Dec 06 '12 at 22:50
  • 2
    @PeterGrill : The difference is here : "They all require splitting the preamble into a separate file."

    However, I think it's a wrong cause of concern. You'll most likely be using that preamble many times, or with slight modifications, and splitting the static reusable content (most of the preamble) from the dynamic content (the rest of the preamble + the document) makes this reuse easier.

    – T. Verron Dec 06 '12 at 22:54
  • @T.Verron: Good point. – Peter Grill Dec 06 '12 at 22:58
  • 2
    mylatex and its more recent update mylatexformat don't require the preamble to be in a separate file. – David Carlisle Dec 06 '12 at 23:07
  • @Peter It's what T. Verron said, I don't want to split off the preamble into another file manually. It was very convenient to use latexdaemon, which suported this, on Windows, and now I miss it a lot. – Szabolcs Dec 07 '12 at 00:50
  • @T.Verron I agree that it certainly becomes necessary to split it when working on a very large document, such as a thesis. But I often work with small, few page documents. When worked on Windows and I could use latexdaemon, it was extremely convenient and quick to start a new document. I'd simply like to have the same convenience on OS X: start a new document that I can share or open someone else document with a single command and be able to have very fast compilation (which gave me semi-real time preview--impossible without the speedup). – Szabolcs Dec 07 '12 at 00:53

1 Answers1

6

If using the original mylatex then a command line such as

 pdflatex -ini &pdflatex mylatex.ltx tst.tex 

should make a format that loads the preamble from tst.tex. Depending on your command line shell you may need to quote the & as \&.

David Carlisle
  • 757,742