summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/schulmathematik/schulma-komp.cls
blob: 994235e93a564e1bb74d3914f3818a299d18051a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
% schulmathematik bundle: document class schulma-komp
% Version 1.4
% 13. März 2023
\NeedsTeXFormat{LaTeX2e}
\ProvidesExplClass{schulma-komp}{2023-03-13}{1.4}{Dokumentenklasse fuer Kompetenzlisten}

\ProcessOptions \relax

\LoadClass {schulma-ab}

\dim_const:Nn \c_schulma_komp_abstand_dim {0.5em}
\dim_new:N \g_schulma_komp_einrueckunga_dim
\dim_new:N \g_schulma_komp_einrueckungb_dim

\hbox_set:Nn \l_tmpa_box {9}
\dim_gset:Nn \g_schulma_komp_einrueckunga_dim { \box_wd:N \l_tmpa_box }
\dim_gadd:Nn \g_schulma_komp_einrueckunga_dim {\c_schulma_komp_abstand_dim}

\hbox_set:Nn \l_tmpa_box {9.9}
\dim_gset:Nn \g_schulma_komp_einrueckungb_dim { \box_wd:N \l_tmpa_box }
\dim_gadd:Nn \g_schulma_komp_einrueckungb_dim {\c_schulma_komp_abstand_dim}
\dim_gadd:Nn \g_schulma_komp_einrueckungb_dim {\g_schulma_komp_einrueckunga_dim}

\renewcommand \labelenumi { ( \arabic {enumi} ) }

\cs_new:Npn \schulma_komp_listeneinstellung:
  {
    \setlist
      {
        leftmargin = 2cm,
        topsep = \medskipamount,
        itemsep = \smallskipamount
      }
  }

\NewDocumentCommand \Abschnitt {o m}
  {
    \IfValueTF {#1} { \setcounter {section} {#1} } { \stepcounter {section} }
    \arabic {section}
    \skip_horizontal:N \c_schulma_komp_abstand_dim
    #2
    \par
    \smallskip
  }

\NewDocumentCommand \Unterabschnitt {o m o}
  {
    \IfValueTF {#1} { \setcounter{subsection} {#1} } { \stepcounter{subsection} }
    \setcounter {subsubsection} {0}
    \skip_horizontal:N \g_schulma_komp_einrueckunga_dim
    \arabic {section} .
    \arabic {subsection}
    \skip_horizontal:N \c_schulma_komp_abstand_dim
    #2
    \IfValueT {#3}
      {
        \group_begin:
        \schulma_komp_listeneinstellung:
        \emph {#3}
        \group_end:
      }
    \par
    \smallskip
  }

\NewDocumentCommand \Unterunterabschnitt {o m m}
  {
    \par
    \IfValueTF {#1}
      {
        \setcounter {subsubsection} {#1}
      }
      {
        \stepcounter {subsubsection}
      }
    \skip_horizontal:N \g_schulma_komp_einrueckungb_dim
    \arabic {section} .
    \arabic {subsection} .
    \arabic {subsubsection}
    \skip_horizontal:N \c_schulma_komp_abstand_dim
    #2
    \group_begin:
    \schulma_komp_listeneinstellung:
    \emph {#3}
    \group_end:
    \par
    \smallskip
  }