shiblon / latex-makefile

A Makefile for LaTeX - drop it in, type make, and magic happens.
Other
185 stars 30 forks source link

No support for precompiling the preamble #118

Closed shiblon closed 8 years ago

shiblon commented 8 years ago

Originally reported on Google Code with ID 105

When the first line of a tex document states:
%&[preamble out dir]/preamble

The preamble should be precompiled with something like:
pdflatex -interaction=nonstopmode -output-directory=[preamble out dir] -ini -output-format=pdf
"&latex [preamble dir]/preamble.tex\dump"

The [preamble dir] might be specified in line 2 like this:
% \input{[preamble dir]/preamble}
, but otherwise it should ask or get it via input.

Reported by beruic on 2010-12-17 03:07:06

shiblon commented 8 years ago
Do you have a pointer to some documentation on this feature?  I have never heard of
it before, and I want to get it right if I do add support for it.

Reported by shiblon on 2010-12-20 18:10:54

shiblon commented 8 years ago
Once I get some information, I'll look further into this.  I have never heard of the
%&[preamble out dir] syntax.  So, I await any pointers you may have to relevant documentation.

Reported by shiblon on 2011-01-04 16:01:40

shiblon commented 8 years ago
OK, I have found some more information.  This is called a "format" file, and is a feature
of latex that I have never seen before.  It looks like if you do

%&name

Then run latex with the -ini parameter, it builds name.fmt, which is then included.

So, initial thoughts are that we would have to make a dynamic dependency in the .d
file based on what is found after %& (no spaces).  That would cause us to build the
appropriate .fmt file if needed, and then the input would work file, theoretically.

I need to look at this in more detail, but for now I'll wait for you to confirm that
this is, in fact, how it works.

Reported by shiblon on 2011-01-04 16:07:06

shiblon commented 8 years ago
http://magic.aladdin.cs.cmu.edu/2007/11/02/precompiled-preamble-for-latex/

This has some good info, but not enough to put it into the makefile.  I'll have to
spend some time with this feature to see what it does to various files (especially
.aux and .fmt files)

Reported by shiblon on 2011-01-04 16:12:22

shiblon commented 8 years ago
Sorry for the late answer. So far I am unable to find more documentation to it as well,
but your comment 3 sounds very descriptive for my use. The closest I've gotten is http://man.he.net/man1/pdflatex

Reported by beruic on 2011-02-02 23:44:59

shiblon commented 8 years ago
Wow, this really languished in my inbox for a while.  My apologies.

Give the attached a whirl and let me know how it works for you.

Reported by shiblon@google.com on 2011-04-22 15:44:18


shiblon commented 8 years ago
The revision with diffs in it is r4f885d794e29.

Reported by shiblon on 2011-04-22 15:45:20

shiblon commented 8 years ago
Hello

I'm in the end of my thesis work right now, so I havn't tested this yet.
When I get to it, should I then test with the version you link to here, or just take
the newest from the download page?

Reported by beruic on 2011-05-20 21:17:58

shiblon commented 8 years ago
Either way should be fine :-)

Reported by shiblon on 2011-05-23 15:07:28