GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
1
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
Handbook
Browse code
- Added default rules for PS/EPS -> PDF.
master
1 parent
fc48063
commit
5730a064d92165752cb04488f1770f7bff46da32
nstanger
authored
on 19 Jul 2005
Patch
Showing
1 changed file
make-includes/build_lecture_rules.make
Ignore Space
Show notes
View
make-includes/build_lecture_rules.make
################################################################################ # # File: $Id$ # # Standard variables and rules for building a set of lecture files. # Altering these definitions will affect ALL LECTURE MAKEFILES FOR ALL # PAPERS!! If you need to do something specific for a particular paper, # include a custom rule in its makefile. DON'T add it here! # ################################################################################ ################################################################################ # # Add standard file suffixes. # .SUFFIXES: .pdf .tex .dvi .graffle .png .tif .plo .jpg .pict .eps .ps ################################################################################ # # Standard directories. # IMGDIR=images ################################################################################ # # Standard paths. # vpath %.graffle $(IMGDIR) vpath %.pdf $(IMGDIR) vpath %.png $(IMGDIR) vpath %.tif $(IMGDIR) vpath %.jpg $(IMGDIR) vpath %.plo $(IMGDIR) vpath %.ps $(IMGDIR) vpath %.eps $(IMGDIR) ################################################################################ # # Files to be cleaned by the various "clean" targets. # TIDY_FILES+=*.tmp *.aux *.out *.log *.nav *.toc *.snm *.head *.dvi \ slides-combined.pdf slides-notes.pdf CLEAN_FILES+=*.pdf ################################################################################ # # Various environment variables. # # Set DRAFT to anything to run in draft mode (e.g., make DRAFT=draft xxx). # DRAFT= # # Specify LaTeX document options (comma-separated list). # LATEX_OPTS+=pdftex,usepdftitle=false,$(DRAFT) # # Base file names for the various documents. # SLIDES?=Chapter$(CHAPTER)slides FIGURES?=Chapter$(CHAPTER)figures COMBINED?=Chapter$(CHAPTER)combined NOTES?=Chapter$(CHAPTER)notes # # List of standard "phony" build targets. # TARGETS+=all slides notes slides-combined slides-notes figures figures2up \ combined debug test clean tidy targets # .PHONY: $(TARGETS) ################################################################################ # # Display a message if someone tries to build a target that has been # disabled (by setting the appropriate variable to empty in the makefile). # disabled_message=@echo The \"$(1)\" target has been disabled for this chapter. ################################################################################ # # Build everything. # all: slides notes figures figures2up combined ################################################################################ # # Build presentation slides. If $(SLIDES) is empty, these rules are ignored. # ifneq ($(strip $(SLIDES)),) # # Set the prerequisites for the "slides" build target, depending on # whether the figures document exists. If $(FIGURES) is non-empty, we need # to include the figures .aux file for inter-document cross-references. # ifeq ($(strip $(FIGURES)),) SLIDES_PREREQS:=$(SLIDES).pdf else SLIDES_PREREQS:=figures $(SLIDES).pdf endif # # Build the slides for the presentation. # slides: $(SLIDES_PREREQS) $(SLIDES).pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{beamer}\input{$(SLIDES)}' pdflatex --jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{beamer}\input{$(SLIDES)}' else slides: $(call disabled_message,$@) endif ################################################################################ # # Build the presentation notes. If $(NOTES) is empty, these rules are # ignored. # ifneq ($(strip $(NOTES)),) # # Build the slides with notes. # slides-notes: slides-notes.pdf slides-notes.pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{beamer}\input{$(SLIDES)}' pdflatex --jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{beamer}\input{$(SLIDES)}' # # Build the slides with notes, 6-up. # notes: $(NOTES).pdf $(NOTES).pdf: slides-notes.pdf pdfnup --nup 2x3 --outfile $@ $< else notes slides-notes: $(call disabled_message,$@) endif ################################################################################ # # Build the complete combined lecture document. If $(COMBINED) is empty, # these rules are ignored. # ifneq ($(strip $(COMBINED)),) # # Set the prerequisites for the "combined" build target, depending on # whether the figures document exists. If $(FIGURES) is empty, they are # omitted from the combined document. # ifeq ($(strip $(FIGURES)),) COMBINED_PREREQS:=$(COMBINED).tex slides-combined.pdf else COMBINED_PREREQS:=$(COMBINED).tex slides-combined.pdf $(FIGURES).pdf endif # # Build the slides for the combined document. # slides-combined: slides-combined.pdf slides-combined.pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{beamer}\input{$(SLIDES)}' pdflatex --jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{beamer}\input{$(SLIDES)}' # # Build the complete combined document. # combined: $(COMBINED).pdf $(COMBINED).pdf: $(COMBINED_PREREQS) pdflatex $< pdflatex $< else combined slides-combined: $(call disabled_message,$@) endif ################################################################################ # # Build the figures and examples document. If $(FIGURES) is empty, these # rules are ignored. # ifneq ($(strip $(FIGURES)),) figures: $(FIGURES).pdf $(FIGURES).pdf: $(FIGURES).tex $(FIG_IMAGES) pdflatex $< pdflatex $< figures2up: $(FIGURES)-reduced.pdf $(FIGURES)-reduced.pdf: $(FIGURES).pdf pdfnup $< --nup 2x1 --outfile $@ else figures figures2up: $(call disabled_message,$@) endif ################################################################################ # # Build the test document. # test: test.pdf test.pdf: test.tex ################################################################################ # # Debugging: print the values of the standard variables. # debug: @announce Externally defined variables @echo "TEACHING_SHARED = [$(TEACHING_SHARED)]" @echo "CHAPTER = [$(CHAPTER)]" @announce Internally defined variables @echo "GLOBAL_HANDBOOK_INCLUDE = [$(GLOBAL_HANDBOOK_INCLUDE)]" @echo "SLIDE_IMAGES = [$(SLIDE_IMAGES)]" @echo "SLIDE_BACKGROUNDS = [$(SLIDE_BACKGROUNDS)]" @echo "FIG_IMAGES = [$(FIG_IMAGES)]" @echo "TIDY_FILES = [$(TIDY_FILES)]" @echo "CLEAN_FILES = [$(CLEAN_FILES)]" @echo "DRAFT = [$(DRAFT)]" @echo "LATEX_OPTS = [$(LATEX_OPTS)]" @echo "SLIDES = [$(SLIDES)]" @echo "FIGURES = [$(FIGURES)]" @echo "COMBINED = [$(COMBINED)]" @echo "NOTES = [$(NOTES)]" @echo "SLIDES_PREREQS = [$(SLIDES_PREREQS)]" @echo "COMBINED_PREREQS = [$(COMBINED_PREREQS)]" @echo "TARGETS = [$(TARGETS)]" ################################################################################ # # Clean up: get rid of all the temporary files. # tidy: rm -f $(TIDY_FILES) # # Clean up: get rid of everything except the original source. # clean: tidy rm -f $(CLEAN_FILES) ################################################################################ # # List all "phony" build targets. # targets: @echo "targets: $(TARGETS)" ################################################################################ # # Standard default rules. # # PDF from LaTeX via DVI, typically for images drawn using PSTricks). # %.pdf: $(IMGDIR)/%.tex latex --jobname=$(IMGDIR)/$* $< dvips -q -f $(IMGDIR)/$* | ps2eps -q -l | epstopdf -f -o=$(IMGDIR)/$@ # # PDF from LaTeX. # %.pdf: %.tex pdflatex $< pdflatex $< # # PDF from OmniGraffle. (We can't automate this.) # %.pdf: %.graffle @echo "$(notdir $<): regenerate $(notdir $@)" @exit 1 # # PNG from TIFF. # %.png: %.tif convert "$<" $(IMGDIR)/$@ # # PDF from Ploticus. # %.pdf: %.plo ploticus -eps -tightcrop -o stdout $< | shiftbbox | epstopdf --filter --outfile=$(IMGDIR)/$@ # # PDF from PS # %.pdf: %.ps ps2eps --ignoreBB --nohires --loose < $< | ps2pdf -dEPSCrop - $(IMGDIR)/$@ # # PDF from EPS # %.pdf: %.eps ps2eps --ignoreBB --nohires --loose < $< | ps2pdf -dEPSCrop - $(IMGDIR)/$@
################################################################################ # # File: $Id$ # # Standard variables and rules for building a set of lecture files. # Altering these definitions will affect ALL LECTURE MAKEFILES FOR ALL # PAPERS!! If you need to do something specific for a particular paper, # include a custom rule in its makefile. DON'T add it here! # ################################################################################ ################################################################################ # # Add standard file suffixes. # .SUFFIXES: .pdf .tex .dvi .graffle .png .tif .plo .jpg .pict ################################################################################ # # Standard directories. # IMGDIR=images ################################################################################ # # Standard paths. # vpath %.graffle $(IMGDIR) vpath %.pdf $(IMGDIR) vpath %.png $(IMGDIR) vpath %.tif $(IMGDIR) vpath %.jpg $(IMGDIR) vpath %.plo $(IMGDIR) ################################################################################ # # Files to be cleaned by the various "clean" targets. # TIDY_FILES+=*.tmp *.aux *.out *.log *.nav *.toc *.snm *.head *.dvi \ slides-combined.pdf slides-notes.pdf CLEAN_FILES+=*.pdf ################################################################################ # # Various environment variables. # # Set DRAFT to anything to run in draft mode (e.g., make DRAFT=draft xxx). # DRAFT= # # Specify LaTeX document options (comma-separated list). # LATEX_OPTS+=pdftex,usepdftitle=false,$(DRAFT) # # Base file names for the various documents. # SLIDES?=Chapter$(CHAPTER)slides FIGURES?=Chapter$(CHAPTER)figures COMBINED?=Chapter$(CHAPTER)combined NOTES?=Chapter$(CHAPTER)notes # # List of standard "phony" build targets. # TARGETS+=all slides notes slides-combined slides-notes figures figures2up \ combined debug test clean tidy targets # .PHONY: $(TARGETS) ################################################################################ # # Display a message if someone tries to build a target that has been # disabled (by setting the appropriate variable to empty in the makefile). # disabled_message=@echo The \"$(1)\" target has been disabled for this chapter. ################################################################################ # # Build everything. # all: slides notes figures figures2up combined ################################################################################ # # Build presentation slides. If $(SLIDES) is empty, these rules are ignored. # ifneq ($(strip $(SLIDES)),) # # Set the prerequisites for the "slides" build target, depending on # whether the figures document exists. If $(FIGURES) is non-empty, we need # to include the figures .aux file for inter-document cross-references. # ifeq ($(strip $(FIGURES)),) SLIDES_PREREQS:=$(SLIDES).pdf else SLIDES_PREREQS:=figures $(SLIDES).pdf endif # # Build the slides for the presentation. # slides: $(SLIDES_PREREQS) $(SLIDES).pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{beamer}\input{$(SLIDES)}' pdflatex --jobname=$(SLIDES) '\documentclass[$(LATEX_OPTS)]{beamer}\input{$(SLIDES)}' else slides: $(call disabled_message,$@) endif ################################################################################ # # Build the presentation notes. If $(NOTES) is empty, these rules are # ignored. # ifneq ($(strip $(NOTES)),) # # Build the slides with notes. # slides-notes: slides-notes.pdf slides-notes.pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{beamer}\input{$(SLIDES)}' pdflatex --jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{beamer}\input{$(SLIDES)}' # # Build the slides with notes, 6-up. # notes: $(NOTES).pdf $(NOTES).pdf: slides-notes.pdf pdfnup --nup 2x3 --outfile $@ $< else notes slides-notes: $(call disabled_message,$@) endif ################################################################################ # # Build the complete combined lecture document. If $(COMBINED) is empty, # these rules are ignored. # ifneq ($(strip $(COMBINED)),) # # Set the prerequisites for the "combined" build target, depending on # whether the figures document exists. If $(FIGURES) is empty, they are # omitted from the combined document. # ifeq ($(strip $(FIGURES)),) COMBINED_PREREQS:=$(COMBINED).tex slides-combined.pdf else COMBINED_PREREQS:=$(COMBINED).tex slides-combined.pdf $(FIGURES).pdf endif # # Build the slides for the combined document. # slides-combined: slides-combined.pdf slides-combined.pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) pdflatex --jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{beamer}\input{$(SLIDES)}' pdflatex --jobname=slides-combined '\documentclass[$(LATEX_OPTS),handout]{beamer}\input{$(SLIDES)}' # # Build the complete combined document. # combined: $(COMBINED).pdf $(COMBINED).pdf: $(COMBINED_PREREQS) pdflatex $< pdflatex $< else combined slides-combined: $(call disabled_message,$@) endif ################################################################################ # # Build the figures and examples document. If $(FIGURES) is empty, these # rules are ignored. # ifneq ($(strip $(FIGURES)),) figures: $(FIGURES).pdf $(FIGURES).pdf: $(FIGURES).tex $(FIG_IMAGES) pdflatex $< pdflatex $< figures2up: $(FIGURES)-reduced.pdf $(FIGURES)-reduced.pdf: $(FIGURES).pdf pdfnup $< --nup 2x1 --outfile $@ else figures figures2up: $(call disabled_message,$@) endif ################################################################################ # # Build the test document. # test: test.pdf test.pdf: test.tex ################################################################################ # # Debugging: print the values of the standard variables. # debug: @announce Externally defined variables @echo "TEACHING_SHARED = [$(TEACHING_SHARED)]" @echo "CHAPTER = [$(CHAPTER)]" @announce Internally defined variables @echo "GLOBAL_HANDBOOK_INCLUDE = [$(GLOBAL_HANDBOOK_INCLUDE)]" @echo "SLIDE_IMAGES = [$(SLIDE_IMAGES)]" @echo "SLIDE_BACKGROUNDS = [$(SLIDE_BACKGROUNDS)]" @echo "FIG_IMAGES = [$(FIG_IMAGES)]" @echo "TIDY_FILES = [$(TIDY_FILES)]" @echo "CLEAN_FILES = [$(CLEAN_FILES)]" @echo "DRAFT = [$(DRAFT)]" @echo "LATEX_OPTS = [$(LATEX_OPTS)]" @echo "SLIDES = [$(SLIDES)]" @echo "FIGURES = [$(FIGURES)]" @echo "COMBINED = [$(COMBINED)]" @echo "NOTES = [$(NOTES)]" @echo "SLIDES_PREREQS = [$(SLIDES_PREREQS)]" @echo "COMBINED_PREREQS = [$(COMBINED_PREREQS)]" @echo "TARGETS = [$(TARGETS)]" ################################################################################ # # Clean up: get rid of all the temporary files. # tidy: rm -f $(TIDY_FILES) # # Clean up: get rid of everything except the original source. # clean: tidy rm -f $(CLEAN_FILES) ################################################################################ # # List all "phony" build targets. # targets: @echo "targets: $(TARGETS)" ################################################################################ # # Standard default rules. # # PDF from LaTeX via DVI, typically for images drawn using PSTricks). # %.pdf: $(IMGDIR)/%.tex latex --jobname=$(IMGDIR)/$* $< dvips -q -f $(IMGDIR)/$* | ps2eps -q -l | epstopdf -f -o=$(IMGDIR)/$@ # # PDF from LaTeX. # %.pdf: %.tex pdflatex $< pdflatex $< # # PDF from OmniGraffle. (We can't automate this.) # %.pdf: %.graffle @echo "$(notdir $<): regenerate $(notdir $@)" @exit 1 # # PNG from TIFF. # %.png: %.tif convert "$<" $(IMGDIR)/$@ # # PDF from Ploticus. # %.pdf: %.plo ploticus -eps -tightcrop -o stdout $< | shiftbbox | epstopdf --filter --outfile=$(IMGDIR)/$@
Show line notes below