AUTH Report LaTeX class
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

AUTHReport.cls 11 KiB

3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
3週間前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. %
  2. % AUTH report class
  3. %
  4. % note: Requires compilation with XeLaTeX or LuaTeX
  5. %
  6. % author: Christos Choutouridis <cchoutou@ece.auth.gr>
  7. %
  8. \NeedsTeXFormat{LaTeX2e}
  9. \ProvidesPackage{AUTHReport}[2024-11-03 AUTH Report document class]
  10. % Options
  11. % ===============================================
  12. % Declare option for short report version
  13. \DeclareOption{short}{\def\auth@short{yes}}
  14. % Declare option for CoAuthor
  15. \DeclareOption{coauthor}{\def\auth@coauthor{yes}}
  16. % Default option values
  17. \def\auth@short{no}
  18. \def\auth@coauthor{no}
  19. % Pass all other options to article
  20. \DeclareOption*{%
  21. \PassOptionsToClass{\CurrentOption}{article}
  22. }
  23. \ProcessOptions\relax
  24. \LoadClass{article}
  25. % Requirements
  26. % ===============================================
  27. \RequirePackage{iftex}
  28. \ifPDFTeX
  29. \RequirePackage[utf8]{inputenc}
  30. \RequirePackage[T1]{fontenc}
  31. \else
  32. \RequirePackage{fontspec}
  33. \fi
  34. \RequirePackage{xargs} % Commands
  35. \RequirePackage{geometry} % Layout
  36. \RequirePackage{fancyhdr}
  37. \RequirePackage{graphicx} % Figures
  38. % Format packages
  39. \RequirePackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures
  40. \RequirePackage[nobottomtitles]{titlesec}
  41. \RequirePackage{titling}
  42. \RequirePackage[bottom]{footmisc} % Place footnotes always as much to the bottom as possible.
  43. \RequirePackage{hyperref} % Various
  44. \RequirePackage[ddmmyyyy]{datetime}
  45. \RequirePackage{enumitem}
  46. % Local Tools
  47. % ===============================================
  48. % Tool to check equality
  49. \newcommand{\isequal}[2]{ \pdf@strcmp{#1}{#2} }
  50. % syntactic suggar for horizaontal rule
  51. \newcommand{\Hrule}{ \rule{\linewidth}{0.1mm} }
  52. % Theme
  53. % ===============================================
  54. % Layout
  55. % =====================================================
  56. % Page core layout settings (include head and foot)
  57. % A4 will result to:
  58. % Top margin: 12mm
  59. % Bottom margin: 11mm
  60. % Head hight: 14mm
  61. % Foot skip: 15mm
  62. % Left margin: 15mm
  63. % Right margin: 12mm
  64. \newcommand{\authTopMargin}{12mm}
  65. \newcommand{\authBottomMargin}{12mm}
  66. \newcommand{\authHeadHeight}{10mm}
  67. \newcommand{\authFootSkip}{10mm}
  68. \newcommand{\authLeftMargin}{15mm}
  69. \newcommand{\authRightMargin}{15mm}
  70. %
  71. % Sets page layout. (include head and foot)
  72. \newcommand*{\authSetPageLayout}{%
  73. \newgeometry{%
  74. includeheadfoot,
  75. top= \authTopMargin,
  76. bottom= \authBottomMargin,
  77. headheight= \authHeadHeight,
  78. footskip= \authFootSkip,
  79. lmargin= \authLeftMargin,
  80. rmargin= \authRightMargin
  81. }
  82. }
  83. % Fonts
  84. % =====================================================
  85. % [1]: Main(Serif) body font
  86. % [5]: Sans family font
  87. % [6]: Mono family font
  88. %
  89. \newcommand{\authFontEnvSetup}[3]{%
  90. \setmainfont{#1}[SmallCapsFeatures={Letters=SmallCaps}]
  91. \setsansfont{#2}
  92. \setmonofont{#3}
  93. % \newfontface\smallcapsfont{Libertinus Serif}[Letters=SmallCaps]
  94. }
  95. % Header and Footer
  96. % =====================================================
  97. \newcommand*{\authSetFooterEmpty}{%
  98. % Clear styles
  99. \fancyfoot{}
  100. \renewcommand{\footrulewidth}{0pt}
  101. }
  102. \newcommand*{\authSetFooter}{%
  103. % Clear styles
  104. \fancyfoot{}
  105. \fancyfoot[C]{\thepage}
  106. \renewcommand{\footrulewidth}{0pt}
  107. \pagenumbering{arabic}
  108. }
  109. \newcommand{\authSetHeaderEmpty}{
  110. % Clear styles
  111. \fancyhead{}
  112. \renewcommand{\headrulewidth}{0pt}
  113. }
  114. \newcommand{\authSetHeader}{
  115. % Clear styles
  116. \fancyhead{}
  117. \fancyhead[L]{\auth@className}
  118. \fancyhead[R]{\auth@docTitle}
  119. \renewcommand{\headrulewidth}{0.5pt}
  120. }
  121. %
  122. % Page styles
  123. %
  124. \fancypagestyle{plain}{%
  125. % Style for the main document (including TOC)
  126. \authSetFooter
  127. \authSetHeader
  128. }
  129. \fancypagestyle{authTitlePageStyle}{%
  130. % Style for Title page
  131. \authSetHeaderEmpty
  132. \ifnum \isequal{\auth@short}{no}=0
  133. \authSetFooterEmpty
  134. \else
  135. \authSetFooter
  136. \fi
  137. }
  138. % Common Page style
  139. \newcommand{\authPageStyle}{%
  140. \renewcommand{\bottomtitlespace}{0.12\textheight}
  141. % Change the look of the section and subsection titles
  142. \titleformat{\section}[block]{\large\scshape}{\thesection.}{1em}{}
  143. \titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{}
  144. \titleformat{\subsubsection}[block]{\normalsize}{\thesubsubsection.}{1em}{}
  145. \setlist[itemize]{noitemsep} % Make itemize lists more compact
  146. % Set paragraph identation and skip
  147. \setlength{\parindent}{0pt}
  148. \setlength{\parskip}{0.65em}
  149. }
  150. % Setup theme
  151. % =====================================================
  152. \AtBeginDocument{%
  153. % Page layout (check above for the geometry setup)
  154. \authSetPageLayout
  155. % Fonts
  156. \authFontEnvSetup{CMU Serif}{CMU Sans Serif}{Courier New}
  157. % Header - Footer
  158. \pagestyle{plain}
  159. \thispagestyle{authTitlePageStyle}
  160. % Page styles and formating
  161. \authPageStyle
  162. \normalsize
  163. } % End \AtBeginDocument
  164. % QA document public environments/commands
  165. % =====================================================
  166. % Common fields
  167. % =====================================================
  168. \newcommand*{\AuthorName}[1]{\def\auth@authorName{#1}}
  169. \newcommand*{\AuthorMail}[1]{\def\auth@authorMail{#1}}
  170. \newcommand*{\AuthorAEM}[1]{\def\auth@authorAEM{#1}}
  171. \newcommand*{\CoAuthorName}[1]{\def\auth@coauthorName{#1}}
  172. \newcommand*{\CoAuthorMail}[1]{\def\auth@coauthorMail{#1}}
  173. \newcommand*{\CoAuthorAEM}[1]{\def\auth@coauthorAEM{#1}}
  174. \newcommand*{\WorkGroup}[1]{\def\auth@workGroup{#1}}
  175. \newcommand*{\DocTitle}[1]{\def\auth@docTitle{#1}}
  176. \newcommand*{\DocSubTitle}[1]{\def\auth@docSubTitle{#1}}
  177. \newcommand*{\Department}[1]{\def\auth@department{#1}}
  178. \newcommand*{\ClassName}[1]{\def\auth@className{#1}}
  179. \newcommand*{\InstructorName}[1]{\def\auth@instructorName{#1}}
  180. \newcommand*{\InstructorMail}[1]{\def\auth@instructorMail{#1}}
  181. \newcommand*{\CurrentDate}[1]{\def\auth@date{#1}}
  182. % \FirstPage
  183. \newcommand{\authTitlePage}{%
  184. \begin{titlepage}
  185. % Logo
  186. \begin{figure}
  187. \begin{flushleft}
  188. \includegraphics[width=5cm]{img/auth_logogr.png}
  189. \end{flushleft}
  190. \end{figure}
  191. % Titles
  192. \center % Center everything on the page
  193. \textbf{} \\[3.5cm] % vertical space
  194. \textsc{\Large \auth@department} \\[0.5cm] % Department
  195. \textsc{\Large \auth@className} \\[1.5cm] % Class/Course name
  196. \Hrule \\[0.4cm] % -------
  197. {\huge \bfseries \auth@docTitle} \\[0.4cm] % Document/Assignement Title
  198. {\LARGE \bfseries \auth@docSubTitle} \\[0.1cm] % Document/Assignement Sub-Title
  199. \Hrule \\[3.5cm] % -------
  200. % vertical space
  201. % Authors
  202. \begin{minipage}{0.4\textwidth}
  203. \begin{flushleft}
  204. \large
  205. \ifdefined \auth@workGroup \emph{\textsc{\auth@workGroup}} \\[2ex]\fi
  206. \ifnum \isequal{\auth@coauthor}{yes}=0
  207. \emph{Συντάκτες:}
  208. \else
  209. \emph{Συντάκτης:}
  210. \fi \\
  211. \textsc{\auth@authorName} \\
  212. \textsc{AEM:\auth@authorAEM} \\[1ex]
  213. \normalsize \href{mailto:\auth@authorMail}{\auth@authorMail} \\[2ex]
  214. \large
  215. \ifnum \isequal{\auth@coauthor}{yes}=0
  216. \textsc{\auth@coauthorName} \\
  217. \textsc{AEM:\auth@coauthorAEM} \\[1ex]
  218. \normalsize \href{mailto:\auth@coauthorMail}{\auth@coauthorMail}
  219. \fi
  220. \end{flushleft}
  221. \end{minipage}
  222. \begin{minipage}{0.4\textwidth}
  223. \begin{flushright} \large
  224. \emph{Διδάσκων:} \\ % Instructor
  225. \textsc{\auth@instructorName} \\[1ex]
  226. \normalsize
  227. \href{mailto:\auth@instructorMail}{\auth@instructorMail}
  228. \end{flushright}
  229. \end{minipage} \\
  230. \vfill
  231. {\large \auth@date} \\ % date
  232. \end{titlepage}
  233. \newpage
  234. }
  235. % \TitleHeader
  236. \newcommand{\authTitleHeader}{%
  237. \begin{center} % Center everything on the page
  238. % Logo
  239. \begin{figure}
  240. \center
  241. \includegraphics[width=5cm]{img/auth_logogr.png}
  242. \end{figure}
  243. % Titles
  244. \textsc{\Large \auth@department} \\[0.4cm] % Department
  245. \textsc{\Large \auth@className} \\[0.1cm] % Class/Course name
  246. {\Large \bfseries \auth@docTitle} \\[0.2cm] % Document/Assignement Title
  247. {\large \bfseries \auth@docSubTitle} \\[0.2cm] % Document/Assignement Sub-Title
  248. {\large \auth@date} \\[0.4cm] % date
  249. % Authors
  250. \begin{minipage}{0.4\textwidth}
  251. \begin{flushleft}
  252. \large
  253. \ifnum \isequal{\auth@coauthor}{yes}=0
  254. \emph{Συντάκτες:}
  255. \else
  256. \emph{Συντάκτης:}
  257. \fi \\
  258. \textsc{\auth@authorName} \\
  259. \textsc{AEM:\auth@authorAEM} \\[1ex]
  260. \normalsize \href{mailto:\auth@authorMail}{\auth@authorMail} \\[2ex]
  261. \large
  262. \ifnum \isequal{\auth@coauthor}{yes}=0
  263. \textsc{\auth@coauthorName} \\
  264. \textsc{AEM:\auth@coauthorAEM} \\[1ex]
  265. \normalsize \href{mailto:\auth@coauthorMail}{\auth@coauthorMail}
  266. \fi
  267. \end{flushleft}
  268. \end{minipage}
  269. \begin{minipage}{0.4\textwidth}
  270. \begin{flushright} \large
  271. \emph{Διδάσκων:} \\ % Instructor
  272. \textsc{\auth@instructorName} \\[1ex]
  273. \normalsize
  274. \href{mailto:\auth@instructorMail}{\auth@instructorMail}
  275. \end{flushright}
  276. \end{minipage}
  277. \end{center}
  278. }
  279. \newcommand{\InsertTitle}{%
  280. \ifnum \isequal{\auth@short}{no}=0
  281. \authTitlePage
  282. \else
  283. \authTitleHeader
  284. \fi
  285. }
  286. % \InsertFigure{}{}{}{}
  287. % [1]: scale
  288. % [2]: Label
  289. % [3]: Figure file
  290. % [4]: Caption text
  291. % example: \InsertFigure{0.8}{fig:lala}{lala.png}{\eng{Makes lala}}
  292. \newcommand{\InsertFigure}[4]{
  293. \begin{figure*}[h!]
  294. \captionsetup{format=plain}
  295. \centering
  296. \includegraphics[width=#1\textwidth]{#3}
  297. \caption{#4}
  298. \label{#2}
  299. \end{figure*}
  300. }
  301. % \WrapFigure{}{}{}{}
  302. % [1]: scale
  303. % [2]: place left or right r,l,R,L
  304. % [3]: Label
  305. % [4]: Figure file
  306. % [5]: Caption text
  307. % example: \WrapFigure{0.8}{r}{fig:lala}{lala.png}{\eng{Makes lala}}
  308. \newcommand{\WrapFigure}[5]{
  309. \begin{wrapfigure}{#2}{#1\textwidth}
  310. \vspace{-20pt}
  311. \begin{center}
  312. \captionsetup{format=plain}
  313. \includegraphics[width=#1\textwidth]{#4}
  314. \caption{#5}
  315. \label{#3}
  316. \end{center}
  317. \vspace{-20pt}
  318. \end{wrapfigure}
  319. }