Skip to content

Commit

Permalink
Finished templates
Browse files Browse the repository at this point in the history
  • Loading branch information
sesquideus committed Nov 10, 2024
1 parent d6f3773 commit 6fab074
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 0 additions & 4 deletions modules/naboj/builder/venue.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import logging
from pathlib import Path

import core.builder.jinja as jinja
from modules.naboj.builder.builder import BuilderNaboj
from modules.naboj.builder.contexts import BuildableContextVenue


log = logging.getLogger('dgs')


class BuilderNabojVenue(BuilderNaboj):
_target = 'venue'
_subdir = 'venues'
Expand Down
13 changes: 9 additions & 4 deletions modules/naboj/module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ build/naboj/%/tearoff.tex: \
modules/naboj/templates/tearoff.jtt \
modules/naboj/templates/tearoff/problem.jtt \
modules/naboj/templates/tearoff/bottom.jtt \
build/naboj/$$*/build-venue ;
build/naboj/$$*/build-language ;

# % <competition>/<volume>/languages/<language>
build/naboj/%/booklet.tex build/naboj/%/answers.tex build/naboj/%/cover.tex: \
Expand Down Expand Up @@ -247,6 +247,12 @@ output/naboj/%/online.pdf: \
$(call double_xelatex,naboj)
pdftk $@ burst output $(dir $@)/%02d.pdf

# % <competition>/<volume>
output/naboj/%/languages/tearoffs.zip: \
$$(foreach dir,$$(subst source/,output/,$$(wildcard source/naboj/$$*/languages/*)),$$(dir)/tearoff.pdf)
$(foreach path,$^,ln -sf $(notdir $(path)) $(subst tearoff,$(word 6,$(subst /, ,$(path))),$(path));)
zip --junk-paths $@ $(foreach path,$^,$(subst tearoff,$(word 6,$(subst /, ,$(path))),$(path)))

output/naboj/%/html: \
$$(subst source/,output/,$$(subst .md,.html,$$(wildcard source/naboj/$$*/*/problem.md))) \
$$(subst source/,output/,$$(subst .md,.html,$$(wildcard source/naboj/$$*/*/solution.md))) \
Expand Down Expand Up @@ -296,14 +302,14 @@ output/naboj/%/booklets: \
# All targets for all languages
# <competition>/<volume>
output/naboj/%/languages: \
$$(foreach dir,$$(subst source/,output/,$$(wildcard source/naboj/$$*/languages/*)),$$(dir)) ;
$$(foreach dir,$$(subst source/,output/,$$(wildcard source/naboj/$$*/languages/*)),$$(dir)) \
$$@/tearoffs.zip ;

# Tearoffs, three problems per page, aligned for cutting
# <competition>/<volume>/<venues>/<venue>
output/naboj/%/tearoff.pdf: \
$$(subst source/,build/,$$(subst .md,.tex,$$(subst $$(cdir),,$$(abspath $$(wildcard source/naboj/$$*/../../problems/*/*/problem.md))))) \
$$(subst $$(cdir),,$$(abspath build/naboj/$$*/../../pdf-prerequisites)) \
build/naboj/%/barcodes.pdf \
build/naboj/%/tearoff.tex
$(call double_xelatex,naboj)

Expand Down Expand Up @@ -336,7 +342,6 @@ output/naboj/%/answers-modulo.pdf: \
# All targets for <venue>
# <competition>/<volume>/venues/<venue>
output/naboj/%: \
output/naboj/%/tearoff.pdf \
output/naboj/%/instructions.pdf \
output/naboj/%/answers-modulo.pdf \
output/naboj/%/envelopes.pdf ;
Expand Down
5 changes: 3 additions & 2 deletions modules/naboj/templates/tearoff.jtt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
(@ set target = 'tearoff' @)

(@ block content @)
\eject
\pdfpagewidth=210mm
\pdfpageheight=99mm
\newgeometry{
paperwidth = 210mm,
paperheight = 99mm,
left = 12mm,
right = 5mm,
bottom = 3mm,
Expand Down

0 comments on commit 6fab074

Please sign in to comment.