diff --git a/make-includes/build_lecture_rules.make b/make-includes/build_lecture_rules.make index 728581a..4dc38a6 100644 --- a/make-includes/build_lecture_rules.make +++ b/make-includes/build_lecture_rules.make @@ -148,9 +148,22 @@ ifneq ($(strip $(NOTES)),) # +# Set the prerequisites for the "slides-notes" 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)),) +NOTES_PREREQS:=$(NOTES).pdf +SLIDES_NOTES_PREREQS:=slides-notes.pdf +else +NOTES_PREREQS:=figures $(NOTES).pdf +SLIDES_NOTES_PREREQS:=figures slides-notes.pdf +endif + +# # Build the slides with notes. # -slides-notes: slides-notes.pdf +slides-notes: $(SLIDES_NOTES_PREREQS) slides-notes.pdf: $(SLIDES).tex $(SLIDE_IMAGES) $(SLIDE_BACKGROUNDS) $(SLIDE_FILES) $(LATEXCMD) --jobname=slides-notes '\documentclass[$(LATEX_OPTS),notes=onlyslideswithnotes]{lectureslides}\input{$(SLIDES)}' @@ -159,7 +172,7 @@ # # Build the slides with notes, 6-up. # -notes: $(NOTES).pdf +notes: $(NOTES_PREREQS) $(NOTES).pdf: $(NOTES).tex slides-notes.pdf $(LATEXCMD) $< @@ -313,10 +326,12 @@ @$(ECHO) "DRAFT = [$(DRAFT)]" @$(ECHO) "LATEX_OPTS = [$(LATEX_OPTS)]" @$(ECHO) "SLIDES = [$(SLIDES)]" + @$(ECHO) "SLIDES_PREREQS = [$(SLIDES_PREREQS)]" + @$(ECHO) "SLIDES_NOTES_PREREQS = [$(NOTES_PREREQS)]" @$(ECHO) "FIGURES = [$(FIGURES)]" @$(ECHO) "COMBINED = [$(COMBINED)]" @$(ECHO) "NOTES = [$(NOTES)]" - @$(ECHO) "SLIDES_PREREQS = [$(SLIDES_PREREQS)]" + @$(ECHO) "NOTES_PREREQS = [$(NOTES_PREREQS)]" @$(ECHO) "COMBINED_PREREQS = [$(COMBINED_PREREQS)]" @$(ECHO) "TARGETS = [$(TARGETS)]"