Commits

Panagiotis Mavrogiorgos committed 2b400e1

Simplified parsing of arguments in ntua-thesis.sty

  • Participants
  • Parent commits 68b1ccf

Comments (0)

Files changed (3)

File greekmonths.sty

 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{greekmonths}[2011/6/18 v1.0 Package `mydate.sty']
+\ProvidesPackage{greekmonths}[2011/6/18 v1.0 Package `greekmonths.sty']
 \typeout{Package `greekmonths' version 1.0 by Panagiotis Mavrogiorgos}
 
 \RequirePackage{xspace}
         \or Οκτώβριος%
         \or Νοέμβριος%
         \or Δεκέμβριος%
-    \fi}
+    \fi
+}
 
 % \currentmonth return the name of the current Month in greek (e.g. Απρίλιος) with an xspace added.
 % \currentyear returns the current year with an xspace added

File ntua-example.tex

-\documentclass[]{report}
+\documentclass[draft,12pt]{report}
 
-\usepackage{xltxtra}
+\usepackage[a4paper,headheight=15pt,xetex]{geometry}
 \usepackage{xgreek}
-\usepackage{booktabs}
 
-\newfontfamily\greekfont{Minion Pro} 
-\setmainfont[Script=Greek,Language=Greek,Kerning=On,Mapping=tex-text]{Minion Pro} %{Linux Libertine O} % {Minion Pro}
+\usepackage{fontspec}
+\setmainfont[
+    Script=Greek,
+    Language=Greek,
+    Kerning=On,
+    Mapping=tex-text,
+]{Minion Pro}
 
-\usepackage[protrusion=true]{microtype}
-
-\greekfont
 \usepackage[
     mainauthor={Μαυρογιώργος Παναγιώτης},
     thesistitle={Αναλυτική προσομοίωση πειραμάτων εξόλκευσης σε ανακυκλιζόμενες φορτίσεις μετά τη διαρροή},
     thesissubtitle={Ενδεικτικός υπότιτλος},
-    department={Πολιτικών Μηχανικών},
+    faculty={Πολιτικών Μηχανικών},
     university={Εθνικό Μετσόβιο Πολυτεχνείο},
-    supervisorNameA={Τάσιος Π. Θεοδόσιος},
+    supervisorNameA={Τ\kern-1.2pt άσιος Π. Θεοδόσιος},
     supervisorTitleA={Ομ. Καθηγητής},
     supervisorNameB={Βιντζηλαίου Ελισάβετ},
     supervisorTitleB={Καθηγήτρια},
 
 
 \begin{document}
-\null\clearpage
 \halftitlepage
 
 \comiteepage
 
 \copyrightpage
 
-\end{document}
+
+\end{document}

File ntua-thesis.sty

 \RequirePackage{fancyhdr}
 \RequirePackage{greekmonths}
 \RequirePackage{ifthen}
+\RequirePackage{calc}
 
 % Key definition
-\pgfkeys{
-    /NTUA/.cd,
-    /NTUA/mainauthor/.code = {\newcommand{\mainauthor}{#1}},
-    /NTUA/thesistitle/.code = {\newcommand{\thesistitle}{#1}},
-    /NTUA/thesissubtitle/.code = {\newcommand{\thesissubtitle}{#1}},
-    /NTUA/faculty/.code = {\newcommand{\faculty}{#1}},
-    /NTUA/university/.code = {\newcommand{\university}{#1}},
-    /NTUA/supervisorNameA/.code = {\newcommand{\supervisorNameA}{#1}},
-    /NTUA/supervisorTitleA/.code = {\newcommand{\supervisorTitleA}{#1}},
-    /NTUA/supervisorNameB/.code = {\newcommand{\supervisorNameB}{#1}},
-    /NTUA/supervisorTitleB/.code = {\newcommand{\supervisorTitleB}{#1}},
-    /NTUA/supervisorNameC/.code = {\newcommand{\supervisorNameC}{#1}},
-    /NTUA/supervisorTitleC/.code = {\newcommand{\supervisorTitleC}{#1}},
+\pgfqkeys{NTUA}{%
+    /NTUA/mainauthor/.store in = \mainauthor,
+    /NTUA/thesistitle/.store in = \thesistitle,
+    /NTUA/thesissubtitle/.store in = \thesissubtitle,
+    /NTUA/faculty/.store in = \faculty,
+    /NTUA/university/.store in = \university,
+    /NTUA/supervisorNameA/.store in = \supervisorNameA,
+    /NTUA/supervisorTitleA/.store in = \supervisorTitleA,
+    /NTUA/supervisorNameB/.store in = \supervisorNameB,
+    /NTUA/supervisorTitleB/.store in = \supervisorTitleB,
+    /NTUA/supervisorNameC/.store in = \supervisorNameC,
+    /NTUA/supervisorTitleC/.store in = \supervisorTitleC,
 }
 
-% Key parsing
-\pgfkeysgetvalue{/NTUA/mainauthor}{\mainauthor}
-\pgfkeysgetvalue{/NTUA/thesistitle}{\thesistitle}
-\pgfkeysgetvalue{/NTUA/thesissubtitle}{\thesissubtitle}
-\pgfkeysgetvalue{/NTUA/university}{\university}
-\pgfkeysgetvalue{/NTUA/faculty}{\faculty}
-\pgfkeysgetvalue{/NTUA/supervisorNameA}{\supervisorNameA}
-\pgfkeysgetvalue{/NTUA/supervisorTitleA}{\supervisorTitleA}
-\pgfkeysgetvalue{/NTUA/supervisorNameB}{\supervisorNameB}
-\pgfkeysgetvalue{/NTUA/supervisorTitleB}{\supervisorTitleB}
-\pgfkeysgetvalue{/NTUA/supervisorNameC}{\supervisorNameC}
-\pgfkeysgetvalue{/NTUA/supervisorTitleC}{\supervisorTitleC}
-
 \ProcessPgfOptions{/NTUA}
 
 % Calculate lengths
 \newlength{\widthuniversity}
 \newlength{\widthfaculty}
 \newlength{\widthmax}
+\newlength{\mikosgrammis}
+\setlength{\mikosgrammis}{\textwidth}
 
-\setlength{\widthuniversity}{\widthof{\university}}
-\setlength{\widthfaculty}{\widthof{Τμήμα \faculty}}
+\setlength{\widthuniversity}{\widthof{\Large \university}}
+\setlength{\widthfaculty}{\widthof{\Large Τμήμα \faculty}}
 \ifthenelse{\widthuniversity > \widthfaculty}
     {\setlength{\widthmax}{\widthuniversity}}
     {\setlength{\widthmax}{\widthfaculty}}
     \clearpage
     \thispagestyle{empty}
     %
-    \begin{minipage}[c][40pt][c]{0.2\linewidth}
-        \centering
-        \includegraphics[height=20mm]{photos/uni_logo.pdf}
-    \end{minipage}\hfill
-    \begin{minipage}[c][40pt][c]{0.7\linewidth}
-        \raggedright
-        \Large
-        \textsc{\university}\par
-        τμήμα \textsc{\faculty}\par
-        \vfill\null
-    \end{minipage}
+%   % Print the logo
+%     \begin{minipage}[c][0.2\textwidth][c]{\textwidth}
+%         \centering
+%         \includegraphics[width = 0.2\textwidth]{photos/uni_logo.pdf}
+%     \end{minipage}
+%     \vspace{3cm}
     %
     \begin{center}
-        \vspace*{2cm}
+        \begin{Large}
+            \university\par
+            τμήμα \faculty\par
+        \end{Large}
+        \vspace*{1cm}
+        %
         \emph{Διπλωματική Εργασία}\par
         \vspace*{1cm}
         \begin{Large}
         \vspace*{1cm}
         \emph{\thesissubtitle}\par
         \vspace*{3cm}
-        \mainauthor\par
+        Φοιτητής :\par
+        {\large \mainauthor \par}
         \vspace{2cm}
         Επιβλέπων :\par
-        \supervisorTitleA\ \supervisorNameA\par
+        { \supervisorTitleA\ \supervisorNameA\par}
         \vfill
         \currentmonth \currentyear \par
     \end{center}
     \clearpage
     \thispagestyle{empty}
     %
-    \begin{minipage}[b]{0.2\linewidth}
-        \centering
-        \includegraphics[height=20mm]{photos/uni_logo.pdf}
-    \end{minipage}
-    \begin{minipage}[b]{0.8\linewidth}
-        \raggedright
-        \Large
-        \textsc{\university}\par
-        Τμήμα \textsc{\faculty}\par
-        \vfill\null
-    \end{minipage}
-    %
     \begin{center}
-        \vspace*{2cm}
+        \begin{Large}
+            \university\par
+            τμήμα \faculty\par
+        \end{Large}
+        \vspace*{1cm}
+        %
         \emph{Διπλωματική Εργασία}\par
         \vspace*{1cm}
         \begin{Large}
         \vspace*{1cm}
         \emph{\thesissubtitle}\par
         \vspace*{3cm}
-        \mainauthor\par
+        Φοιτητής :\par
+        {\large \mainauthor \par}
         \vspace{2cm}
         \begin{minipage}[b]{0.33\linewidth}
             \centering
             \supervisorTitleA\par
+            {
             \supervisorNameA\par
             \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
             \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
-            \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
+            \dots\dots\dots\dots\dots\dots\dots\dots\dots\par}
         \end{minipage}\hfill
         \begin{minipage}[b]{0.33\linewidth}
             \centering
             \supervisorTitleB\par
+            {
             \supervisorNameB\par
             \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
             \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
-            \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
+            \dots\dots\dots\dots\dots\dots\dots\dots\dots\par}
         \end{minipage}\hfill
         \begin{minipage}[b]{0.33\linewidth}
             \centering
             \supervisorTitleC\par
+            {
             \supervisorNameC\par
             \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
             \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
-            \dots\dots\dots\dots\dots\dots\dots\dots\dots\par
+            \dots\dots\dots\dots\dots\dots\dots\dots\dots\par}
         \end{minipage}\par
         \vfill
         \currentmonth \currentyear \par