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 \refstepcounter{chapter}
18 \ifnum \c@secnumdepth >\z@
19 \ifnum \value{part} >\z@
20 \addcontentsline{toc}{part}{\numberline{\thechapter}\hspace{-1em}\indexname}
22 \addcontentsline{toc}{chapter}{\numberline{\thechapter}\indexname}
25 \addcontentsline{toc}{chapter}{\indexname}
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 % Based on ideas from https://bugs.debian.org/684772
38 % Useless with unnumbered sections (e.g. use of \setcounter{secnumdepth}{0})
41 \newcommand\makeletterof[1]{%
42 \ifthenelse{\equal{#1}{1}}{EN}{%
43 \ifthenelse{\equal{#1}{2}}{TO}{%
44 \ifthenelse{\equal{#1}{3}}{TRE}{%
45 \ifthenelse{\equal{#1}{4}}{FIRE}{%
46 \ifthenelse{\equal{#1}{5}}{FEM}{%
47 \ifthenelse{\equal{#1}{6}}{SEKS}{%
48 \ifthenelse{\equal{#1}{7}}{SJU}{%
49 \ifthenelse{\equal{#1}{8}}{ÅTTE}{%
50 \ifthenelse{\equal{#1}{9}}{NI}{%
51 \ifthenelse{\equal{#1}{10}}{TI}{%
52 \ifthenelse{\equal{#1}{11}}{ELLEVE}{%
53 \ifthenelse{\equal{#1}{12}}{TOLV}{%
56 % Make TOC entries without label
57 \titlecontents{chapter} %
59 {\addvspace{1em plus 0pt}\bfseries} %
60 {\hspace{-1.3em}} % no number, remove room reserved for it
62 {\hfill \contentspage} % dots and page number
65 \dottedcontents{section} %
69 {0.75em} % space between dots
73 %% Redefines the headings to remove the chapter label
74 \titleformat{\chapter}[block]
75 {\filcenter\huge}{\filcenter}{20pt}{\Huge}
77 \titleformat{\section}
78 {\filcenter\Large\bfseries}{\thesection}{1em}{}
80 \titleformat{\subsection}
81 {\filcenter\large\bfseries}{\thesubsection}{1em}{}
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 % https://amyrhoda.wordpress.com/2012/06/04/latex-to-lulu-the-making-of-aosa-other-useful-packages-and-settings/
87 % The microtype package provides the ability to micromanage your
88 % typography. When invoked without any options it does some nice things
89 % like protruding punctuation over the edge of the right margin to make
90 % the margin appear smoother. Basically it makes your book look more
91 % professional with very little effort. It also has a ton of options if
92 % you want to micromanage even more.
93 \usepackage{microtype}
95 % By dafault, LaTeX will try and make all your pages the length that
96 % you set using the geometry setting. If a page has images, tables,
97 % headings or paragraph breaks which make it shorter than that page
98 % length, LaTeX will pad the page by adding whitespace between
99 % elements. We thought that looked sillier than having pages be
100 % different lengths, so we used the raggedbottom command.
103 % Hint for figure with empty title: remove the colon label separator
105 \captionsetup[figure]{labelsep=none}