From 1667e98a498726092f823290103121708181440e Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Wed, 27 Jan 2021 22:28:51 +0100
Subject: Switched image positioning to eso-pic

---
 zeitung/parts/studenttemplate.tex | 45 ++++++++++++++-------------------------
 1 file changed, 16 insertions(+), 29 deletions(-)

(limited to 'zeitung/parts/studenttemplate.tex')

diff --git a/zeitung/parts/studenttemplate.tex b/zeitung/parts/studenttemplate.tex
index 0bb97e6..d5c1586 100644
--- a/zeitung/parts/studenttemplate.tex
+++ b/zeitung/parts/studenttemplate.tex
@@ -2,34 +2,21 @@
 
 \clearpage
 
+% TODO: Add offset calculation variables (pretty easy)
 \providecommand\studentimages[1]{%
-	% Bild in Ring
-	\begin{tikzpicture}[remember picture, overlay]
-		\node[inner sep=0pt] at (2, -4) {
-			\includegraphics[keepaspectratio=true, width=200pt]{parts/students/figures/#1.jpg}
-		};
-	\end{tikzpicture}
-
-	% Ring
-	\begin{tikzpicture}[remember picture, overlay]
-		\node[inner sep=0pt] at (2, -4) {
-			\includegraphics[keepaspectratio=true, width=250pt]{ring.png}
-		};
-	\end{tikzpicture}
-
-	% Bild in Rahmen
-	\begin{tikzpicture}[remember picture, overlay]
-		\node[inner sep=0pt] at (14, -18.5) {
-			\includegraphics[keepaspectratio=true, width=160pt]{parts/students/figures/#1_child.jpg}
-		};
-	\end{tikzpicture}
-
-	% Rahmen
-	\begin{tikzpicture}[remember picture, overlay]
-		\node[inner sep=0pt] at (14, -18) {
-			\includegraphics[keepaspectratio=true, width=180pt]{rahmen.png}
-		};
-	\end{tikzpicture}
+	\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}}
+		}
+	}
+
+	\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}}
+		}
+	}
 }
 
 \providecommand\studentprofile[8]{%
@@ -37,7 +24,7 @@
 
 	% Steckbrief Tabelle
 	\begin{tikzpicture}[overlay]
-		\node[text width=250pt, align=left] at (12, -4) {
+		\node[text width=250pt, align=left] at (12, -5) {
 			\Large{\begin{tabular}{@{}ll@{}}
 				\textbf{Name:} & #1 \\
 				\textbf{Geburtstag:} & #2 \\
@@ -53,7 +40,7 @@
 }
 
 \providecommand\studenttable[2]{%
-	\vskip 9cm
+	\vskip 10cm
 	\hspace*{-1.2cm}
 	\Large{\begin{tabular}{@{}ll@{}}
 		\textbf{Erkennungsmerkmale:} & #1 \\
-- 
cgit v1.2.3


From a032120bf8fe1e905082ade0dd14fd2198a4574b Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Wed, 27 Jan 2021 22:40:15 +0100
Subject: Added offset calculation variables

---
 zeitung/parts/studenttemplate.tex | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

(limited to 'zeitung/parts/studenttemplate.tex')

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}
+			}
 		}
 	}
 }
-- 
cgit v1.2.3


From 3045ccac64a1595a7ed89415cd0521e387bfa2c7 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Wed, 27 Jan 2021 23:28:55 +0100
Subject: That's dump (pun intended)

