diff --git a/slides_template/Makefile b/slides_template/Makefile index 8c5fb52..56272c9 100644 --- a/slides_template/Makefile +++ b/slides_template/Makefile @@ -1,8 +1,9 @@ #!/usr/bin/make -# fonts.tex is a fragment meant to be \input, not a document of its own, so it -# has to stay out of the list or make will try to typeset it. -TEX := $(filter-out fonts.tex,$(wildcard *.tex)) +# fonts.tex and notes-preamble.tex are fragments meant to be \input, not +# documents of their own, so they stay out of the list or make would try to +# typeset them. +TEX := $(filter-out fonts.tex notes-preamble.tex,$(wildcard *.tex)) PDF := $(patsubst %.tex,%.pdf,$(TEX)) JOB := $(patsubst %.tex,%,$(TEX)) diff --git a/slides_template/README.md b/slides_template/README.md index fd983e1..f39989d 100644 --- a/slides_template/README.md +++ b/slides_template/README.md @@ -69,8 +69,10 @@ from. Show it with [dspdfviewer](https://github.com/dannyedel/dspdfviewer), [backstage](https://bckstg.xyz/). To use notes in another ltx-talk document, copy `mknotes` and `talk-notes.sty` -across and load the package. `mknotes` picks up `fonts.tex` when it is present, -so the notes match the deck; `--preamble FILE` names a different fragment. +across and load the package. `mknotes` picks up `notes-preamble.tex`, +or else `fonts.tex`, when present, so the notes match the deck; a deck whose +notes use its own macros defines them in `notes-preamble.tex` (starting with +`\input{fonts.tex}`). `--preamble FILE` names a different fragment. ## Theme diff --git a/slides_template/mknotes b/slides_template/mknotes index 092031a..9e24249 100755 --- a/slides_template/mknotes +++ b/slides_template/mknotes @@ -158,6 +158,10 @@ HMARGIN = 0.06 #: Font setup shared with the slides. Used when it exists, so that the notes #: match the deck without anyone having to remember a flag. +# notes-preamble.tex wins when present: a deck whose notes use its own macros +# defines them there (\input{fonts.tex} included), keeping fonts.tex a pure +# font fragment shared with the slides. +DEFAULT_PREAMBLES = ("notes-preamble.tex", "fonts.tex") DEFAULT_PREAMBLE = "fonts.tex" # The page is laid out by hand rather than by geometry: the header band runs @@ -360,10 +364,10 @@ def main(): # A preamble named on the command line has to be there; the default one is # a convenience and is skipped when the document does not use it. preamble = args.preamble - if preamble and not os.path.exists(preamble): - if preamble != DEFAULT_PREAMBLE: - raise SystemExit(f"mknotes: {preamble} not found") - preamble = None + if preamble == DEFAULT_PREAMBLE: + preamble = next((p for p in DEFAULT_PREAMBLES if os.path.exists(p)), None) + elif preamble and not os.path.exists(preamble): + raise SystemExit(f"mknotes: {preamble} not found") workdir = tempfile.mkdtemp(prefix="mknotes-") try: