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.

224 lignes
4.9KB

  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. % AN ARTICLE (LAW) ENVIRONMENT
  160. \newenvironment{article}[1][nil]{
  161. \def\val{#1}
  162. \def\null{nil}
  163. \ifsquare
  164. \subsubsection{Artikel {\thearticleno}}
  165. \ifx\val\null
  166. \else
  167. \vspace*{-2mm}
  168. \noindent\bracketed{\textbf{#1}}
  169. \fi
  170. \else
  171. \subsubsection{Artikel {\thearticleno} \ifx\val\null\else(#1)\fi}
  172. \fi
  173. \stepcounter{articleno}
  174. \begin{enumerate}[(1)]
  175. }
  176. {
  177. \end{enumerate}
  178. }
  179. \makeatother
  180. % JUST TO MAKE CLEAR WHICH LEVEL TO USE
  181. \newcommand{\segmentoflaw}[1]{\subsection{#1}}
  182. % TEXT IN SQUARE BRACKETS
  183. \newcommand{\bracketed}[1]{$\left[\varwidth{\linewidth}#1\endvarwidth\right]$}
  184. % INCREASE HEIGHT OF BRACKETS
  185. \setlength\delimitershortfall{-2pt}