---
 CLI.md                                   | 13 ++++++++++---
 cli.js                                   | 20 ++++++++++++++++++++
 db.js                                    | 12 +++++++++++-
 profile/public/user.js                   |  4 ++--
 tables.sql                               |  2 +-
 zeitung/.gitignore                       |  3 ++-
 zeitung/parts/studentprofiles.tex        |  6 +++++-
 zeitung/parts/students/.gitkeep          |  0
 zeitung/parts/students/TGI13.1/.gitkeep  |  0
 zeitung/parts/students/TGI13.2/.gitkeep  |  0
 zeitung/parts/students/TGM13.1/.gitkeep  |  0
 zeitung/parts/students/TGM13.2/.gitkeep  |  0
 zeitung/parts/students/TGTM13.1/.gitkeep |  0
 zeitung/parts/studenttemplate.tex        | 15 +++++++++++++--
 14 files changed, 64 insertions(+), 11 deletions(-)
 delete mode 100644 zeitung/parts/students/.gitkeep
 create mode 100644 zeitung/parts/students/TGI13.1/.gitkeep
 create mode 100644 zeitung/parts/students/TGI13.2/.gitkeep
 create mode 100644 zeitung/parts/students/TGM13.1/.gitkeep
 create mode 100644 zeitung/parts/students/TGM13.2/.gitkeep
 create mode 100644 zeitung/parts/students/TGTM13.1/.gitkeep

(limited to 'zeitung/parts/studenttemplate.tex')

diff --git a/CLI.md b/CLI.md
index 9fa8d44..0e49905 100644
--- a/CLI.md
+++ b/CLI.md
@@ -3,10 +3,17 @@
 `node cli.js [option] [param]`
 
 ## -r
-Recreates and reinitializes database tables: `node -r [all|motto|poll|profile|quote]`
+
+Recreates and reinitializes database tables: `node cli -r [all|motto|poll|profile|quote]`
+
+## -d
+
+Dump the database into a LaTeX-compatible format `node cli -d` (in the appropriate `zeitung` subdir)
 
 ## -U
-Updates database values: `node -U [all|motto|poll|profile]`
+
+Updates database values: `node cli -U [all|motto|poll|profile]`
 
 ## --user
-Regenerates user password: `node --user [user_id]`
\ No newline at end of file
+
+Regenerates user password: `node cli --user [user_id]`
diff --git a/cli.js b/cli.js
index 2a7e5d3..c833176 100755
--- a/cli.js
+++ b/cli.js
@@ -1,6 +1,7 @@
 #!/usr/bin/env node
 require("dotenv").config();
 const db = require("./db");
+const fs = require("fs");
 
 const params = process.argv.slice(2);
 
@@ -56,6 +57,25 @@ if ((idx = params.indexOf("-r")) > -1) {
             process.exit(0);
             break;
     }
