% % AUTH report class % % note: Requires compilation with XeLaTeX or LuaTeX % % author: Christos Choutouridis % \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} \RequirePackage[english, greek]{babel} \else \RequirePackage{fontspec} \RequirePackage{polyglossia} \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} } % 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} \setdefaultlanguage{greek} % Main language \setotherlanguage{english} % Other language %hyphenation settiongs \lefthyphenmin=2 % minimum characters before \righthyphenmin=2 % minimum characters after % 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 \\ \auth@authorName \\ AEM:\auth@authorAEM \\[0.35ex] \normalsize \href{mailto:\auth@authorMail}{\auth@authorMail} \\[2ex] \large \ifdefined \auth@coauthorName \auth@coauthorName \\ 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 \\ \auth@instructorName \\[0.35ex] \normalsize \href{mailto:\auth@instructorMail}{\auth@instructorMail} \\[2ex] \large \ifdefined \auth@coinstructorName \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} }