diff options
author | LarsVomMars | 2021-05-29 23:00:03 +0200 |
---|---|---|
committer | LarsVomMars | 2021-05-29 23:00:03 +0200 |
commit | 119a56067d9208025579234056154baef1e66c5d (patch) | |
tree | e04d3b3973ebbe093f376c8c869f0cc28cb571ef | |
parent | 4d7db5e5eae07baef8ea11dd33671bd66d0bd79a (diff) |
Teacherimages
-rwxr-xr-x | cli.js | 4 | ||||
-rw-r--r-- | zeitung/.gitignore | 1 | ||||
-rw-r--r-- | zeitung/parts/teacherprofiletemplate.tex | 7 |
3 files changed, 8 insertions, 4 deletions
@@ -282,15 +282,13 @@ if ((idx = params.indexOf("-r")) > -1) { textex = ""; const profs = (await fs.readFile(__dirname + "/stecks.csv", "utf8")).split("\n").slice(1, -1); let flip = 1; - let pageY = 0; for (const prof of profs) { const [t, a, p, s] = prof.split(";").map(sanitize); - textex += `\\def\\profname{${t}}\\def\\profabi{${a}}\\def\\profprof{${p}}\\def\\profsecret{${s}}\\def\\profnum{${flip}}\\def\\profx{${pageY}}\\def\\proflast{${+(flip % 3 === 0)}}\\teacherprofile\n`; + textex += `\\def\\profname{${t}}\\def\\profabi{${a}}\\def\\profprof{${p}}\\def\\profsecret{${s}}\\def\\profnum{${flip}}\\def\\proflast{${+(flip % 3 === 0)}}\\teacherprofile\n`; if (flip % 3 === 0) { textex += "\\clearpage\n"; } flip++; - pageY += 6; } await fs.writeFile(__dirname + "/zeitung/parts/generated/teacherprofiles.tex", textex, "utf8"); diff --git a/zeitung/.gitignore b/zeitung/.gitignore index 1340407..f28c256 100644 --- a/zeitung/.gitignore +++ b/zeitung/.gitignore @@ -4,5 +4,6 @@ build/ *.tmp svg-inkscape/ parts/generated/**/*.tex +parts/generated/teacherimages/ parts/generated/students/figures/ fonts/* diff --git a/zeitung/parts/teacherprofiletemplate.tex b/zeitung/parts/teacherprofiletemplate.tex index 13b3d4b..b2e848c 100644 --- a/zeitung/parts/teacherprofiletemplate.tex +++ b/zeitung/parts/teacherprofiletemplate.tex @@ -9,7 +9,12 @@ \end{minipage} \fi \begin{minipage}[c]{0.2\textwidth} - \includegraphics[keepaspectratio=true, width=4cm]{rahmen.png} + \def\imgpath{parts/generated/teacherimages/\profname.png} + \IfFileExists{\imgpath}{} + { + \def\imgpath{rahmen.png} + } + \includegraphics[keepaspectratio=true, width=4cm]{\imgpath} \end{minipage} \ifodd\profnum\else \hspace*{.5cm}% |