Closed llbit closed 6 years ago
Hey, thanks for leaving a note here. I think for your use case, you will indeed need to just do multiple builds. Even so, the Makefile should be able to help you with the individual builds. You can create a Makefile.ini in the same directory that has a rule for your overall document, that uses make to build the various pieces. So, perhaps something like this:
# In Makefile.ini
mydocument.pdf: main.tex frontpage.pdf otherpage.pdf
make frontpage.pdf
make otherpage.pdf
make main.pdf
There are a lot of cases that are super hard for the Makefile to tease out from logs, and this looks like one of them, so it's probably best to just add your own custom rule in Makefile.ini this way. The Makefile will include your file and you should still be able to do everything using a single make command. Hopefully. Fingers crossed.
Thank you for the suggestion! It works very nicely. However, I noticed that each time I do make clean; make everything
, frontpage.pdf
is compiled twice. It's not a big deal, but it seems unnecessary. This is my current Makefile.ini
(I moved frontpage.tex
into a subdirectory):
everything: main.tex sections/frontpage.pdf
make sections/frontpage.pdf
make main.pdf
Is there some way I could make the everything
target be the default target?
Oops, I'm afraid that's my fault. I led you astray with make syntax. There is no need to "make sections/frontpage.pdf" since it's already in the dependency list. So, your rule can be simplified:
everything: main.tex sections/frontpage.pdf make main.pdf
The problem with this is that if main.tex pulls in any dependencies of its own (other than the other .pdf files), those will also need to be added to trigger a rebuild of "everything".
Don't forgot to use .PHONY:
.PHONY: everything everything: main.tex sections/frontpage.pdf make main.pdf
:)
Okay, I updated my Makefile.ini
as you suggested. It works fine (it still compiles frontpage.pdf
twice).
It seems like the build gets stuck in an infinite loop (constantly rebuilding frontpage.pdf
) if I just run make
without arguments, but make everything
is what I'm doing now.
Cool. I'm still somewhat mystified about what triggers those weird loopy build cases, but I'm glad you have a working setup now!
Thanks for the help!
I'm currently working on a large document that consists of several pdfs glued together with the pdfpages package. I'd like the main document and all included documents to be compiled by a single Makefile, but it does not work as I want it to:
Inside
main.tex
, I have:If I try to build everything from scratch I get the following error:
If I keep a copy of
frontpage.pdf
and add it to theneverclean
variable, then I end up in an infinite loop rebuildingfrontpage.pdf
constantly.Is there any way to get this to work, or do I have to split it up into separate builds?
Edit: I tried with latex-makefile 2.2.1-alpha9 and 2.2.1-alpha10