Schule als Staat Projekt Web, Dokumente, etc.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

301 lignes
6.2KB

  1. \ProvidesClass{sasbase}[2017/11/6 SaS base class]
  2. \LoadClass[twocolumn]{article}
  3. \RequirePackage[utf8]{inputenc}
  4. \RequirePackage[shortlabels]{enumitem}
  5. \RequirePackage{environ}
  6. \RequirePackage{geometry}
  7. \RequirePackage{booktabs}
  8. \RequirePackage{mathptmx}
  9. \RequirePackage[12pt]{moresize}
  10. \RequirePackage{array}
  11. \RequirePackage{titlesec}
  12. \RequirePackage[titles]{tocloft}
  13. \RequirePackage[rm={lining,proportional},sf={lining, proportional},tt={lining, proportional, variable}]{cfr-lm}
  14. \RequirePackage[T1]{fontenc}
  15. \RequirePackage{indentfirst}
  16. \RequirePackage{fancyhdr}
  17. \RequirePackage{bm}
  18. \RequirePackage{roboto}
  19. \RequirePackage{varwidth}
  20. % SET PAGE GEOMETRY
  21. \geometry{
  22. left=13mm,
  23. right=13mm,
  24. top=8mm,
  25. bottom=8mm,
  26. includeheadfoot}
  27. % ENABLE FANCY HEADERS
  28. \pagestyle{fancy}
  29. \fancyhf{}
  30. % DISABLE HEADER RULE
  31. \renewcommand{\headrulewidth}{0pt}
  32. % ADD PAGE NUMBER TO TOP RIGHT / LEFT (ODD / EVEN)
  33. \fancyhead[R]{\sffamily\bfseries\large{\textbf{\thepage}} \ifodd\value{page}\else\hfill\fi}
  34. % SET COLUMN GAP OF TWOCOLUMN LAYOUT
  35. \setlength{\columnsep}{6mm}
  36. % SET PLACE COMMAND
  37. \makeatletter
  38. \newcommand{\place}[1]{
  39. \def\@place{#1}
  40. }
  41. \makeatother
  42. % SET DATE COMMAND (COLLIDES WITH BUILTIN)
  43. \makeatletter
  44. \newcommand{\datum}[1]{
  45. \def\@datum{#1}
  46. }
  47. \makeatother
  48. % SET NUMBER COMMAND (COLLIDES WITH BUILTIN)
  49. \makeatletter
  50. \newcommand{\edition}[1]{
  51. \def\@edition{#1}
  52. }
  53. \makeatother
  54. % HELPER TO EXTRACT YEAR FROM DATE
  55. \newcommand*\TheLastWord[1]{\expandafter\xreverseit\expandafter{\expandafter}#1 \relax}
  56. \def\xreverseit#1#2 #3{%
  57. \ifx\relax#3%
  58. #2%
  59. \expandafter\xthree
  60. \fi
  61. \xreverseit{#1 #2}#3%
  62. }
  63. \def\xthree#1#2#3{}
  64. % ------------------
  65. % SECTION FORMATTING
  66. % ------------------
  67. \titleformat
  68. {\section}
  69. {\centering\normalfont\bf\large\ostyle}
  70. {\thesection}
  71. {1em}
  72. {}
  73. \titleformat
  74. {\subsection}
  75. {\centering\normalfont\bf}
  76. {\thesubsection}
  77. {1em}
  78. {}
  79. \titleformat
  80. {\subsubsection}
  81. {\normalfont\bf}
  82. {\thesubsubsection}
  83. {1em}
  84. {}
  85. % -----------------
  86. % TABLE OF CONTENTS
  87. % -----------------
  88. % DISABLE BOLD
  89. \renewcommand{\cftsecfont}{\normalfont\ostyle}
  90. % ONLY SHOW SECTIONS IN TOC
  91. \setcounter{tocdepth}{1}
  92. % HIDE NUMBERING OF SECTIONS
  93. \setcounter{secnumdepth}{0}
  94. % DEFINE SPACING BETWEEN ITEMS
  95. \setlength{\cftbeforesecskip}{1mm}
  96. \setlength{\cftbeforetoctitleskip}{0mm}
  97. \setlength{\cftaftertoctitleskip}{5cm}
  98. % SET DOTS FOR SECTIONS
  99. \renewcommand{\cftsecdotsep}{\cftdotsep}
  100. % Redefinition of ToC command to remove heading
  101. \makeatletter
  102. \renewcommand\tableofcontents{%
  103. \vspace{-4mm}
  104. \@starttoc{toc}
  105. }
  106. \makeatother
  107. % CUSTOM TOC COMMAND
  108. \newcommand{\mycontents}{%
  109. \vspace{4mm}
  110. \ostyle
  111. \begin{tabular}{lp{.9\textwidth}}
  112. \textbf{Inhalt:} & \tableofcontents \\
  113. \end{tabular}
  114. }
  115. % ---------------------------------------
  116. % TITLE (THIS IS WHERE THE MAGIC HAPPENS)
  117. % ---------------------------------------
  118. % SET WIDTH OF RULES IN TABULAR
  119. \setlength{\arrayrulewidth}{.3mm}
  120. % SET CELL HEIGHT
  121. %\renewcommand{\arraystretch}{2.5}
  122. % DEFINE OWN COLUMN TYPE
  123. \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
  124. \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
  125. \makeatletter
  126. \def\@maketitle{
  127. \vspace*{-10mm}
  128. \begin{center}
  129. \textbf{\ostyle{\HUGE{\@title}}}
  130. \end{center}
  131. \vspace{5mm}
  132. \begin{tabular}{M{\dimexpr.1\textwidth-2\tabcolsep}|M{\dimexpr.8\textwidth-2\tabcolsep}|M{\dimexpr.1\textwidth-2\tabcolsep}@{}m{0pt}@{}}
  133. \hline
  134. \large \ostyle{\TheLastWord{\@datum}} &
  135. \large \ostyle{Ausgegeben in {\@place} am {\@datum}} &
  136. \large \ostyle{Nr. {\@edition}}
  137. &\\[5mm] \hline
  138. \multicolumn{3}{m{\dimexpr\textwidth-2\tabcolsep}}{\mycontents} \\ \hline
  139. \end{tabular}
  140. \vspace{10mm}
  141. %\thispagestyle{fancy}
  142. }
  143. \makeatother
  144. \newcommand{\mytitle}{
  145. \maketitle
  146. \thispagestyle{fancy}
  147. }
  148. % ---------------------------
  149. % DEFINITION OF USEFUL MACROS
  150. % ---------------------------
  151. % OPTION TO ENABLE SQUARE BRACKETS OR ADDITIONS TO THE ARTICLES NAME
  152. \newif\ifsquare\squarefalse
  153. \newcommand{\squarestyle}{\squaretrue}
  154. \newcommand{\parensstyle}{\squarefalse}
  155. % ARTICLE COUNTER
  156. \newcounter{articleno}
  157. \setcounter{articleno}{1}
  158. \makeatletter
  159. \newenvironment{article}[1][nil]{
  160. \begin{@paraorarticle}{#1}{Artikel}
  161. }
  162. {
  163. \end{@paraorarticle}
  164. }
  165. \makeatother
  166. \makeatletter
  167. \newenvironment{lawparagraph}[1][nil]{
  168. \begin{@paraorarticle}{#1}{§}
  169. }
  170. {
  171. \end{@paraorarticle}
  172. }
  173. \makeatother
  174. \makeatletter
  175. % A GENERAL ARTICLE, PARAGRAPH, etc. ENVIRONMENT
  176. \newenvironment{@paraorarticle}[2]{
  177. \def\val{#1}
  178. \def\null{nil}
  179. \ifsquare
  180. \subsubsection{#2 {\thearticleno}}
  181. \ifx\val\null
  182. \else
  183. \vspace*{-2mm}
  184. \noindent\bracketed{\textbf{#1}}
  185. \fi
  186. \else
  187. \subsubsection{#2 {\thearticleno} \ifx\val\null\else(#1)\fi}
  188. \fi
  189. \stepcounter{articleno}
  190. \begin{enumerate}[(1)]
  191. }
  192. {
  193. \end{enumerate}
  194. }
  195. \makeatother
  196. % LAW COMMAND
  197. \newcommand{\law}[1]{
  198. \section{#1}
  199. \setcounter{articleno}{1}
  200. }
  201. % JUST TO MAKE CLEAR WHICH LEVEL TO USE
  202. \newcommand{\segmentoflaw}[1]{\subsection{#1}}
  203. % TEXT IN SQUARE BRACKETS
  204. \newcommand{\bracketed}[1]{$\left[\varwidth{\linewidth}#1\endvarwidth\right]$}
  205. % INCREASE HEIGHT OF BRACKETS
  206. \setlength\delimitershortfall{-2pt}
  207. % ---
  208. % FAQ
  209. % ---
  210. \newcommand{\topic}[1]{\subsection{#1}}
  211. % QUESTION ENVIRONMENT
  212. \newenvironment{question}[1]{
  213. \subsubsection{Q: #1}
  214. \noindent\textbf{A:}
  215. }
  216. {
  217. }
  218. % ----------
  219. % WIRTSCHAFT
  220. % ----------
  221. \newcounter{total}
  222. \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
  223. \newenvironment{kostenrechnung}[0]{
  224. \setcounter{total}{0}
  225. \begin{tabular}{p{2cm}p{4.5cm}p{8.5cm}R{2cm}}
  226. \toprule
  227. Posten & Berechnung & Kommentar & Kosten in €\\
  228. \midrule
  229. }
  230. {
  231. \bottomrule
  232. Gesamt & & & \thetotal \\
  233. \bottomrule
  234. \end{tabular}
  235. }
  236. \newenvironment{lohnrechnung}[0]{
  237. \setcounter{total}{0}
  238. \begin{tabular}{p{8cm}p{3.5cm}p{3.5cm}R{2cm}}
  239. \toprule
  240. Stelle & Anzahl & Lohn pro Tag & Gesamt in €\\
  241. \midrule
  242. }
  243. {
  244. \bottomrule
  245. Gesamt & & & \thetotal \\
  246. \bottomrule
  247. \end{tabular}
  248. }
  249. \newcommand{\posten}[4]{\addtocounter{total}{#4} #1 & #2 & \textit{#3} & { \raggedleft #4 } \\}