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.

168 lignes
3.6KB

  1. \ProvidesClass{sasbase}[2017/11/6 SaS base class]
  2. \LoadClass[twocolumn]{article}
  3. \RequirePackage[utf8]{inputenc}
  4. \RequirePackage{geometry}
  5. \RequirePackage{booktabs}
  6. \RequirePackage{mathptmx}
  7. \RequirePackage[12pt]{moresize}
  8. \RequirePackage{array}
  9. \RequirePackage{titlesec}
  10. \RequirePackage[titles]{tocloft}
  11. \RequirePackage[rm={lining,proportional},sf={lining, proportional},tt={lining, proportional, variable}]{cfr-lm}
  12. \RequirePackage[T1]{fontenc}
  13. \RequirePackage{indentfirst}
  14. \RequirePackage{fancyhdr}
  15. \RequirePackage{bm}
  16. \RequirePackage{roboto}
  17. % SET PAGE GEOMETRY
  18. \geometry{
  19. left=13mm,
  20. right=13mm,
  21. top=8mm,
  22. bottom=8mm,
  23. includeheadfoot}
  24. % ENABLE FANCY HEADERS
  25. \pagestyle{fancy}
  26. \fancyhf{}
  27. % DISABLE HEADER RULE
  28. \renewcommand{\headrulewidth}{0pt}
  29. % ADD PAGE NUMBER TO TOP RIGHT / LEFT (ODD / EVEN)
  30. \fancyhead[R]{\sffamily\bfseries\large{\textbf{\thepage}} \ifodd\value{page}\else\hfill\fi}
  31. % SET COLUMN GAP OF TWOCOLUMN LAYOUT
  32. \setlength{\columnsep}{6mm}
  33. % SET PLACE COMMAND
  34. \makeatletter
  35. \newcommand{\place}[1]{
  36. \def\@place{#1}
  37. }
  38. \makeatother
  39. % SET DATE COMMAND (COLLIDES WITH BUILTIN)
  40. \makeatletter
  41. \newcommand{\datum}[1]{
  42. \def\@datum{#1}
  43. }
  44. \makeatother
  45. % SET NUMBER COMMAND (COLLIDES WITH BUILTIN)
  46. \makeatletter
  47. \newcommand{\edition}[1]{
  48. \def\@edition{#1}
  49. }
  50. \makeatother
  51. % HELPER TO EXTRACT YEAR FROM DATE
  52. \newcommand*\TheLastWord[1]{\expandafter\xreverseit\expandafter{\expandafter}#1 \relax}
  53. \def\xreverseit#1#2 #3{%
  54. \ifx\relax#3%
  55. #2%
  56. \expandafter\xthree
  57. \fi
  58. \xreverseit{#1 #2}#3%
  59. }
  60. \def\xthree#1#2#3{}
  61. % ------------------
  62. % SECTION FORMATTING
  63. % ------------------
  64. \titleformat
  65. {\section}
  66. {\centering\normalfont\bf\large\ostyle}
  67. {\thesection}
  68. {1em}
  69. {}
  70. \titleformat
  71. {\subsection}
  72. {\centering\normalfont\bf}
  73. {\thesection}
  74. {1em}
  75. {}
  76. % -----------------
  77. % TABLE OF CONTENTS
  78. % -----------------
  79. % DISABLE BOLD
  80. \renewcommand{\cftsecfont}{\normalfont\ostyle}
  81. % ONLY SHOW SECTIONS IN TOC
  82. \setcounter{tocdepth}{1}
  83. % HIDE NUMBERING OF SECTIONS
  84. \setcounter{secnumdepth}{0}
  85. % DEFINE SPACING BETWEEN ITEMS
  86. \setlength{\cftbeforesecskip}{1mm}
  87. \setlength{\cftbeforetoctitleskip}{0mm}
  88. \setlength{\cftaftertoctitleskip}{5cm}
  89. % SET DOTS FOR SECTIONS
  90. \renewcommand{\cftsecdotsep}{\cftdotsep}
  91. % Redefinition of ToC command to remove heading
  92. \makeatletter
  93. \renewcommand\tableofcontents{%
  94. \vspace{-4mm}
  95. \@starttoc{toc}
  96. }
  97. \makeatother
  98. % CUSTOM TOC COMMAND
  99. \newcommand{\mycontents}{%
  100. \vspace{4mm}
  101. \ostyle
  102. \begin{tabular}{lp{.9\textwidth}}
  103. \textbf{Inhalt:} & \tableofcontents \\
  104. \end{tabular}
  105. }
  106. % ---------------------------------------
  107. % TITLE (THIS IS WHERE THE MAGIC HAPPENS)
  108. % ---------------------------------------
  109. % SET WIDTH OF RULES IN TABULAR
  110. \setlength{\arrayrulewidth}{.3mm}
  111. % SET CELL HEIGHT
  112. %\renewcommand{\arraystretch}{2.5}
  113. % DEFINE OWN COLUMN TYPE
  114. \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
  115. \newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
  116. \makeatletter
  117. \def\@maketitle{
  118. \vspace*{-10mm}
  119. \begin{center}
  120. \textbf{\ostyle{\HUGE{\@title}}}
  121. \end{center}
  122. \vspace{5mm}
  123. \begin{tabular}{M{\dimexpr.1\textwidth-2\tabcolsep}|M{\dimexpr.8\textwidth-2\tabcolsep}|M{\dimexpr.1\textwidth-2\tabcolsep}@{}m{0pt}@{}}
  124. \hline
  125. \large \ostyle{\TheLastWord{\@datum}} &
  126. \large \ostyle{Ausgegeben in {\@place} am {\@datum}} &
  127. \large \ostyle{Nr. {\@edition}}
  128. &\\[5mm] \hline
  129. \multicolumn{3}{m{\dimexpr\textwidth-2\tabcolsep}}{\mycontents} \\ \hline
  130. \end{tabular}
  131. \vspace{10mm}
  132. %\thispagestyle{fancy}
  133. }
  134. \makeatother
  135. \newcommand{\mytitle}{
  136. \maketitle
  137. \thispagestyle{fancy}
  138. }