From 7c862956937cc6a7609ff89a169ea69a88f2454a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mekina?= Date: Thu, 27 Nov 2025 18:30:39 +0100 Subject: [PATCH] fix example appendix --- .gitignore | 1 + Makefile | 10 ++++++---- documentation.typ | 2 +- template/example-appendix.typ | 9 --------- theses/content_cs.typ | 2 +- theses/content_en.typ | 2 +- theses/example_appendix.typ | 18 ++++++++++++++++++ 7 files changed, 28 insertions(+), 16 deletions(-) delete mode 100644 template/example-appendix.typ create mode 100644 theses/example_appendix.typ diff --git a/.gitignore b/.gitignore index 1371298..d9c5988 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /result /target /template/lib/ +/template/example_appendix.pdf diff --git a/Makefile b/Makefile index 65134de..a6f8492 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,15 @@ BUNDLEDIR := $(PACKS_ROOT)/bundle LIB_MUCHPDFTOOLS := lib.typ much_pdf_tools.wasm LIBS := $(LIB_MUCHPDFTOOLS:%=much_pdf_tools/%) -TO_PACK := $(shell find template -type f) template/LICENSE $(LIBS:%=template/lib/%) +TEMPLATE_SRCS := $(shell find template -type f) $(LIBS:%=template/lib/%) \ + template/example_appendix.pdf +TO_PACK := $(TEMPLATE_SRCS) template/LICENSE BUNDLE_THESES := bp_cs bp_en dp_cs dp_en prj_cs prj_en sp_cs sp_en BUNDLE_TARGETS := $(TO_PACK:%=$(BUNDLEDIR)/%) $(BUNDLEDIR)/citations.bib $(BUNDLEDIR)/bp_cs.typ \ $(BUNDLE_THESES:%=$(BUNDLEDIR)/%.typ) $(BUNDLEDIR)/Makefile PACK_TARGETS := $(TO_PACK:%=$(PACKDIR)/%) $(PACKDIR)/documentation.typ \ $(PACKDIR)/documentation.pdf $(PACKDIR)/citations.bib $(PACKDIR)/Makefile -TEMPLATE_SRCS := $(shell find template -type f) $(LIBS:%=template/lib/%) - # == MAIN TARGETS == .PRECIOUS: $(BUILD_DIR)/%.pdf @@ -113,6 +113,9 @@ $(BUILD_DIR)/%.typ: $(BUILD_DIR)/header_%.txt $(BUILD_DIR)/content_%.txt | $(BUI $(BUILD_DIR)/%.pdf: $(BUILD_DIR)/%.typ $(TEMPLATE_SRCS) | $(BUILD_DIR) typst compile --font-path template/fonts --root . $< $@ +template/example_appendix.pdf: theses/example_appendix.typ + typst compile --font-path template/fonts --root . $< $@ + # == PACKS - clean builds for direct use == $(PACKDIR)/%: % | $(PACKDIR) @@ -165,7 +168,6 @@ $(BUNDLEDIR)/citations.bib: citations.bib | $(BUNDLEDIR) ln -f $< $@ $(BUNDLEDIR)/template/%: template/% | $(BUNDLEDIR)/template - @mkdir -p $(@D) ln -f $< $@ $(BUNDLEDIR)/%.typ: $(BUILD_DIR)/content_%.txt | $(BUNDLEDIR) diff --git a/documentation.typ b/documentation.typ index d073f7a..539d625 100644 --- a/documentation.typ +++ b/documentation.typ @@ -429,5 +429,5 @@ Funkce `todo` vám zároveň zabrání v tom, aby se text Lorem Ipsum vyskytl ve #attachments( attach_link("Zdrojový kód této šablony", "https://git.zumepro.cz/tul/tultemplate2"), attach_content("Testovací obsah vygenerovaný Typstem", [Sem lze psát _stylovaný_ obsah.]), - attach_pdf("Ukázkový PDF soubor s dvěma stranami", "tests/pdf_embedding_02.pdf"), + attach_pdf("Ukázkový PDF soubor s dvěma stranami", "template/example_appendix.pdf"), ) diff --git a/template/example-appendix.typ b/template/example-appendix.typ deleted file mode 100644 index aaaba5d..0000000 --- a/template/example-appendix.typ +++ /dev/null @@ -1,9 +0,0 @@ -#set align(center) -#set align(horizon) -#set text(font: "Inter", size: 30pt) - -Toto je ukázkový PDF dokument přiložený k práci jako příloha. - -#pagebreak() - -This is a sample PDF document attached to the thesis as an appendix. diff --git a/theses/content_cs.typ b/theses/content_cs.typ index bff9931..5b44230 100644 --- a/theses/content_cs.typ +++ b/theses/content_cs.typ @@ -448,6 +448,6 @@ Jako demonstrace by měla postačit praktická ukázka, která ve zdrojovém kó #attachments( attach_link("Zdrojový kód této šablony", "https://git.zumepro.cz/tul/tultemplate2"), attach_content("Testovací obsah vygenerovaný Typstem", [Sem lze psát _stylovaný_ obsah.]), - attach_pdf("Vložení PDF přílohy přímo do práce", "example-pdf-appendix.pdf"), + attach_pdf("Vložení PDF přílohy přímo do práce", "template/example_appendix.pdf"), attach_file_reference("Reference na externí soubor", "example-file-appendix.zip"), ) diff --git a/theses/content_en.typ b/theses/content_en.typ index e760fce..a9dfea3 100644 --- a/theses/content_en.typ +++ b/theses/content_en.typ @@ -452,7 +452,7 @@ As a demonstration, there's a practical example included right after this paragr #attachments( attach_link("Source code of this template", "https://git.zumepro.cz/tul/tultemplate2"), attach_content("Test content generated by Typst", [Here you can write _styled_ content.]), - attach_pdf("Insert a PDF file directly into the thesis", "example-pdf-appendix.pdf"), + attach_pdf("Insert a PDF file directly into the thesis", "template/example_appendix.pdf"), attach_file_reference("Reference to an external file", "example-file-appendix.zip"), ) diff --git a/theses/example_appendix.typ b/theses/example_appendix.typ new file mode 100644 index 0000000..f571ccc --- /dev/null +++ b/theses/example_appendix.typ @@ -0,0 +1,18 @@ +#let color = red.lighten(50%) +#set align(center + horizon) +#set text(font: "Inter", 2em, color) +#set page(foreground: rect( + width: 90%, + height: 90%, + stroke: (paint: color, thickness: .03em, dash: (.5em, .5em)), + place(center + bottom, context { + text(str(counter(page).get().at(0)) + "/" + str(counter(page).final().at(0)), 15pt) + v(1em) + }), +)) + +Toto je ukázkový PDF dokument přiložený k práci jako příloha. + +#pagebreak() + +This is a sample PDF document attached to the thesis as an appendix.