]> pere.pagekite.me Git - text-free-culture-lessig.git/blob - myclass.cls
Adjust dblatex chapter numbering to avoid one-off numbers.
[text-free-culture-lessig.git] / myclass.cls
1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesPackage{myclass}[]
3
4 %% Just use the original class and pass the options
5 \LoadClassWithOptions{scrreprt}
6 % report, book, memoir, scrreprt or scrbook ?
7
8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9 % Based on ideas from https://bugs.debian.org/684772
10 \usepackage{titlesec}
11 %
12 % Useless with unnumbered sections (e.g. use of \setcounter{secnumdepth}{0})
13 %
14 %
15 \newcommand\makeletterof[1]{%
16 \ifthenelse{\equal{#1}{1}}{EN}{%
17 \ifthenelse{\equal{#1}{2}}{TO}{%
18 \ifthenelse{\equal{#1}{3}}{TRE}{%
19 \ifthenelse{\equal{#1}{4}}{FIRE}{%
20 \ifthenelse{\equal{#1}{5}}{FEM}{%
21 \ifthenelse{\equal{#1}{6}}{SEKS}{%
22 \ifthenelse{\equal{#1}{7}}{SJU}{%
23 \ifthenelse{\equal{#1}{8}}{ÅTTE}{%
24 \ifthenelse{\equal{#1}{9}}{NI}{%
25 \ifthenelse{\equal{#1}{10}}{TI}{%
26 \ifthenelse{\equal{#1}{11}}{ELLEVE}{%
27 \ifthenelse{\equal{#1}{12}}{TOLV}{%
28 #1}}}}}}}}}}}}}
29
30 %% Redefines the headings
31 \titleformat{\chapter}[block]
32 {\filcenter\huge}{\filcenter\MakeUppercase{\chaptertitlename} \makeletterof{\thechapter}}{20pt}{\Huge}
33
34 \titleformat{\section}
35 {\filcenter\Large\bfseries}{\thesection}{1em}{}
36
37 \titleformat{\subsection}
38 {\filcenter\large\bfseries}{\thesubsection}{1em}{}
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%