+} else if ((idx = params.indexOf("-d")) > -1) {
+    // TODO: More dumping
+    db.dump().then((data) => {
+        data.users.forEach((user) => {
+            const textex = `\\student\n\\studentimages{${user.username}}\n\\studentprofile{${user.name} ${
+                user.middlename || ""
+            } ${
+                user.surname
+            }}{18.12.2002}{Mathematik}{Schlafen}{Canadian Pop}{Herr Schwarz}{Gehirn}{Cogito ergo sum}\n\\studenttable{Meistens wunderhübsch}{Essen}`;
+            fs.writeFile(
+                __dirname + "/zeitung/parts/students/" + user.class + "/" + user.username + ".tex",
+                textex,
+                (err) => {
+                    if (err) console.error(err);
+                },
+            );
+        });
+    });
+    console.log("Probably finished.. Async?");
 } else if ((idx = params.indexOf("-U")) > -1) {
     // Update management (e.g.: add new poll options)
     const param = params[idx + 1];
diff --git a/db.js b/db.js
index 2735257..af18a47 100644
--- a/db.js
+++ b/db.js
@@ -185,7 +185,10 @@ class DB {
                 const [q, a] = question.split(" - ");
                 const { insertId } = await this.query("INSERT INTO question_questions (question) VALUE (?)", [q]);
                 for (const answer of a.split(",")) {
-                    await this.query("INSERT INTO question_options (answer_option, question_id) VALUE (?,?)", [answer, insertId]);
+                    await this.query("INSERT INTO question_options (answer_option, question_id) VALUE (?,?)", [
+                        answer,
+                        insertId,
+                    ]);
                 }
             } catch (e) {
                 console.error(e);
@@ -218,6 +221,13 @@ class DB {
         console.log(`New password for ${uid}: ${pwd}`);
     }
 
+    async dump() {
+        const users = await this.query(
+            "SELECT u.id, u.username, u.name, u.middlename, u.surname, c.name class, t.name type FROM users u INNER JOIN class c ON u.class_id = c.id INNER JOIN types t ON u.type_id = t.id WHERE t.name = 'pupil'",
+        );
+        return { users };
+    }
+
     async query(query, params) {
         const conn = await this.connect();
         try {
diff --git a/profile/public/user.js b/profile/public/user.js
index b0eb768..39d6713 100644
--- a/profile/public/user.js
+++ b/profile/public/user.js
@@ -171,7 +171,7 @@ function addChar(char) {
 
     inp.maxLength = 255;
 
-    btn.addEventListener("click", async e => {
+    btn.addEventListener("click", async (e) => {
         const char = inp.value;
         const body = JSON.stringify({ char });
         await fetch(`api/char/${uid}`, {
@@ -196,4 +196,4 @@ fetch(`api/comments/${uid}`)
 
 fetch(`api/char/${uid}`)
     .then((response) => response.json())
-    .then(addChar);
\ No newline at end of file
+    .then(addChar);
diff --git a/tables.sql b/tables.sql
index 9f98c45..99dcf20 100644
--- a/tables.sql
+++ b/tables.sql
@@ -175,4 +175,4 @@ CREATE TABLE IF NOT EXISTS profile_char
     CONSTRAINT `fk_char_user` FOREIGN KEY (profile_id) REFERENCES users (id),
     CONSTRAINT `fk_char_user2` FOREIGN KEY (user_id) REFERENCES users (id)
 ) ENGINE = InnoDB
-  DEFAULT CHARSET = utf8;
\ No newline at end of file
+  DEFAULT CHARSET = utf8;
diff --git a/zeitung/.gitignore b/zeitung/.gitignore
index 7f25e83..de1a9bd 100644
--- a/zeitung/.gitignore
+++ b/zeitung/.gitignore
@@ -1,5 +1,6 @@
 build/
 *.log
 svg-inkscape/
-parts/students/*.tex
+parts/students/*/*.tex
 parts/students/figures/
+parts/test/
diff --git a/zeitung/parts/studentprofiles.tex b/zeitung/parts/studentprofiles.tex
index dcb3cb6..67d69d0 100644
--- a/zeitung/parts/studentprofiles.tex
+++ b/zeitung/parts/studentprofiles.tex
@@ -2,4 +2,8 @@
 \kant[1-3]
 \newpage
 
-\inputall{parts/students/}
+\inputall{parts/students/TGI13.1}
+\inputall{parts/students/TGI13.2}
+\inputall{parts/students/TGM13.1}
+\inputall{parts/students/TGM13.2}
+\inputall{parts/students/TGTM13.1}
diff --git a/zeitung/parts/students/.gitkeep b/zeitung/parts/students/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/zeitung/parts/students/TGI13.1/.gitkeep b/zeitung/parts/students/TGI13.1/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/zeitung/parts/students/TGI13.2/.gitkeep b/zeitung/parts/students/TGI13.2/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/zeitung/parts/students/TGM13.1/.gitkeep b/zeitung/parts/students/TGM13.1/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/zeitung/parts/students/TGM13.2/.gitkeep b/zeitung/parts/students/TGM13.2/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/zeitung/parts/students/TGTM13.1/.gitkeep b/zeitung/parts/students/TGTM13.1/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/zeitung/parts/studenttemplate.tex b/zeitung/parts/studenttemplate.tex
index 72e7763..2f3e3b0 100644
--- a/zeitung/parts/studenttemplate.tex
+++ b/zeitung/parts/studenttemplate.tex
@@ -2,6 +2,17 @@
 
 \clearpage
 
+% Returns a default file if not found
+\providecommand\dfincludegraphics[2][]{
+    \IfFileExists{#2}
+    {
+        \includegraphics[#1]{#2}
+    }
+    {
+        %\fbox{File not found}
+    }
+}
+
 \providecommand\studentimages[1]{%
 	% Ring
 	\def\ringx{50pt}
@@ -12,7 +23,7 @@
 	\AddToShipoutPictureBG*{
 		\AtTextUpperLeft{
 			\put(-\ringx + \ringoffset, -\ringy + \ringoffset){
-				\includegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/students/figures/#1.jpg}
+				\dfincludegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/students/figures/#1.jpg}
 			}
 			\put(-\ringx, -\ringy){
 				\includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png}
@@ -29,7 +40,7 @@
 	\AddToShipoutPictureBG*{
 		\AtTextLowerLeft{
 			\put(\textwidth - \framex + \frameoffset, \framey + \frameoffset){
-				\includegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/students/figures/#1_child.jpg}
+				\dfincludegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/students/figures/#1_child.jpg}
 			}
 			\put(\textwidth - \framex, \framey){
 				\includegraphics[keepaspectratio=true, width=\framewidth]{rahmen.png}
-- 
cgit v1.2.3


From 19c5c47cc3a5f03a3acfdda926593c6d30374a5a Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Thu, 28 Jan 2021 00:18:33 +0100
Subject: Started odd mirroring

---
 cli.js                            |  2 +-
 zeitung/main.tex                  | 21 +++++++++++++++------
 zeitung/parts/studenttemplate.tex | 39 +++++++++++++++++++++++----------------
 3 files changed, 39 insertions(+), 23 deletions(-)

(limited to 'zeitung/parts/studenttemplate.tex')

diff --git a/cli.js b/cli.js
index c833176..c8220f5 100755
--- a/cli.js
+++ b/cli.js
@@ -65,7 +65,7 @@ if ((idx = params.indexOf("-r")) > -1) {
                 user.middlename || ""
             } ${
                 user.surname
-            }}{18.12.2002}{Mathematik}{Schlafen}{Canadian Pop}{Herr Schwarz}{Gehirn}{Cogito ergo sum}\n\\studenttable{Meistens wunderhübsch}{Essen}`;
+            }}{18.12.2002}{Mathematik}{Schlafen}{Canadian Pop}{Herr Schwarz}{Gehirn}{Cogito ergo sum}\n\\studenttable{Meistens wunderhübsch}{Essen}\n\\studentcomments{}`;
             fs.writeFile(
                 __dirname + "/zeitung/parts/students/" + user.class + "/" + user.username + ".tex",
                 textex,
diff --git a/zeitung/main.tex b/zeitung/main.tex
index 2f1d2c1..6f6cc74 100644
--- a/zeitung/main.tex
+++ b/zeitung/main.tex
@@ -13,6 +13,7 @@
 \usepackage{eso-pic}
 \usepackage{fancyhdr}
 \usepackage{background}
+\usepackage{changepage}
 
 % Font
 \setmainfont{"[tierra-nueva.otf]"}[BoldFont="[tierra-nueva-bold.otf]"]
@@ -25,6 +26,14 @@
 % Figures
 \graphicspath{{figures/}}
 
+% Flip image if odd
+\newcommand\oddflip[2][]{
+	\checkoddpage
+	\ifoddpage\includegraphics[#1]{#2}
+	\else\scalebox{-1}[1]{\includegraphics[#1]{#2}}
+	\fi
+}
+
 % Header & footer
 \renewcommand{\headrulewidth}{0pt}
 \renewcommand{\footrulewidth}{0pt}
@@ -35,8 +44,8 @@
 \fancyfootoffset{2.5cm}
 \fancyhf{}
 \fancyhead[L]{\hspace*{1cm}\vspace*{0.3cm}\Huge{\rightmark}}
-\fancyfoot[R]{\vspace*{-50pt}\includegraphics[keepaspectratio=true, width=\paperwidth]{welle.png}}
-\fancyfoot[L]{\vspace*{-1.3cm}\hspace*{3cm}\Huge{\thepage}}
+\fancyfoot[R]{\vspace*{-50pt}\oddflip[keepaspectratio=true, width=\paperwidth]{welle.png}}
+\fancyfoot[L]{\checkoddpage\vspace*{-1.3cm}\hspace*{\ifoddpage 3cm \else 17.5cm \fi}\Huge{\thepage}}
 
 % Custom title command for header
 \renewcommand{\sectionmark}[1]{\markright{#1}}
@@ -55,9 +64,9 @@
 % Import all tex files from a directory
 \def\app@exe{\immediate\write18}
 \def\inputall#1{
-    \app@exe{cat #1/*.tex > #1/files.tmp}
-    \InputIfFileExists{#1/files.tmp}{}{}
-    \AtEndDocument{\app@exe{rm -f #1/files.tmp}}}
+	\app@exe{cat #1/*.tex > #1/files.tmp}
+	\InputIfFileExists{#1/files.tmp}{}{}
+	\AtEndDocument{\app@exe{rm -f #1/files.tmp}}}
 
 \def\part#1{\input{parts/#1.tex}\newpage}
 \def\student{\input{parts/studenttemplate.tex}}
@@ -66,7 +75,7 @@
 
 \backgroundsetup{contents={}}
 \part{titlepage}
-\backgroundsetup{contents={\includegraphics[keepaspectratio=true, width=\paperwidth]{kordel.png}},scale=1,placement=top,opacity=1,position=current page.north}
+\backgroundsetup{contents={\oddflip[keepaspectratio=true, width=\paperwidth]{kordel.png}},scale=1.1,placement=top,opacity=1,position=current page.north}
 \part{tableofcontents}
 \part{introduction}
 \part{classphoto}
diff --git a/zeitung/parts/studenttemplate.tex b/zeitung/parts/studenttemplate.tex
index 2f3e3b0..0acfb0d 100644
--- a/zeitung/parts/studenttemplate.tex
+++ b/zeitung/parts/studenttemplate.tex
@@ -4,17 +4,24 @@
 
 % Returns a default file if not found
 \providecommand\dfincludegraphics[2][]{
-    \IfFileExists{#2}
-    {
-        \includegraphics[#1]{#2}
-    }
-    {
-        %\fbox{File not found}
-    }
+	\IfFileExists{#2}
+	{
+		\includegraphics[#1]{#2}
+	}
+	{
+		%\fbox{File not found}
+	}
 }
 
 \providecommand\studentimages[1]{%
+	\checkoddpage
+
 	% Ring
+	% \ifoddpage
+	% 	\def\ringx{50pt}
+	% \else
+	% 	\def\ringx{\pagewdith - 50pt}
+	% \fi
 	\def\ringx{50pt}
 	\def\ringy{250pt}
 	\def\ringwidth{250pt}
@@ -56,12 +63,12 @@
 	\begin{tikzpicture}[overlay]
 		\node[text width=250pt, align=left] at (12, -5) {
 			\Large{\begin{tabular}{@{}ll@{}}
-				\textbf{Name:} & #1 \\
-				\textbf{Geburtstag:} & #2 \\
-				\textbf{Lieblingsfach:} & #3 \\
-				\textbf{Hobbies:} & #4 \\
-				\textbf{Lieblingsgenre:} & #5 \\
-			\end{tabular}}\\~\\
+					\textbf{Name:}           & #1 \\
+					\textbf{Geburtstag:}     & #2 \\
+					\textbf{Lieblingsfach:}  & #3 \\
+					\textbf{Hobbies:}        & #4 \\
+					\textbf{Lieblingsgenre:} & #5 \\
+				\end{tabular}}\\~\\
 			\textbf{Das werde ich am meisten vermissen:}\\#6\\~\\
 			\textbf{Ohne das hätte ich die Oberstufe nicht geschafft:}\\#7\\~\\
 			\textbf{Lebensmotto:}\\#8\\~\\
@@ -73,9 +80,9 @@
 	\vskip 10cm
 	\hspace*{-1.2cm}
 	\Large{\begin{tabular}{@{}ll@{}}
-		\textbf{Erkennungsmerkmale:} & #1 \\
-		\textbf{Zukunftspläne:} & #2 \\
-	\end{tabular}}
+			\textbf{Erkennungsmerkmale:} & #1 \\
+			\textbf{Zukunftspläne:}      & #2 \\
+		\end{tabular}}
 }
 
 \providecommand\studentcomments[1]{%
-- 
cgit v1.2.3


From 5feb9b1af9f6ff5b2e08bf9c7cc85ffc0f313945 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Thu, 28 Jan 2021 12:22:51 +0100
Subject: Aah oddflip

---
 zeitung/parts/studenttemplate.tex | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)

(limited to 'zeitung/parts/studenttemplate.tex')

diff --git a/zeitung/parts/studenttemplate.tex b/zeitung/parts/studenttemplate.tex
index 0acfb0d..eed97ac 100644
--- a/zeitung/parts/studenttemplate.tex
+++ b/zeitung/parts/studenttemplate.tex
@@ -17,23 +17,21 @@
 	\checkoddpage
 
 	% Ring
-	% \ifoddpage
-	% 	\def\ringx{50pt}
-	% \else
-	% 	\def\ringx{\pagewdith - 50pt}
-	% \fi
 	\def\ringx{50pt}
 	\def\ringy{250pt}
 	\def\ringwidth{250pt}
 	\def\ringimgwidth{180pt}
 	\def\ringoffset{(\ringwidth - \ringimgwidth) / 2}
+	\ifoddpage\else
+		\def\ringx{-\paperwidth - 350pt} % ringwidth + 2 * ringx
+	\fi
 	\AddToShipoutPictureBG*{
 		\AtTextUpperLeft{
 			\put(-\ringx + \ringoffset, -\ringy + \ringoffset){
-				\dfincludegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/students/figures/#1.jpg}
+				\dfincludegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/students/figures/bornerma.jpg}
 			}
 			\put(-\ringx, -\ringy){
-				\includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png}
+				\oddflip[keepaspectratio=true, width=\ringwidth]{ring.png}
 			}
 		}
 	}
@@ -44,13 +42,16 @@
 	\def\framewidth{180pt}
 	\def\frameimgwidth{160pt}
 	\def\frameoffset{(\framewidth - \frameimgwidth) / 2}
+	\ifoddpage\else
+		\def\framex{518pt} % paperwidth - framewidth / 2
+	\fi
 	\AddToShipoutPictureBG*{
 		\AtTextLowerLeft{
 			\put(\textwidth - \framex + \frameoffset, \framey + \frameoffset){
-				\dfincludegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/students/figures/#1_child.jpg}
+				\dfincludegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/students/figures/bornerma_child.jpg}
 			}
 			\put(\textwidth - \framex, \framey){
-				\includegraphics[keepaspectratio=true, width=\framewidth]{rahmen.png}
+				\oddflip[keepaspectratio=true, width=\framewidth]{rahmen.png}
 			}
 		}
 	}
@@ -58,10 +59,17 @@
 
 \providecommand\studentprofile[8]{%
 	\sectionmark{Steckbrief - #1}
+	\checkoddpage
 
 	% Steckbrief Tabelle
+	\ifoddpage
+		\def\tablex{12}
+	\else
+		\def\tablex{3}
+	\fi
+	\def\tabley{-5}
 	\begin{tikzpicture}[overlay]
-		\node[text width=250pt, align=left] at (12, -5) {
+		\node[text width=250pt, align=left] at (\tablex, \tabley) {
 			\Large{\begin{tabular}{@{}ll@{}}
 					\textbf{Name:}           & #1 \\
 					\textbf{Geburtstag:}     & #2 \\
@@ -77,8 +85,16 @@
 }
 
 \providecommand\studenttable[2]{%
+	\checkoddpage
+
+	\ifoddpage
+		\def\tablex{-1.25cm}
+	\else
+		\def\tablex{5cm}
+	\fi
+
 	\vskip 10cm
-	\hspace*{-1.2cm}
+	\hspace*{\tablex}
 	\Large{\begin{tabular}{@{}ll@{}}
 			\textbf{Erkennungsmerkmale:} & #1 \\
 			\textbf{Zukunftspläne:}      & #2 \\
-- 
cgit v1.2.3

