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_sheet.cls 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. %
  2. % Layout, Macros for LaTeX4EI
  3. %
  4. % Authors: Emanuel Regnath, Martin Zellner
  5. % Contact: info@latex4ei.de
  6. % Version: 1.1
  7. % License: CC-BY-NC-SA
  8. %
  9. % © 2011-2019, LaTeX4EI
  10. \NeedsTeXFormat{LaTeX2e}
  11. \ProvidesClass{latex4ei_sheet}[2014/03/30 Cheet Sheet Template from LaTeX4EI]
  12. % ======================================================================
  13. % Options
  14. % ======================================================================
  15. % forward options to latex4ei package
  16. % ----------------------------------------------------------------------
  17. \newif\ifcolor\colortrue
  18. \DeclareOption{color}{\colortrue\PassOptionsToPackage{color}{latex4ei}}
  19. \DeclareOption{nocolor}{\colorfalse\PassOptionsToPackage{nocolor}{latex4ei}}
  20. \DeclareOption{german}{\colorfalse\PassOptionsToPackage{german}{latex4ei}}
  21. \DeclareOption{english}{\colorfalse\PassOptionsToPackage{english}{latex4ei}}
  22. % make three column design possible
  23. % ----------------------------------------------------------------------
  24. \newcounter{columnnumber}
  25. \setcounter{columnnumber}{3}
  26. \DeclareOption{threecolumn}{\setcounter{columnnumber}{3}}
  27. % mobile version
  28. % ----------------------------------------------------------------------
  29. \newif\ifmobile\mobilefalse
  30. \DeclareOption{mobile}{\mobiletrue\setcounter{columnnumber}{0}}
  31. % defaults
  32. % ----------------------------------------------------------------------
  33. % define baseclass
  34. \def\baseclass{scrartcl}
  35. % set default options for base class
  36. \PassOptionsToClass{6pt, a4paper, landscape}{\baseclass}
  37. % forward unknown options to class
  38. % ----------------------------------------------------------------------
  39. \DeclareOption*{%
  40. \PassOptionsToClass{\CurrentOption}{\baseclass}%
  41. }
  42. % process options
  43. % ----------------------------------------------------------------------
  44. \ProcessOptions\relax
  45. % load baseclass
  46. \LoadClass{\baseclass}
  47. % ======================================================================
  48. % Packages
  49. % ======================================================================
  50. % load latex4ei packages
  51. \RequirePackage{latex4ei/scientific} % scientific macros for LaTeX4EI
  52. \RequirePackage{latex4ei/latex4ei} % base definitions for LaTeX4EI
  53. \RequirePackage{latex4ei/latex4ei_boxes} % section boxes
  54. % ======================================================================
  55. % Layout
  56. % ======================================================================
  57. % Geometry
  58. % ----------------------------------------------------------------------
  59. \RequirePackage{geometry}
  60. \geometry{a4paper,landscape, left=6mm,right=6mm, top=6mm, bottom=5mm,includefoot, footskip=1.7em}
  61. % Multicolumn
  62. % ----------------------------------------------------------------------
  63. \ifmobile\else
  64. \RequirePackage{multicol} % for columns
  65. % start multicolumn
  66. \AtBeginDocument{
  67. \begin{multicols*}{\value{columnnumber}}
  68. }
  69. \AtEndDocument{
  70. \label{LastPage}
  71. \end{multicols*}
  72. }
  73. \fi
  74. % Header and Footer
  75. % ----------------------------------------------------------------------
  76. \RequirePackage{fancyhdr}
  77. \pagestyle{fancy}
  78. \fancyhf{}
  79. \AtBeginDocument{
  80. \fancyfoot[C]{\EngGer{from}{von} \theauthor\ -- Mail: \email{\theemail}}
  81. }
  82. \renewcommand{\headrulewidth}{0.0pt} %obere Linie ausblenden
  83. \renewcommand{\footrulewidth}{0.1pt} %obere Linie ausblenden
  84. \fancyfoot[R]{\EngGer{Last revised}{Stand}: \themydate \qquad \thepage/\pageref{LastPage}}
  85. \fancyfoot[L]{Homepage: \url{\thewebsite} -- \EngGer{Please report mistakes \emph{immediately}}{Fehler bitte \emph{sofort} melden}.}
  86. % Title
  87. % ----------------------------------------------------------------------
  88. \providecommand{\fstitle}[1]{
  89. \vspace{-20mm}{
  90. \parbox{2.3cm}{
  91. \includegraphics[height=1.4cm]{Logo.pdf}
  92. }
  93. \parbox{4cm}{
  94. \huge\textbf{#1}
  95. }}
  96. }
  97. \renewcommand{\maketitle}{\fstitle{\thetitle}}
  98. % Chapters and Sections
  99. % ----------------------------------------------------------------------
  100. \RequirePackage{titlesec}
  101. %\titleformat{ command }[ shape ]{ format }{ label }{ sep }{ before-code }[ after-code ]
  102. %\titlespacing*{ command }{ left }{ beforesep }{ aftersep }[ right ]
  103. \makeatletter
  104. \@addtoreset{section}{part}
  105. \makeatother
  106. \titleformat{\part}{\pagebreak\huge \bfseries}{}{0em}{\huge \bfseries}
  107. %\providecommand{\chapter}[1]{\vspace{0.5em}\noindent\textbf{\huge{#1}}\vspace{0.5em}}
  108. %\titleformat{\chapter}{\huge \bfseries}{\thechapter}{0em}{\huge \bfseries}
  109. \titleformat{\section}{\Large\bfseries\color{col_section}}{\thesection .}{0.5em}{\color{col_section}}%[\color{col_section} \hrule \hrule]
  110. \titleformat{\subsection}{\large\bfseries\color{col_subsection}}{\thesubsection .}{0.3em}{}
  111. \titleformat{\subsubsection}{\bfseries\color{col_subsubsection}}{\thesubsubsection .}{0.2em}{}
  112. \titleformat{\paragraph}{\bfseries\color{col_paragraph}}{\theparagraph .}{0.2em}{}
  113. %\titlespacing{Überschriftart}{keine Ahnung}{Abstand oberhalb}{Abstand unterhalb}
  114. \titlespacing{\section}{0em}{1.0em}{0.1em}
  115. \titlespacing{\subsection}{0em}{0.2em}{-0.2em}
  116. \titlespacing{\subsubsection}{0em}{0em}{-0.3em}
  117. \titlespacing{\paragraph}{0em}{0em}{-0.3em}
  118. % Paragraphs
  119. % ----------------------------------------------------------------------
  120. \RequirePackage{parskip} % prevents intend on new paragraph
  121. \setlength{\parskip}{1pt}
  122. % Font Settings
  123. % ----------------------------------------------------------------------
  124. % set sans as default font family
  125. \renewcommand{\familydefault}{\sfdefault}
  126. % stretch linespace in arrays and tables
  127. \renewcommand{\arraystretch}{1.2}
  128. % ======================================================================
  129. % Environments
  130. % ======================================================================
  131. \setlength{\itemindent}{0em}
  132. \setlength\leftmargini{1.7em}
  133. \setlength\itemsep{0em}
  134. % ======================================================================
  135. % Other
  136. % ======================================================================
  137. % SI-Units Settings
  138. % ----------------------------------------------------------------------
  139. \sisetup{per-mode=fraction}
  140. \sisetup{sticky-per=true}
  141. \AtBeginDocument{\sisetup{math-rm=\mathrm, text-rm=\rmfamily}}
  142. % ======================================================================
  143. % Color Scheme
  144. % ======================================================================
  145. \ifcolor
  146. \colorlet{col_section}{tum_blue_dark}
  147. \colorlet{col_subsection}{black}
  148. \colorlet{col_subsubsection}{black}
  149. \colorlet{col_sectionbox}{gray}
  150. \colorlet{col_emphbox}{tum_red}
  151. \colorlet{col_topicbox}{tum_blue_dark}
  152. \colorlet{col_symbolbox}{tum_orange}
  153. \colorlet{col_cookbox}{tum_blue_dark}
  154. \colorlet{col_table}{tum_blue_dark}
  155. \else
  156. \colorlet{col_section}{black}
  157. \colorlet{col_subsection}{black}
  158. \colorlet{col_subsubsection}{black}
  159. \colorlet{col_sectionbox}{gray}
  160. \colorlet{col_emphbox}{black}
  161. \colorlet{col_topicbox}{black}
  162. \colorlet{col_symbolbox}{black}
  163. \colorlet{col_cookbox}{black}
  164. \colorlet{col_table}{black}
  165. \fi
  166. % Color for listings
  167. \lstset{
  168. backgroundcolor=\color{col_lst!5},
  169. }
  170. % ======================================================================
  171. % Mobile Version
  172. % ======================================================================
  173. \ifmobile
  174. \geometry{
  175. paperwidth=7.3cm,
  176. paperheight=20cm,
  177. portrait,
  178. left=1em,right=1em, top=1em, bottom=1em,
  179. noheadfoot, footskip=0em
  180. }
  181. % title
  182. \renewcommand{\maketitle}{
  183. \fstitle{\thetitle}
  184. \setcounter{tocdepth}{2}
  185. \tableofcontents
  186. \pagebreak
  187. }
  188. \pagestyle{empty}
  189. \newcommand{\columnbreak}{\relax}
  190. \fi