aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2021-01-27 22:40:15 +0100
committerMarvin Borner2021-01-27 22:40:15 +0100
commita032120bf8fe1e905082ade0dd14fd2198a4574b (patch)
treeb2e30c2991ea5ec760ee9994e5de74be709ef564
parent1667e98a498726092f823290103121708181440e (diff)
Added offset calculation variables
-rw-r--r--zeitung/parts/studenttemplate.tex29
1 files changed, 24 insertions, 5 deletions
diff --git a/zeitung/parts/studenttemplate.tex b/zeitung/parts/studenttemplate.tex
index d5c1586..72e7763 100644
--- a/zeitung/parts/studenttemplate.tex
+++ b/zeitung/parts/studenttemplate.tex
@@ -2,19 +2,38 @@
\clearpage
-% TODO: Add offset calculation variables (pretty easy)
\providecommand\studentimages[1]{%
+ % Ring
+ \def\ringx{50pt}
+ \def\ringy{250pt}
+ \def\ringwidth{250pt}
+ \def\ringimgwidth{180pt}
+ \def\ringoffset{(\ringwidth - \ringimgwidth) / 2}
\AddToShipoutPictureBG*{
\AtTextUpperLeft{
- \put(-15, -215){\includegraphics[keepaspectratio=true, width=180pt]{parts/students/figures/#1.jpg}}
- \put(-50, -250){\includegraphics[keepaspectratio=true, width=250pt]{ring.png}}
+ \put(-\ringx + \ringoffset, -\ringy + \ringoffset){
+ \includegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/students/figures/#1.jpg}
+ }
+ \put(-\ringx, -\ringy){
+ \includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png}
+ }
}
}
+ % Frame
+ \def\framex{130pt}
+ \def\framey{40pt}
+ \def\framewidth{180pt}
+ \def\frameimgwidth{160pt}
+ \def\frameoffset{(\framewidth - \frameimgwidth) / 2}
\AddToShipoutPictureBG*{
\AtTextLowerLeft{
- \put(\textwidth - 120, 50){\includegraphics[keepaspectratio=true, width=160pt]{parts/students/figures/#1_child.jpg}}
- \put(\textwidth - 130, 40){\includegraphics[keepaspectratio=true, width=180pt]{rahmen.png}}
+ \put(\textwidth - \framex + \frameoffset, \framey + \frameoffset){
+ \includegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/students/figures/#1_child.jpg}
+ }
+ \put(\textwidth - \framex, \framey){
+ \includegraphics[keepaspectratio=true, width=\framewidth]{rahmen.png}
+ }
}
}
}