A LaTeX configuration files to use for various reports
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

284 line
9.3 KiB

  1. %
  2. % AUTH report settings
  3. %
  4. % author:
  5. % Χρήστος Χουτουρίδης ΑΕΜ 8997
  6. % cchoutou@ece.auth.gr
  7. % Configuration requirements as new commands
  8. % ===============================================================
  9. %
  10. % \AuthorName: Author's name
  11. % \AuthorMail: Author's mail
  12. % \AuthorAEM: Author's AEM
  13. % \CoAuthorName: Co-author's name [optional]
  14. % \CoAuthorMail: Co-author's mail [optional]
  15. % \DocTitle: To print document title (also in fancyheader)
  16. % \CoAuthorAEM : Co-author's AEM [optional]
  17. % \WorkGroup: Working group of the assignment/project
  18. % \Department: The School
  19. % \ClassName: Class name to print (also in fancyheader)
  20. % \InstructorName: To print instructor's mame
  21. % \InstructorMail: To print instructor's mame
  22. % \CurrentDate: To print the date
  23. %
  24. % example:
  25. % \newcommand{\AuthorName}{Χρήστος Χουτουρίδης}
  26. % \newcommand{\AuthorMail}{cchoutou@ece.auth.gr}
  27. % \newcommand{\AuthorAEM}{8997}
  28. %
  29. % \newcommand{\CoAuthorName}{John Doe}
  30. % \newcommand{\CoAuthorMail}{doe@ece.auth.gr}
  31. % \newcommand{\CoAuthorAEM}{1729}
  32. %
  33. % \newcommand{\DocTitle}{Universal computing machine}
  34. % \newcommand{\Department}{Τμημα ΗΜΜΥ. Τομεάς Ηλεκτρονικής}
  35. % \newcommand{\ClassName}{Computer Science lab}
  36. %
  37. % \newcommand{\InstructorName}{Allan Turing}
  38. % \newcommand{\InstructorMail}{aturing@auth.gr}
  39. % \newcommand{\CurrentDate}{\today}
  40. %
  41. % Exported commands
  42. % ===============================================================
  43. % \eng{}
  44. % \gr{}
  45. % \setEnglish
  46. % \setGreek
  47. % \BottomTitleSpace{}
  48. % \FirstPage
  49. % \TitleHeader
  50. % \setFancyHeadLR{}{}
  51. % \setFancyHeadLERO{}{}
  52. % \InsertFigure{}{}{}{}
  53. % \WrapFigure{}{}{}{}{}
  54. % Packages and document configuration
  55. % ===============================================================
  56. \documentclass[11pt, twoside, a4paper]{article}
  57. \usepackage[margin=20mm, top=25mm]{geometry} % Document margins
  58. \usepackage[LGR, T1]{fontenc} % Language hyphenation and typographical rules
  59. \usepackage[utf8]{inputenc}
  60. \usepackage{microtype}
  61. \usepackage{lmodern}
  62. \usepackage[english, greek]{babel}
  63. \usepackage[pdfencoding=auto]{hyperref}
  64. \usepackage{enumitem} % Customized lists
  65. \setlist[itemize]{noitemsep} % Make itemize lists more compact
  66. \usepackage{graphicx} % Graphics and figures
  67. \graphicspath{ {images/} }
  68. \usepackage{wrapfig}
  69. % Custom captions under/above floats in tables or figures
  70. \usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption}
  71. % Allows customization of section/subsection titles
  72. \usepackage[nobottomtitles]{titlesec}
  73. \renewcommand{\bottomtitlespace}{0.12\textheight}
  74. \usepackage{titling}
  75. % Change the look of the section and subsection titles
  76. \titleformat{\section}[block]{\large\scshape}{\thesection.}{1em}{}
  77. \titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{}
  78. % Headers
  79. \usepackage{fancyhdr}
  80. \pagestyle{fancy} % All pages have headers and footers
  81. \fancyhead{} % Blank out the default header
  82. \fancyfoot{} % Blank out the default footer
  83. \fancyfoot[RO,LE]{\thepage} % Custom footer text
  84. \pagenumbering{arabic}
  85. \usepackage[bottom]{footmisc} % Place footnotes always as much to the bottom as possible.
  86. \usepackage{alphabeta}
  87. \usepackage{amsmath,amsfonts,mathtools}
  88. %\usepackage{multicol}
  89. %\usepackage{csvsimple}
  90. %\usepackage{tabularx}
  91. %\usepackage{lscape}
  92. % Local commands
  93. % ===============================================================
  94. % syntactic suggar for horizaontal rule
  95. \newcommand{\Hrule}{
  96. \rule{\linewidth}{0.1mm}
  97. }
  98. % AUTH report exported commands
  99. % ===============================================================
  100. % \eng{}
  101. % syntactic suggar for english text inside greek
  102. % example \eng{A quick brown fox jumpedover the lazy dog}
  103. \newcommand{\eng}[1]{\foreignlanguage{english}{#1}}
  104. % \gr{}
  105. % syntactic suggar for greek text inside english
  106. % example \gr{Άσπρη πέτρα ξέξασπρη κι απτον ήλιο ξεξασπρότερη}
  107. \newcommand{\gr}[1]{\foreignlanguage{greek}{#1}}
  108. % \setEnglish
  109. % Selects english for the rest of the text
  110. \newcommand{\setEnglish}{\selectlanguage{english}}
  111. % \setGreek
  112. % Selects greek for the rest of the text
  113. \newcommand{\setGreek}{\selectlanguage{greek}}
  114. % \BottomTitleSpace{}
  115. % example \BottomTitleSpace{8em}
  116. \newcommand{\BottomTitleSpace}[1]{
  117. \renewcommand{\bottomtitlespace}{#1}
  118. }
  119. % \FirstPage
  120. \newcommand{\FirstPage}{
  121. \begin{titlepage}
  122. % Logo
  123. \begin{figure}
  124. \begin{flushleft}
  125. \includegraphics[width=5cm]{config/images/auth_logogr.png}
  126. \end{flushleft}
  127. \end{figure}
  128. % Titles
  129. \center % Center everything on the page
  130. \textbf{} \\[3.5cm] % vertical space
  131. \textsc{\Large \Department} \\[0.5cm] % Department
  132. \textsc{\Large \ClassName} \\[1.5cm] % Class/Course name
  133. \Hrule \\[0.4cm] % -------
  134. {\huge \bfseries \DocTitle} \\[0.1cm] % Document/Assignement Title
  135. \Hrule \\[3.5cm] % -------
  136. % vertical space
  137. % Authors
  138. \begin{minipage}{0.4\textwidth}
  139. \begin{flushleft}
  140. \large
  141. \ifdefined \WorkGroup \emph{\textsc{\WorkGroup}}\\[2ex]\fi
  142. \ifdefined \CoAuthorName \emph{Συντάκτες:} \else \emph{Συντάκτης:}\fi \\
  143. \textsc{\AuthorName} \\
  144. \textsc{AEM:\AuthorAEM} \\[1ex]
  145. \normalsize \href{mailto:\AuthorMail}{\eng{\AuthorMail}} \\[2ex]
  146. \large
  147. \ifdefined\CoAuthorName \textsc{\CoAuthorName} \\ \fi
  148. \ifdefined\CoAuthorAEM \textsc{AEM:\CoAuthorAEM} \\[1ex] \fi
  149. \ifdefined\CoAuthorMail \normalsize \href{mailto:\CoAuthorMail}{\eng{\CoAuthorMail}} \fi
  150. \end{flushleft}
  151. \end{minipage}
  152. \begin{minipage}{0.4\textwidth}
  153. \begin{flushright} \large
  154. \emph{Διδάσκων:} \\ % Instructor
  155. \textsc{\InstructorName} \\[1ex]
  156. \normalsize
  157. \href{mailto:\InstructorMail}{\eng{\InstructorMail}}
  158. \end{flushright}
  159. \end{minipage} \\
  160. \vfill
  161. {\large \CurrentDate} \\ % date
  162. \end{titlepage}
  163. \newpage
  164. }
  165. % \TitleHeader
  166. \newcommand{\TitleHeader}{
  167. \thispagestyle{plain}
  168. \begin{center} % Center everything on the page
  169. % Logo
  170. \begin{figure}
  171. \center
  172. \includegraphics[width=5cm]{config/images/auth_logogr.png}
  173. \end{figure}
  174. % Titles
  175. \textsc{\Large \Department} \\[0.4cm] % Department
  176. \textsc{\Large \ClassName} \\[0.1cm] % Class/Course name
  177. {\Large \bfseries \DocTitle} \\[0.2cm] % Document/Assignement Title
  178. {\large \CurrentDate} \\[0.4cm] % date
  179. % Authors
  180. \begin{minipage}{0.4\textwidth}
  181. \begin{flushleft}
  182. \large
  183. \ifdefined \CoAuthorName \emph{Συντάκτες:} \else \emph{Συντάκτης:}\fi \\
  184. \textsc{\AuthorName} \\
  185. \textsc{AEM:\AuthorAEM} \\[1ex]
  186. \normalsize \href{mailto:\AuthorMail}{\eng{\AuthorMail}} \\[2ex]
  187. \large
  188. \ifdefined\CoAuthorName \textsc{\CoAuthorName} \\ \fi
  189. \ifdefined\CoAuthorAEM \textsc{AEM:\CoAuthorAEM} \\[1ex] \fi
  190. \ifdefined\CoAuthorMail \normalsize \href{mailto:\CoAuthorMail}{\eng{\CoAuthorMail}} \fi
  191. \end{flushleft}
  192. \end{minipage}
  193. \begin{minipage}{0.4\textwidth}
  194. \begin{flushright} \large
  195. \emph{Διδάσκων:} \\ % Instructor
  196. \textsc{\InstructorName} \\[1ex]
  197. \normalsize
  198. \href{mailto:\InstructorMail}{\eng{\InstructorMail}}
  199. \end{flushright}
  200. \end{minipage}
  201. \end{center}
  202. \text{} \\
  203. }
  204. % \setFancyHead{}{}
  205. % [1]: Left text
  206. % [2]: Right text
  207. % example: \setFancyHead{Μαθημα}{Εργασία}
  208. \newcommand{\setFancyHeadLR}[2]{
  209. \fancyhead[L]{#1}
  210. \fancyhead[R]{#2}
  211. }
  212. % \setFancyHead{}{}
  213. % [1]: Left, even page text
  214. % [2]: Right, odd page text
  215. % example: \setFancyHead{Μαθημα}{Εργασία}
  216. \newcommand{\setFancyHeadLERO}[2]{
  217. \fancyhead[LE]{#1}
  218. \fancyhead[RO]{#2}
  219. }
  220. % \InsertFigure{}{}{}{}
  221. % [1]: scale
  222. % [2]: Label
  223. % [3]: Figure file
  224. % [4]: Caption text
  225. % example: \InsertFigure{0.8}{fig:lala}{lala.png}{\eng{Makes lala}}
  226. \newcommand{\InsertFigure}[4]{
  227. \begin{figure*}[h!]
  228. \captionsetup{format=plain}
  229. \centering
  230. \includegraphics[width=#1\textwidth]{#3}
  231. \caption{#4}
  232. \label{#2}
  233. \end{figure*}
  234. }
  235. % \WrapFigure{}{}{}{}
  236. % [1]: scale
  237. % [2]: place left or right r,l,R,L
  238. % [3]: Label
  239. % [4]: Figure file
  240. % [5]: Caption text
  241. % example: \WrapFigure{0.8}{r}{fig:lala}{lala.png}{\eng{Makes lala}}
  242. \newcommand{\WrapFigure}[5]{
  243. \begin{wrapfigure}{#2}{#1\textwidth}
  244. \vspace{-20pt}
  245. \begin{center}
  246. \captionsetup{format=plain}
  247. \includegraphics[width=#1\textwidth]{#4}
  248. \caption{#5}
  249. \label{#3}
  250. \end{center}
  251. \vspace{-20pt}
  252. \end{wrapfigure}
  253. }