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.

latex4ei_report.cls 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. %
  2. % Report class from LaTeX4EI
  3. %
  4. % Authors: Emanuel Regnath, Martin Zellner
  5. % Contact: info@latex4ei.de
  6. % Version: 1.1
  7. % License: TBD
  8. %
  9. % © 2011-2019, LaTeX4EI
  10. \NeedsTeXFormat{LaTeX2e}[1996/12/01]
  11. \ProvidesClass{latex4ei_report}[2015/03/15]
  12. % ======================================================================
  13. % Options
  14. % ======================================================================
  15. % forward options to latex4ei package
  16. \DeclareOption{color}{\PassOptionsToPackage{color}{latex4ei/latex4ei}}
  17. \DeclareOption{nocolor}{\PassOptionsToPackage{nocolor}{latex4ei/latex4ei}}
  18. % define baseclass
  19. \def\baseclass{scrartcl}
  20. % set default options for base class
  21. \PassOptionsToClass{a4paper, 11pt}{\baseclass}
  22. % pass unknown options to base class
  23. \DeclareOption*{%
  24. \PassOptionsToClass{\CurrentOption}{\baseclass}%
  25. }
  26. % process options
  27. \ProcessOptions\relax
  28. % load baseclass
  29. \LoadClass{\baseclass}
  30. % ======================================================================
  31. % Packages
  32. % ======================================================================
  33. % pass options to packages
  34. \PassOptionsToPackage{table}{xcolor}
  35. % load latex4ei packages
  36. \RequirePackage{latex4ei/scientific} % scientific macros for LaTeX4EI
  37. \RequirePackage{latex4ei/latex4ei} % base definitions for LaTeX4EI (privat)
  38. \RequirePackage{abstract}
  39. % ======================================================================
  40. % Color Scheme
  41. % ======================================================================
  42. % Set Color Scheme
  43. % ----------------------------------------------------------------------
  44. \definecolor{url}{gray}{0.6}
  45. % ======================================================================
  46. % Fonts
  47. % ======================================================================
  48. % Font Settings
  49. % ----------------------------------------------------------------------
  50. % font
  51. %\RequirePackage[osf]{mathpazo} % old style numbering
  52. \renewcommand{\rmdefault}{ppl} % cmr, ptm, ppl, pnc, pbk
  53. %\renewcommand{\sfdefault}{cmss} % cmss, phv pag
  54. \shorthandoff{"} % don't convert "A to Ä!
  55. % calculate linespacing based on font size
  56. % char per line: 85
  57. \RequirePackage{setspace}
  58. \linespread{1.3}\selectfont
  59. %\usepackage{microtype} % Verbesserung des Kernings, Achtung kompilezeit!
  60. % ======================================================================
  61. % Title
  62. % ======================================================================
  63. \newcommand*{\@chair}{}
  64. \newcommand*{\chair}[1]{\gdef\@chair{#1}}
  65. \newcommand*{\@university}{}
  66. \newcommand*{\university}[1]{\gdef\@university{#1}}
  67. \newcommand*{\@professor}{}
  68. \newcommand*{\professor}[1]{\gdef\@professor{#1}}
  69. \newcommand*{\@supervisors}{}
  70. \newcommand*{\supervisors}[1]{\gdef\@supervisors{#1}}
  71. \newcommand*{\@startdate}{}
  72. \newcommand*{\startdate}[1]{\gdef\@startdate{#1}}
  73. \newcommand*{\@finaldate}{}
  74. \newcommand*{\finaldate}[1]{\gdef\@finaldate{#1}}
  75. \newcommand*{\@matrikelnr}{}
  76. \newcommand*{\matrikelnr}[1]{\gdef\@matrikelnr{#1}}
  77. \newcommand*{\@studentemail}{}
  78. \newcommand*{\studentemail}[1]{\gdef\@studentemail{#1}}
  79. \def\maketitle{%
  80. \begin{centering}
  81. \vspace{1cm}
  82. \begin{huge}
  83. \textbf{\sffamily\@title}
  84. \end{huge}\\[2em]
  85. {\large \@author} \\[1em]
  86. Registration no. \@matrikelnr \\
  87. E-mail: \email{\@studentemail} \\[2em]
  88. \end{centering}
  89. \thispagestyle{empty}
  90. }
  91. % ======================================================================
  92. % Layout
  93. % ======================================================================
  94. % Page Layout
  95. % ----------------------------------------------------------------------
  96. \RequirePackage{geometry}
  97. \geometry{hmargin=2.5cm, top=3cm, bottom=3.2cm}
  98. \def\mparsetup{%
  99. \sffamily\scriptsize %
  100. \linespread{0.9}\selectfont%
  101. \parindent=0pt \lineskip=0pt \lineskiplimit=0pt %
  102. \tolerance=2000 \hyphenpenalty=300 \exhyphenpenalty=300%
  103. \doublehyphendemerits=100000%
  104. \finalhyphendemerits=\doublehyphendemerits}
  105. \let\oldmarginpar\marginpar % save old command
  106. \renewcommand{\marginpar}[1]{\oldmarginpar[\mparsetup\raggedleft\hspace{0pt}{#1}]{\mparsetup\raggedright\hspace{0pt}{#1}}}
  107. % Footnotes
  108. % ----------------------------------------------------------------------
  109. \long\def\@makefntext#1{%
  110. \leftskip 0pt
  111. \parindent 0pt
  112. \everypar{\parindent 0pt}%
  113. \leavevmode\llap{\@thefnmark\hskip\marginparsep}#1} % footnote number in margin
  114. \renewcommand\footnoterule{%
  115. \kern-3\p@
  116. \hrule\@width \columnwidth
  117. \kern2.6\p@}
  118. \skip\@mpfootins=4pt
  119. % Sections
  120. % ----------------------------------------------------------------------
  121. \RequirePackage{titlesec}
  122. %\titleformat{ command }[ shape ]{ format }{ label }{ sep }{ before }[ after ]
  123. %\titlespacing*{ command }{ left }{ beforesep }{ aftersep }[ right ]
  124. \titleformat{\section}{\sffamily\bfseries\LARGE\color{col_section}}{\thesection.\ }{0em}{}
  125. \titleformat{\subsection}{\sffamily\bfseries\Large\color{col_subsection}}{\thesubsection.\ }{0em}{}
  126. \titleformat{\subsubsection}{\scshape\large\color{col_subsubsection}}{\thesubsubsection.\ }{0em}{}
  127. % ======================================================================
  128. % Lists & Equations
  129. % ======================================================================
  130. %\setlength{\itemsep}{\baselineskip}
  131. \setlength{\itemsep}{0pt}
  132. \RequirePackage{enumitem}
  133. \setitemize{itemsep=0pt}
  134. \setenumerate{itemsep=0pt}
  135. % ======================================================================
  136. % Float Environments
  137. % ======================================================================
  138. \RequirePackage{caption}
  139. % Idea: short caption (for LOF) in bold, rest of caption as normal text
  140. % Figures
  141. % ----------------------------------------------------------------------
  142. \RequirePackage{graphicx} % for different input formats
  143. \RequirePackage{pdfpages}
  144. %\RequirePackage{media9} % for flash and 3D Objects
  145. \RequirePackage[sf,SF]{subfigure} % Subfigures, sans-serif counters
  146. \makeatletter
  147. \renewcommand\p@subfigure{\thefigure}
  148. \renewcommand{\thefigure}{\@arabic\c@figure}
  149. \renewcommand{\thesubfigure}{\alph{subfigure})}
  150. \makeatother
  151. \captionsetup[figure]{labelfont={color=col_figure,sf},textfont={sf,small}}
  152. % ======================================================================
  153. % Macros
  154. % ======================================================================
  155. % Names
  156. \providecommand{\name}[1]{\mbox{\textsc{#1}}}
  157. \providecommand{\Prof}{Prof.~}
  158. \providecommand{\Dr}{Dr.~}
  159. \providecommand{\DiplIng}{Dipl.-Ing.~}
  160. \providecommand{\MSc}{M.~Sc.~}
  161. \providecommand{\habil}{habil.~}
  162. \providecommand{\PD}{PD~}
  163. % Abbreviations
  164. %\newcommand{\cf}{cf.\@\xspace}
  165. \newcommand{\ea}{\& al.\@\xspace}
  166. \newcommand{\eg}{e.\,g.\@\xspace}
  167. \newcommand{\etc}{etc.\@\xspace}
  168. \renewcommand{\iff}{if and only if\xspace}
  169. \newcommand{\ie}{i.\,e.\@\xspace}
  170. \newcommand{\wrt}{with respect to\xspace}
  171. \newcommand{\wlg}{without loss of generality\xspace}
  172. \newcommand{\Wlg}{Without loss of generality\xspace}
  173. % ======================================================================
  174. % Others
  175. % ======================================================================
  176. % References and Links
  177. % ----------------------------------------------------------------------
  178. \hypersetup{
  179. pdfcreator={LaTeX2e},
  180. pdfborder=0 0 0,
  181. breaklinks=true,
  182. bookmarksopen=true,
  183. bookmarksnumbered=true,
  184. linkcolor=col_link,
  185. urlcolor=col_link,
  186. citecolor=col_link,
  187. colorlinks=true
  188. }
  189. % backref style
  190. \renewcommand*{\backref}[1]{(cited on p. #1)}
  191. % Sourcecode listings
  192. % ----------------------------------------------------------------------
  193. \RequirePackage{listings}
  194. \lstset{
  195. basicstyle=\normalsize\tt\lst@ifdisplaystyle\small\fi,
  196. tabsize=4,
  197. %gobble=auto, % skip initial tabs %not supported yet
  198. numbers=none, % switch numbers on: left
  199. numberstyle=\tiny\sf\color{col_lst_number},
  200. numbersep=1em,
  201. keepspaces=true,
  202. keywordstyle=\color{tum_blue_dark},
  203. commentstyle=\color{col_lst_comment},
  204. stringstyle=\color{col_lst_string},
  205. captionpos = t,
  206. frame = tb,
  207. %framextopmargin={\smallskipamount},
  208. %framexbottommargin={\smallskipamount},
  209. framerule=1pt,
  210. rulecolor = \color{col_lst},
  211. }
  212. \captionsetup[lstlisting]{labelfont={color=col_figure,sf},textfont={sf,small}}
  213. % Inline code listings
  214. \let\code\lstinline
  215. \endinput