memoire-m2

My M2 Memoire on mapping class groups & their representations

Commit
2768d6182e6ee00439c582490f619a6ef70aa9d7
Parent
f87f15c570cf70f02a35641091e7fd7e2f1f78e3
Author
Pablo <pablo-pie@riseup.net>
Date

Redesigned the cover

Also moved the code for the cover to memoires.cls

Diffstat

3 files changed, 46 insertions, 63 deletions

Status File Name N° Changes Insertions Deletions
Deleted cover.tex 61 0 61
Modified memoir.tex 6 4 2
Modified memoires.cls 42 42 0
diff --git a/cover.tex b/cover.tex
@@ -1,61 +0,0 @@
-% Taken from https://latexdraw.com/tikz-cover-pages-gallery/
-
-% The cover itself
-\thispagestyle{empty}
-\begin{tikzpicture}[remember picture,overlay]
-  %%%%%%%%%%%%%%%%%%%% Background %%%%%%%%%%%%%%%%%%%%%%%%
-  \fill[highlight] (current page.south west) rectangle (current page.north east);
-
-
-  \foreach \i in {2.5,...,22}
-  {
-    \node[rounded corners,highlight!60,draw,regular polygon,regular polygon sides=6, minimum size=\i cm,ultra thick] at ($(current page.west)+(2.5,-5)$) {} ;
-  }
-
-  %%%%%%%%%%%%%%%%%%%% Background Polygon %%%%%%%%%%%%%%%%%%%%
-  \foreach \i in {0.5,...,22}
-  {
-    \node[rounded corners,highlight!60,draw,regular polygon,regular polygon sides=6, minimum size=\i cm,ultra thick] at ($(current page.north west)+(2.5,0)$) {} ;
-  }
-
-  \foreach \i in {0.5,...,22}
-  {
-    \node[rounded corners,highlight!90,draw,regular polygon,regular polygon sides=6, minimum size=\i cm,ultra thick] at ($(current page.north east)+(0,-9.5)$) {} ;
-  }
-
-
-  \foreach \i in {21,...,6}
-  {
-    \node[highlight!85,rounded corners,draw,regular polygon,regular polygon sides=6, minimum size=\i cm,ultra thick] at ($(current page.south east)+(-0.2,-0.45)$) {} ;
-  }
-
-
-  %%%%%%%%%%%%%%%%%%%% Title of the Report %%%%%%%%%%%%%%%%%%%%
-  \node[left,highlight!5,minimum width=0.625*\paperwidth,minimum height=3cm, rounded corners, text width=0.52*\paperwidth] at ($(current page.north east)+(-.6,-9.5)$)
-  {
-    \begin{minipage}{\textwidth}
-    \begin{center}
-    \baselineskip=30pt
-    \fontsize{22}{27} \selectfont \bfseries
-    \expandafter\MakeUppercase\expandafter{Memoire}
-    \par
-    \end{center}
-    \end{minipage}
-  };
-
-  %%%%%%%%%%%%%%%%%%%% Author Name %%%%%%%%%%%%%%%%%%%%
-  \node[left,highlight!5,minimum width=0.625*\paperwidth,minimum height=2cm, rounded corners] at ($(current page.north east)+(-.6,-11)$)
-  {
-    {\Large \textsc{Thiago Brevidelli Garcia}}
-  };
-
-  %%%%%%%%%%%%%%%%%%%% Year %%%%%%%%%%%%%%%%%%%%
-  \node[rounded corners,fill=highlight!70,text=highlight!5,regular polygon,regular polygon sides=6, minimum size=2.5 cm,inner sep=0,ultra thick]
-    at ($(current page.west)+(2.5,-5)$) {\LARGE \bfseries \number \year};
-\end{tikzpicture}
-
-% Back of the cover
-\clearpage
-\null
-\thispagestyle{empty}
-\clearpage
diff --git a/memoir.tex b/memoir.tex
@@ -8,8 +8,7 @@
 
 \begin{document}
 
-\input{cover}
-
+\makecover
 \maketitle
 
 \begin{about}
@@ -59,5 +58,8 @@
 \input{sections/representations}
 
 \printbibliography
+
+% Backcover
+\makecover[b]
 \end{document}
 
diff --git a/memoires.cls b/memoires.cls
@@ -772,6 +772,7 @@
   \global\let\and\relax
 }
 
+% Environment for the "About" section
 \newenvironment{about}
   {\chapter*{About}
    \thispagestyle{empty}
@@ -779,6 +780,47 @@
   {\cleardoublepage
    \setcounter{page}{1}}
 
+% Prints the book cover (front and back)
+\newcommand{\makecover}[1][]{%
+% Clear the bage if this is the back cover
+\unless\if\relax\detokenize\expandafter{#1}\relax
+  \cleardoublepage
+\fi
+\thispagestyle{empty}
+\begin{tikzpicture}[remember picture, overlay]
+  % Background
+  \fill[highlight]
+    (current page.south west) rectangle (current page.north east);
+  \draw[white, line width=1.5mm]
+    ($(current page.south west)+(3.5,4)$)
+    rectangle
+    ($(current page.north east)+(-3.5,-4)$);
+  \draw[white, line width=.9mm]
+    ($(current page.south west)+(3.5,4)+(2mm,2mm)$)
+    rectangle
+    ($(current page.north east)+(-3.5,-4)+(-2mm,-2mm)$);
+
+  % Title
+\if\relax\detokenize\expandafter{#1}\relax
+  \node[white] at ($(current page.center)+(0,4)$)
+    {\fontsize{32}{37}\selectfont\bfseries{Memoir}};
+  \node[white] at ($(current page.center)+(0,3)$)
+    {\Large\scshape\@author};
+  \node[white] at ($(current page.center)+(0,2)$) 
+    {\LARGE\bfseries\number\year};
+\fi
+\end{tikzpicture}
+\clearpage
+
+% Back of the cover
+\if\relax\detokenize\expandafter{#1}\relax
+  \null
+  \thispagestyle{empty}
+  \clearpage
+  \setcounter{page}{1}
+\fi
+}
+
 \endinput
 %%
 %% End of file `memoir.cls'.