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/main.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'zeitung/main.tex')

diff --git a/zeitung/main.tex b/zeitung/main.tex
index 510a29f..2f1d2c1 100644
--- a/zeitung/main.tex
+++ b/zeitung/main.tex
@@ -9,7 +9,7 @@
 \usepackage{afterpage}
 \usepackage{sectsty}
 \usepackage{tikz,float}
-\usepackage{svg,kantlipsum,lipsum}
+\usepackage{kantlipsum,lipsum}
 \usepackage{eso-pic}
 \usepackage{fancyhdr}
 \usepackage{background}
-- 
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/main.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

