Skip to content

Commit 000ea3e

Browse files
committed
Fix preamble title to be document-specific
The preamble was applying the same hardcoded title to both rules.pdf and superteam_rules.pdf. Now the title is extracted from each .adoc file's first line, so each document gets its correct title.
1 parent 1297b65 commit 000ea3e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.ci/tex-to-pdf.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ dblatex -T db2latex $OUTPUT_PREFIX.xml -t tex --texstyle=./manual.sty -p custom.
1010
# Go through the generated .tex output, find the place where the preamble ends
1111
# (marked by the \mainmatter command) and create a file without it.
1212
cat $OUTPUT_PREFIX.tex | awk 'f;/\\mainmatter/{f=1}' > $OUTPUT_PREFIX"_without_preamble.tex"
13-
# Concat the standardized preamble with the "without_preamble" version of the file
14-
cat preamble.tex $OUTPUT_PREFIX"_without_preamble.tex" > $OUTPUT_PREFIX.tex
13+
14+
# Extract the document title from the .adoc file (first line, removing the "= " prefix)
15+
DOCUMENT_TITLE=$(head -n 1 "$OUTPUT_FILE.adoc" | sed 's/^= //')
16+
17+
# Create a preamble with the correct title substituted
18+
sed "s/@@DOCUMENT_TITLE@@/$DOCUMENT_TITLE/" preamble.tex > $OUTPUT_PREFIX"_preamble.tex"
19+
20+
# Concat the customized preamble with the "without_preamble" version of the file
21+
cat $OUTPUT_PREFIX"_preamble.tex" $OUTPUT_PREFIX"_without_preamble.tex" > $OUTPUT_PREFIX.tex
1522
texliveonfly $OUTPUT_PREFIX.tex
1623
pdflatex $OUTPUT_PREFIX.tex
1724
pdflatex $OUTPUT_PREFIX.tex

preamble.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
\fancyhead[R]{\includegraphics[width=8cm]{media/image15.png}}
9090
}
9191

92-
\title{\vspace{-5ex}RoboCupJunior Soccer Draft Rules 2026\vspace{-5ex}}
92+
\title{\vspace{-5ex}@@DOCUMENT_TITLE@@\vspace{-5ex}}
9393
\date{\vspace{-2ex}}
9494

9595
\definecolor{color-1}{rgb}{1,1,1}

0 commit comments

Comments
 (0)