1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesPackage{myclass}[]
4 %% Just use the original class and pass the options
5 \LoadClassWithOptions{report}
6 % report, book, memoir, scrreprt or scrbook ?
8 % Put the index in the TOC
10 \let\stdindex=\theindex
11 \let\endstdindex=\endtheindex
12 \renewenvironment{theindex}{
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}
21 \addcontentsline{toc}{chapter}{\numberline{\thechapter}\indexname}
24 \addcontentsline{toc}{chapter}{\indexname}
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33 % Based on ideas from https://bugs.debian.org/684772
37 % Useless with unnumbered sections (e.g. use of \setcounter{secnumdepth}{0})
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}{%
55 % Make TOC entries without label
56 \titlecontents{chapter} %
58 {\addvspace{1em plus 0pt}\bfseries} %
59 {\hspace{-1.3em}} % no number, remove room reserved for it
61 {\hfill \contentspage} % dots and page number
64 \dottedcontents{section} %
68 {0.75em} % space between dots
72 %% Redefines the headings to remove the chapter label
73 \titleformat{\chapter}[block]
74 {\filcenter\huge}{\filcenter}{20pt}{\Huge}
76 \titleformat{\section}
77 {\filcenter\Large\bfseries}{\thesection}{1em}{}
79 \titleformat{\subsection}
80 {\filcenter\large\bfseries}{\thesubsection}{1em}{}
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 % https://amyrhoda.wordpress.com/2012/06/04/latex-to-lulu-the-making-of-aosa-other-useful-packages-and-settings/
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}
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.
102 % Hint for figure with empty title: remove the colon label separator
104 \captionsetup[figure]{labelsep=none}