WIP: Unified report

This commit is contained in:
Christos Choutouridis 2024-12-09 01:11:32 +02:00
parent ac4359558c
commit b10845bf74
41 changed files with 282 additions and 121 deletions

View File

@ -6,8 +6,9 @@
% author: Christos Choutouridis <cchoutou@ece.auth.gr>
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{AUTHReport}[2024-11-03 AUTH Report document class]
\ProvidesClass{AUThReport}[2024-12-07 AUTh Report document class]
% Pre-option packages
% Options
% ===============================================
@ -15,13 +16,7 @@
% 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*{%
@ -35,15 +30,26 @@
% Requirements
% ===============================================
\RequirePackage{iftex}
% Font packages
\ifPDFTeX
\RequirePackage[LGR, T1]{fontenc} % ToDo: find a way to dynamicaly select encoding based on languages
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[english, greek]{babel}
\RequirePackage{lmodern}
\else
\RequirePackage{fontspec}
\RequirePackage{polyglossia}
\fi
% Language packages
\ifPDFTeX
% Postponed to Pre-Begin hook
% \usepackage{babel}
\else
\typeout{[DEBUG] Polyglossia Included}
\RequirePackage{polyglossia}%
\fi
\RequirePackage{xargs} % Commands
\RequirePackage{geometry} % Layout
@ -60,7 +66,7 @@
\RequirePackage{hyperref} % Various
\RequirePackage[ddmmyyyy]{datetime}
\RequirePackage{enumitem}
\RequirePackage{multicol}
% Local Tools
% ===============================================
@ -71,6 +77,63 @@
% syntactic suggar for horizaontal rule
\newcommand{\Hrule}{ \rule{\linewidth}{0.1mm} }
\newcommand{\authAuthorTitleText}{%
\ifnum \isequal{\auth@mainlanguage}{greek}=0
\ifdefined \auth@coauthorName Συντάκτες\else Συντάκτης\fi
\else
\ifdefined \auth@coauthorName Authors\else Author\fi
\fi
}
\newcommand{\authInstructorTitleText}{%
\ifnum \isequal{\auth@mainlanguage}{greek}=0
\ifdefined \auth@coinstructorName Διδάσκοντες\else Διδάσκων\fi
\else
\ifdefined \auth@coinstructorName Instructors\else Instructor\fi
\fi
}
\newcommand{\authMailText}[1]{%
\ifnum \isequal{\auth@mainlanguage}{greek}=0
\href{mailto:#1}{\eng{#1}}
\else
\href{mailto:#1}{#1}
\fi
}
% Pre-Begin hook
% =====================================================
\newcommand{\authPreBeginHook}{}
\newcommand{\authAddToPreBeginHook}[1]{%
\expandafter\gdef\expandafter\authPreBeginHook\expandafter{\authPreBeginHook#1}%
}
% Language
% ===============================================
% Init language variables
\newcommand{\auth@languages}{english} % Pre-selected language
\newcommand{\auth@mainlanguage}{english} % Pre-selected main language
\newcommand{\authSetupLanguageEnv}{%
\ifPDFTeX
\usepackage[\auth@languages, \auth@mainlanguage]{babel}
\else
% Set main language
\setdefaultlanguage{\auth@mainlanguage}%
\typeout{[DEBUG] setdefaultlanguage \auth@mainlanguage}
% Set other languages
\@for\auth@lang:=\auth@languages\do{%
\setotherlanguage{\auth@lang}
\typeout{[DEBUG] setotherlanguage \auth@lang}
}%
\fi
}
% Hook the babel setup
\authAddToPreBeginHook{%
\authSetupLanguageEnv
}
% Theme
% ===============================================
@ -111,14 +174,40 @@
% 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}
\newcommand{\authSetupFontEnv}{%
\ifPDFTeX
% PDFLaTeX fonts
\else
% \setmainfont{CMU-Serif-Roman.ttf}[%
% Path=cmu/,
% ItalicFont = CMU-Serif-Italic.ttf,
% BoldFont = CMU-Serif-Bold.ttf,
% BoldItalicFont= CMU-Serif-BoldItalic.ttf
% ]
% \setsansfont{CMU-Sans-Medium.ttf}[%
% Path=cmu/,
% ItalicFont = CMU-Sans-Oblique.ttf,
% BoldFont = CMU-Sans-Bold.ttf,
% BoldItalicFont= CMU-Sans-BoldOblique.ttf
% ]
% %\setsansfont{CMU-Concrete-Roman.ttf}[%
% % Path=cmu/,
% % ItalicFont = CMU-Concrete-Italic.ttf,
% % BoldFont = CMU-Concrete-Bold.ttf,
% % BoldItalicFont= CMU-Concrete-BoldItalic.ttf
% %]
% \setmonofont{CMU-Typewriter-Regular.ttf}[%
% Path=cmu/,
% ItalicFont = CMU-Typewriter-Oblique.ttf,
% BoldFont = CMU-Typewriter-Bold.ttf,
% BoldItalicFont= CMU-Typewriter-Oblique.ttf
% ]
\typeout{[DEBUG] set fonts}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\fi
}
@ -203,20 +292,16 @@
filecolor=blue, % Links to local files
urlcolor=blue % Links to web sites
}
\setlist[itemize]{topsep=0pt, partopsep=0pt, itemsep=3pt, parsep=3pt}
\AtBeginDocument{%
% % Language
% \authSetupLanguageEnv
% Fonts
\authSetupFontEnv
% 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
@ -233,7 +318,7 @@
% QA document public environments/commands
% Public environments/commands
% =====================================================
% Common fields
@ -261,7 +346,90 @@
\newcommand*{\CurrentDate}[1]{\def\auth@date{#1}}
% Language
% =====================================================
\newcommand{\authSetMainLanguage}[1]{%
\renewcommand{\auth@mainlanguage}{#1}
}
\newcommand{\authSetLanguages}[1]{%
\renewcommand{\auth@languages}{#1}
}
% \eng{}
% syntactic suggar for english text inside greek
% example \eng{A quick brown fox jumpedover the lazy dog}
\newcommand{\eng}[1]{%
\ifPDFTeX
\foreignlanguage{english}{#1}
\else
#1
\fi
}
% \gr{}
% syntactic suggar for greek text inside english
% example \gr{Άσπρη πέτρα ξέξασπρη κι απτον ήλιο ξεξασπρότερη}
\newcommand{\gr}[1]{%
\ifPDFTeX
\foreignlanguage{greek}{#1}
\else
#1
\fi
}
% \setEnglish
% Selects english for the rest of the text
\newcommand{\setEnglish}{%
\ifPDFTeX \selectlanguage{english} \typeout{[DEBUG] set Eng} \else \typeout{[DEBUG] No set Eng}\fi
}
% \setGreek
% Selects greek for the rest of the text
\newcommand{\setGreek}{%
\ifPDFTeX \selectlanguage{greek} \typeout{[DEBUG] set Gre}\else \typeout{[DEBUG] NO set Gre} \fi
}
% Content commands
% =====================================================
\newcommand{\authInsertAuthsInstructors}{%
\center
\noindent
% Authors
\hspace*{0.05\textwidth}
\begin{minipage}[t]{0.35\textwidth}
\begin{flushleft}
\large
\ifdefined \auth@workGroup \emph{\textsc{\auth@workGroup}} \\[2ex]\fi
\emph{\authAuthorTitleText:} \\
\auth@authorName\hspace{1ex}[\auth@authorAEM] \\[0.35ex]
\normalsize \authMailText{\auth@authorMail} \\[2ex]
\large
\ifdefined \auth@coauthorName
\auth@coauthorName\hspace{1ex}[\auth@coauthorAEM] \\[0.35ex]
\normalsize \authMailText{\auth@coauthorMail} \\[2ex]
\fi
\end{flushleft}
\end{minipage}
\hfill
% Instructors
\begin{minipage}[t]{0.35\textwidth}
\begin{flushright}
\large
\emph{\authInstructorTitleText:} \\
\auth@instructorName \\[0.35ex]
\normalsize \authMailText{\auth@instructorMail} \\[2ex]
\large
\ifdefined \auth@coinstructorName
\auth@coinstructorName \\[0.35ex]
\normalsize \authMailText{\auth@coinstructorMail} \\[2ex]
\fi
\end{flushright}
\end{minipage}
\hspace*{0.05\textwidth}
}
% \FirstPage
\newcommand{\authTitlePage}{%
\begin{titlepage}
@ -280,45 +448,8 @@
{\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}
% Authors-Instructors
\authInsertAuthsInstructors
\vfill
{\large \auth@date} \\ % date
@ -330,7 +461,9 @@
\newcommand{\authTitleHeader}{%
\begin{center} % Center everything on the page
% Logo
\noindent
\begin{figure}
\vspace{-0.8cm}
\center
\includegraphics[width=5cm]{img/auth_logogr.png}
\end{figure}
@ -340,43 +473,8 @@
{\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}
% Authors-Instructors
\authInsertAuthsInstructors
\end{center}
}

View File

@ -1,5 +1,5 @@
%
% Network programming Lab sum report
% AUTH report template for greek
%
% authors:
% Χρήστος Χουτουρίδης ΑΕΜ 8997
@ -7,15 +7,20 @@
% Options:
% short: Switch to title header instead of title page
\documentclass[a4paper, 11pt]{AUTHReport}
\documentclass[a4paper, 11pt]{AUThReport}
\AuthorName{Χρήστος Χουτουρίδης}
\AuthorAEM{8997}
\AuthorMail{cchoutou@ece.auth.gr}
\authSetMainLanguage{greek}
\authSetLanguages{english}
%\CoAuthorName{CoAuthor Name}
\authSetupLanguageEnv
\AuthorName{Όνομα Επίθετο}
\AuthorAEM{1234}
\AuthorMail{xxx@ece.auth.gr}
%\CoAuthorName{Όνομα Επίθετο}
%\CoAuthorAEM{AEM}
%\CoAuthorMail{CoAuthor Mail}
%\CoAuthorMail{xxx@ece.auth.gr}
% \WorkGroup{Ομάδα Χ}
@ -24,13 +29,13 @@
\Department{Τμήμα ΗΜΜΥ. Τομέας Ηλεκτρονικής}
\ClassName{Μάθημα}
\InstructorName{Ον. Επίθετο}
%
\InstructorName{Όνομα Επίθετο}
\InstructorMail{xxx@auth.gr}
\CoInstructorName{Ν. Surname}
\CoInstructorName{Όνομα Επίθετο}
\CoInstructorMail{xxx@ece.auth.gr}
%
\CurrentDate{\today}
@ -41,11 +46,12 @@
\InsertTitle
\section{Εισαγωγή Intro}
\lipsum[1-4]
\section{Εισαγωγή}
\subsection{μικρός τίτλος small title}
\lipsum[1]
\lipsum[1-4]
\setEnglish
\lipsum[1]
\setGreek
\end{document}

57
AUThReportTemplateEN.tex Normal file
View File

@ -0,0 +1,57 @@
%
% AUTH report template for english
%
% authors:
% Χρήστος Χουτουρίδης ΑΕΜ 8997
% cchoutou@ece.auth.gr
% Options:
% short: Switch to title header instead of title page
\documentclass[a4paper, 11pt]{AUThReport}
\authSetMainLanguage{english}
\authSetLanguages{greek}
\authSetupLanguageEnv
\AuthorName{Name Surname}
\AuthorAEM{1234}
\AuthorMail{xxx@ece.auth.gr}
%\CoAuthorName{Name Surname}
%\CoAuthorAEM{AEM}
%\CoAuthorMail{xxx@ece.auth.gr}
% \WorkGroup{Ομάδα Χ}
\DocTitle{Title}
\DocSubTitle{Subtitle}
\Department{Electrical and Computer Engineering. Electronics Sector}
\ClassName{Class Name}
\InstructorName{Name Surname}
\InstructorMail{xxx@auth.gr}
\CoInstructorName{Name Surname}
\CoInstructorMail{xxx@ece.auth.gr}
\CurrentDate{\today}
\usepackage{lipsum}
\begin{document}
\InsertTitle
\section{Intro}
\lipsum[1]
\setGreek % Only for LaTex, dont use it in XeLaTeX
\lipsum[1]
\setEnglish % Only for LaTex, dont use it in XeLaTeX
\end{document}

BIN
cmu/CMU-Bright-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
cmu/CMU-Bright-Oblique.ttf Normal file

Binary file not shown.

BIN
cmu/CMU-Bright-Roman.ttf Normal file

Binary file not shown.

BIN
cmu/CMU-Bright-SemiBold.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
cmu/CMU-Concrete-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
cmu/CMU-Concrete-Italic.ttf Normal file

Binary file not shown.

BIN
cmu/CMU-Concrete-Roman.ttf Normal file

Binary file not shown.

BIN
cmu/CMU-Sans-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
cmu/CMU-Sans-Medium.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
cmu/CMU-Sans-Oblique.ttf Normal file

Binary file not shown.

BIN
cmu/CMU-Serif-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
cmu/CMU-Serif-Italic.ttf Normal file

Binary file not shown.

BIN
cmu/CMU-Serif-Roman.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
cmu/CMU-Typewriter-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.