]> pere.pagekite.me Git - text-free-culture-lessig.git/blob - myclass.cls
Generated.
[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{report}
6 % report, book, memoir, scrreprt or scrbook ?
7
8 % Put the index in the TOC
9 \makeatletter
10 \let\stdindex=\theindex
11 \let\endstdindex=\endtheindex
12 \renewenvironment{theindex}{
13 \begin{stdindex}
14 \@ifundefined{chapter}{}{
15 % To not have the number, replace by:
16 % \addcontentsline{toc}{chapter}{\numberline{}\indexname}
17 \ifnum \c@secnumdepth >\z@
18 \ifnum \value{part} >\z@
19 \addcontentsline{toc}{part}{\numberline{\thechapter}\hspace{-1em}\indexname}
20 \else
21 \addcontentsline{toc}{chapter}{\numberline{\thechapter}\indexname}
22 \fi
23 \else
24 \addcontentsline{toc}{chapter}{\indexname}
25 \fi
26 }
27 }{
28 \end{stdindex}
29 }
30 \makeatother
31
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33 % Based on ideas from https://bugs.debian.org/684772
34 \usepackage{titlesec}
35 \usepackage{titletoc}
36 %
37 % Useless with unnumbered sections (e.g. use of \setcounter{secnumdepth}{0})
38 %
39 %
40 \newcommand\makeletterof[1]{%
41 \ifthenelse{\equal{#1}{1}}{EN}{%
42 \ifthenelse{\equal{#1}{2}}{TO}{%
43 \ifthenelse{\equal{#1}{3}}{TRE}{%
44 \ifthenelse{\equal{#1}{4}}{FIRE}{%
45 \ifthenelse{\equal{#1}{5}}{FEM}{%
46 \ifthenelse{\equal{#1}{6}}{SEKS}{%
47 \ifthenelse{\equal{#1}{7}}{SJU}{%
48 \ifthenelse{\equal{#1}{8}}{ÅTTE}{%
49 \ifthenelse{\equal{#1}{9}}{NI}{%
50 \ifthenelse{\equal{#1}{10}}{TI}{%
51 \ifthenelse{\equal{#1}{11}}{ELLEVE}{%
52 \ifthenelse{\equal{#1}{12}}{TOLV}{%
53 #1}}}}}}}}}}}}}
54
55 % Make TOC entries without label
56 \titlecontents{chapter} %
57 [1.5em] %
58 {\addvspace{1em plus 0pt}\bfseries} %
59 {\hspace{-1.3em}} % no number, remove room reserved for it
60 {\hspace{-1.3em}} %
61 {\hfill \contentspage} % dots and page number
62 [\addvspace {0pt}]
63
64 \dottedcontents{section} %
65 [0em] % was (3.8)
66 {\addvspace{0pt}} %
67 {2.3em} % tab
68 {0.75em} % space between dots
69 [\addvspace{0pt}]
70
71
72 %% Redefines the headings to remove the chapter label
73 \titleformat{\chapter}[block]
74 {\filcenter\huge}{\filcenter}{20pt}{\Huge}
75
76 \titleformat{\section}
77 {\filcenter\Large\bfseries}{\thesection}{1em}{}
78
79 \titleformat{\subsection}
80 {\filcenter\large\bfseries}{\thesubsection}{1em}{}
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82
83 % From
84 % https://amyrhoda.wordpress.com/2012/06/04/latex-to-lulu-the-making-of-aosa-other-useful-packages-and-settings/
85
86 % The microtype package provides the ability to micromanage your
87 % typography. When invoked without any options it does some nice things
88 % like protruding punctuation over the edge of the right margin to make
89 % the margin appear smoother. Basically it makes your book look more
90 % professional with very little effort. It also has a ton of options if
91 % you want to micromanage even more.
92 \usepackage{microtype}
93
94 % By dafault, LaTeX will try and make all your pages the length that
95 % you set using the geometry setting. If a page has images, tables,
96 % headings or paragraph breaks which make it shorter than that page
97 % length, LaTeX will pad the page by adding whitespace between
98 % elements. We thought that looked sillier than having pages be
99 % different lengths, so we used the raggedbottom command.
100 \raggedbottom
101
102 % Hint for figure with empty title: remove the colon label separator
103 \usepackage{caption}
104 \captionsetup[figure]{labelsep=none}