Let decks define note macros in notes-preamble.tex
Notes that use a deck's own macros failed to typeset, since mknotes
only pulled in fonts.tex. A deck now defines them in notes-preamble.tex
(starting with \input{fonts.tex}), which mknotes prefers when present.
The Makefile keeps the new fragment out of the document list.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user