I recently created a makefile to use with my TeX documents and am quite happy with the discovery. When I create Beamer slides to use in class, I create both a set of slides and a handout to go along with them. I'd like to have a makefile that creates the slides, then changes one or two lines of the header of my TeX file (by uncommenting and commenting perhaps) to create a set of handouts (possibly by generating a new, intermediate TeX file). I'm guessing that a make file can't edit my TeX file, but that would be cool. Is it possible? Thanks!
|
|
This is the same sort of problem as asked the Passing parameters to a document question; what follows is adapted from my answer there. Have the target in your Makefile clobber a file that is For example, let the Makefile have:
HEADERNAME = My Header
handout: echo "\def\hdrparam{$(HEADERNAME)}">params.tex; latex manuscript
Then |
|||
|
|
The way I would accomplish this would be to place the core content in one LaTeX file (say |
|||||
|
|
Another way to do this is to use a macro to contain the information you wish to pass, and do something like
in your |
|||
|
|
The answer by las3rjock is probably the best, but if you really want |
|||
|
|
|
My answer to the question passing parameters to a document wasn't great because I didn't give any code. So I'll take this opportunity to put the code in! In short, my method for this is to have symlinks to the main file with the name of the symlink containing parameters. It is, perhaps, not as flexible as passing options to the file but it does mean that the resulting compiled file will have the right name and neither it nor any of the auxiliary files will get clobbered by making different versions. The core bit of the code is as follows:
It's probably not the cleanest code - I could probably condense half the |
|||
|
|
