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.

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