|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- %
- % AUTH report class
- %
- % note: Requires compilation with XeLaTeX or LuaTeX
- %
- % author: Christos Choutouridis <cchoutou@ece.auth.gr>
- %
- \NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{AUTHReport}[2024-11-03 AUTH Report document class]
-
-
- % Options
- % ===============================================
-
- % Declare option for short report version
- \DeclareOption{short}{\def\auth@short{yes}}
-
- % Declare option for CoAuthor
- %\DeclareOption{coauthor}{\def\auth@coauthor{yes}}
-
-
- % Default option values
- \def\auth@short{no}
- %\def\auth@coauthor{no}
-
- % Pass all other options to article
- \DeclareOption*{%
- \PassOptionsToClass{\CurrentOption}{article}
- }
- \ProcessOptions\relax
-
- \LoadClass{article}
-
-
- % Requirements
- % ===============================================
- \RequirePackage{iftex}
- \ifPDFTeX
- \RequirePackage[utf8]{inputenc}
- \RequirePackage[T1]{fontenc}
- \else
- \RequirePackage{fontspec}
- \fi
-
- \RequirePackage{xargs} % Commands
-
- \RequirePackage{geometry} % Layout
- \RequirePackage{fancyhdr}
-
- \RequirePackage{graphicx} % Figures
-
- % Format packages
- \RequirePackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures
- \RequirePackage[nobottomtitles]{titlesec}
- \RequirePackage{titling}
- \RequirePackage[bottom]{footmisc} % Place footnotes always as much to the bottom as possible.
-
- \RequirePackage{hyperref} % Various
- \RequirePackage[ddmmyyyy]{datetime}
- \RequirePackage{enumitem}
-
-
- % Local Tools
- % ===============================================
-
- % Tool to check equality
- \newcommand{\isequal}[2]{ \pdf@strcmp{#1}{#2} }
-
- % syntactic suggar for horizaontal rule
- \newcommand{\Hrule}{ \rule{\linewidth}{0.1mm} }
-
-
- % Theme
- % ===============================================
-
- % Layout
- % =====================================================
-
- % Page core layout settings (include head and foot)
- % A4 will result to:
- % Top margin: 12mm
- % Bottom margin: 11mm
- % Head hight: 14mm
- % Foot skip: 15mm
- % Left margin: 15mm
- % Right margin: 12mm
- \newcommand{\authTopMargin}{12mm}
- \newcommand{\authBottomMargin}{12mm}
- \newcommand{\authHeadHeight}{10mm}
- \newcommand{\authFootSkip}{10mm}
- \newcommand{\authLeftMargin}{15mm}
- \newcommand{\authRightMargin}{15mm}
-
-
- %
- % Sets page layout. (include head and foot)
- \newcommand*{\authSetPageLayout}{%
- \newgeometry{%
- includeheadfoot,
- top= \authTopMargin,
- bottom= \authBottomMargin,
- headheight= \authHeadHeight,
- footskip= \authFootSkip,
- lmargin= \authLeftMargin,
- rmargin= \authRightMargin
- }
- }
-
- % Fonts
- % =====================================================
-
- % [1]: Main(Serif) body font
- % [5]: Sans family font
- % [6]: Mono family font
- %
- \newcommand{\authFontEnvSetup}[3]{%
- \setmainfont{#1}[SmallCapsFeatures={Letters=SmallCaps}]
- \setsansfont{#2}
- \setmonofont{#3}
-
- % \newfontface\smallcapsfont{Libertinus Serif}[Letters=SmallCaps]
- }
-
-
- % Header and Footer
- % =====================================================
-
- \newcommand*{\authSetFooterEmpty}{%
- % Clear styles
- \fancyfoot{}
- \renewcommand{\footrulewidth}{0pt}
- }
-
- \newcommand*{\authSetFooter}{%
- % Clear styles
- \fancyfoot{}
- \fancyfoot[C]{\thepage}
- \renewcommand{\footrulewidth}{0pt}
- \pagenumbering{arabic}
- }
-
- \newcommand{\authSetHeaderEmpty}{
- % Clear styles
- \fancyhead{}
- \renewcommand{\headrulewidth}{0pt}
- }
-
- \newcommand{\authSetHeader}{
- % Clear styles
- \fancyhead{}
- \fancyhead[L]{\auth@className}
- \fancyhead[R]{\auth@docTitle}
- \renewcommand{\headrulewidth}{0.5pt}
- }
-
-
- %
- % Page styles
- %
- \fancypagestyle{plain}{%
- % Style for the main document (including TOC)
- \authSetFooter
- \authSetHeader
- }
-
- \fancypagestyle{authTitlePageStyle}{%
- % Style for Title page
- \authSetHeaderEmpty
- \ifnum \isequal{\auth@short}{no}=0
- \authSetFooterEmpty
- \else
- \authSetFooter
- \fi
- }
-
-
- % Common Page style
- \newcommand{\authPageStyle}{%
-
- \renewcommand{\bottomtitlespace}{0.12\textheight}
-
- % Change the look of the section and subsection titles
- \titleformat{\section}[block]{\large\scshape}{\thesection.}{1em}{}
- \titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{}
- \titleformat{\subsubsection}[block]{\normalsize}{\thesubsubsection.}{1em}{}
-
- %\setlist[itemize]{noitemsep} % Make itemize lists more compact
- \setlist[itemize]{topsep=6pt, partopsep=0pt, itemsep=3pt, parsep=3pt}
-
- % Set paragraph identation and skip
- \setlength{\parindent}{0pt}
- \setlength{\parskip}{0.3em}
-
- }
-
-
- % Setup theme
- % =====================================================
-
- \hypersetup{
- colorlinks=true,
- linkcolor=red, % Internal links, those generated by cross-referenced elements
- filecolor=blue, % Links to local files
- urlcolor=blue % Links to web sites
- }
- \setlist[itemize]{topsep=0pt, partopsep=0pt, itemsep=3pt, parsep=3pt}
-
- \AtBeginDocument{%
- % Page layout (check above for the geometry setup)
- \authSetPageLayout
-
- % Fonts
- \authFontEnvSetup{CMU Serif}{CMU Sans Serif}{Courier New}
-
- % Header - Footer
- \pagestyle{plain}
- \thispagestyle{authTitlePageStyle}
-
- % Page styles and formating
- \authPageStyle
-
- \normalsize
- } % End \AtBeginDocument
-
-
-
- % QA document public environments/commands
- % =====================================================
-
- % Common fields
- % =====================================================
- \newcommand*{\AuthorName}[1]{\def\auth@authorName{#1}}
- \newcommand*{\AuthorMail}[1]{\def\auth@authorMail{#1}}
- \newcommand*{\AuthorAEM}[1]{\def\auth@authorAEM{#1}}
-
- \newcommand*{\CoAuthorName}[1]{\def\auth@coauthorName{#1}}
- \newcommand*{\CoAuthorMail}[1]{\def\auth@coauthorMail{#1}}
- \newcommand*{\CoAuthorAEM}[1]{\def\auth@coauthorAEM{#1}}
-
- \newcommand*{\WorkGroup}[1]{\def\auth@workGroup{#1}}
-
- \newcommand*{\DocTitle}[1]{\def\auth@docTitle{#1}}
- \newcommand*{\DocSubTitle}[1]{\def\auth@docSubTitle{#1}}
- \newcommand*{\Department}[1]{\def\auth@department{#1}}
- \newcommand*{\ClassName}[1]{\def\auth@className{#1}}
-
- \newcommand*{\InstructorName}[1]{\def\auth@instructorName{#1}}
- \newcommand*{\InstructorMail}[1]{\def\auth@instructorMail{#1}}
- \newcommand*{\CoInstructorName}[1]{\def\auth@coinstructorName{#1}}
- \newcommand*{\CoInstructorMail}[1]{\def\auth@coinstructorMail{#1}}
-
- \newcommand*{\CurrentDate}[1]{\def\auth@date{#1}}
-
-
-
- % \FirstPage
- \newcommand{\authTitlePage}{%
- \begin{titlepage}
- % Logo
- \begin{figure}
- \begin{flushleft}
- \includegraphics[width=5cm]{img/auth_logogr.png}
- \end{flushleft}
- \end{figure}
- % Titles
- \center % Center everything on the page
- \textbf{} \\[3.5cm] % vertical space
- \textsc{\Large \auth@department} \\[0.5cm] % Department
- \textsc{\Large \auth@className} \\[1.5cm] % Class/Course name
- \Hrule \\[0.4cm] % -------
- {\huge \bfseries \auth@docTitle} \\[0.4cm] % Document/Assignement Title
- {\LARGE \bfseries \auth@docSubTitle} \\[0.1cm] % Document/Assignement Sub-Title
- \Hrule \\[3.5cm] % -------
- % vertical space
- % Authors
- \begin{minipage}{0.4\textwidth}
- \begin{flushleft}
- \large
- \ifdefined \auth@workGroup \emph{\textsc{\auth@workGroup}} \\[2ex]\fi
- \ifdefined \auth@coauthorName
- \emph{Συντάκτες:}
- \else
- \emph{Συντάκτης:}
- \fi \\
- \textsc{\auth@authorName} \\
- \textsc{AEM:\auth@authorAEM} \\[0.35ex]
- \normalsize \href{mailto:\auth@authorMail}{\auth@authorMail} \\[2ex]
- \large
- \ifdefined \auth@coauthorName
- \textsc{\auth@coauthorName} \\
- \textsc{AEM:\auth@coauthorAEM} \\[0.35ex]
- \normalsize \href{mailto:\auth@coauthorMail}{\auth@coauthorMail} \\[2ex]
- \fi
- \end{flushleft}
- \end{minipage}
- \begin{minipage}{0.4\textwidth}
- \begin{flushright}
- \large
- \ifdefined \auth@coinstructorName % Instructor(s)
- \emph{Διδάσκοντες:}
- \else
- \emph{Διδάσκων:}
- \fi \\
- \textsc{\auth@instructorName} \\[0.35ex]
- \normalsize \href{mailto:\auth@instructorMail}{\auth@instructorMail} \\[2ex]
- \large
- \ifdefined \auth@coinstructorName
- \textsc{\auth@coinstructorName} \\[0.35ex]
- \normalsize \href{mailto:\auth@coinstructorMail}{\auth@coinstructorMail} \\[2ex]
- \fi
- \end{flushright}
- \end{minipage}
- \vfill
- {\large \auth@date} \\ % date
-
- \end{titlepage}
- \newpage
- }
-
- % \TitleHeader
- \newcommand{\authTitleHeader}{%
- \begin{center} % Center everything on the page
- % Logo
- \begin{figure}
- \center
- \includegraphics[width=5cm]{img/auth_logogr.png}
- \end{figure}
- % Titles
- \textsc{\Large \auth@department} \\[0.4cm] % Department
- \textsc{\Large \auth@className} \\[0.1cm] % Class/Course name
- {\Large \bfseries \auth@docTitle} \\[0.2cm] % Document/Assignement Title
- {\large \bfseries \auth@docSubTitle} \\[0.2cm] % Document/Assignement Sub-Title
- {\large \auth@date} \\[0.4cm] % date
- % Authors
- \begin{minipage}{0.4\textwidth}
- \begin{flushleft}
- \large
- \ifdefined \auth@coauthorName
- \emph{Συντάκτες:}
- \else
- \emph{Συντάκτης:}
- \fi \\
- \textsc{\auth@authorName} \\
- \textsc{AEM:\auth@authorAEM} \\[0.35ex]
- \normalsize \href{mailto:\auth@authorMail}{\auth@authorMail} \\[2ex]
- \large
- \ifdefined \auth@coauthorName
- \textsc{\auth@coauthorName} \\
- \textsc{AEM:\auth@coauthorAEM} \\[0.35ex]
- \normalsize \href{mailto:\auth@coauthorMail}{\auth@coauthorMail} \\[2ex]
- \fi
- \end{flushleft}
- \end{minipage}
- \begin{minipage}{0.4\textwidth}
- \begin{flushright} \large
- \large
- \ifdefined \auth@coinstructorName % Instructor(s)
- \emph{Διδάσκοντες:}
- \else
- \emph{Διδάσκων:}
- \fi \\
- \textsc{\auth@instructorName} \\[0.35ex]
- \normalsize \href{mailto:\auth@instructorMail}{\auth@instructorMail} \\[2ex]
- \large
- \ifdefined \auth@coinstructorName
- \textsc{\auth@coinstructorName} \\[0.35ex]
- \normalsize \href{mailto:\auth@coinstructorMail}{\auth@coinstructorMail} \\[2ex]
- \fi
- \end{flushright}
- \end{minipage}
- \end{center}
- }
-
- \newcommand{\InsertTitle}{%
- \ifnum \isequal{\auth@short}{no}=0
- \authTitlePage
- \else
- \authTitleHeader
- \fi
- }
-
- % \InsertFigure{}{}{}{}{}
- % [1]: Position specifier
- % [2]: scale
- % [3]: Label
- % [4]: Figure file
- % [5]: Caption text
- % example: \InsertFigure{!h}{0.8}{fig:lala}{lala.png}{\eng{Makes lala}}
- \newcommand{\InsertFigure}[5]{
- \begin{figure}[#1]
- \captionsetup{format=plain}
- \centering
- \includegraphics[width=#2\textwidth]{#4}
- \caption{#5}
- \label{#3}
- \end{figure}
- }
-
- % \WrapFigure{}{}{}{}
- % [1]: scale
- % [2]: place left or right r,l,R,L
- % [3]: Label
- % [4]: Figure file
- % [5]: Caption text
- % example: \WrapFigure{0.8}{r}{fig:lala}{lala.png}{\eng{Makes lala}}
- \newcommand{\WrapFigure}[5]{
- \begin{wrapfigure}{#2}{#1\textwidth}
- \vspace{-20pt}
- \begin{center}
- \captionsetup{format=plain}
- \includegraphics[width=#1\textwidth]{#4}
- \caption{#5}
- \label{#3}
- \end{center}
- \vspace{-20pt}
- \end{wrapfigure}
- }
|