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 % Fix the page number reset done by abstract by redefining it
10 \let\stdsetcounter\setcounter
11 \let\stdabstract=\abstract
12 \let\endstdabstract=\endabstract
13 \renewenvironment{abstract}{%
14 \let\setcounter\nocount%
17 \setlength\parskip{\medskipamount}%
18 \setlength\parindent{0pt}%
21 \let\setcounter\stdsetcounter
24 % Put the index in the TOC
26 \let\stdindex=\theindex
27 \let\endstdindex=\endtheindex
28 \renewenvironment{theindex}{
30 \@ifundefined{chapter}{}{
31 % To not have the number, replace by:
32 % \addcontentsline{toc}{chapter}{\numberline{}\indexname}
33 \refstepcounter{chapter}
34 \ifnum \c@secnumdepth >\z@
35 \ifnum \value{part} >\z@
36 \addcontentsline{toc}{part}{\numberline{\thechapter}\hspace{-1em}\indexname}
38 \addcontentsline{toc}{chapter}{\numberline{\thechapter}\indexname}
41 \addcontentsline{toc}{chapter}{\indexname}
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 % Based on ideas from https://bugs.debian.org/684772
54 % Useless with unnumbered sections (e.g. use of \setcounter{secnumdepth}{0})
57 \newcommand\makeletterof[1]{%
58 \ifthenelse{\equal{#1}{1}}{EN}{%
59 \ifthenelse{\equal{#1}{2}}{TO}{%
60 \ifthenelse{\equal{#1}{3}}{TRE}{%
61 \ifthenelse{\equal{#1}{4}}{FIRE}{%
62 \ifthenelse{\equal{#1}{5}}{FEM}{%
63 \ifthenelse{\equal{#1}{6}}{SEKS}{%
64 \ifthenelse{\equal{#1}{7}}{SJU}{%
65 \ifthenelse{\equal{#1}{8}}{ÅTTE}{%
66 \ifthenelse{\equal{#1}{9}}{NI}{%
67 \ifthenelse{\equal{#1}{10}}{TI}{%
68 \ifthenelse{\equal{#1}{11}}{ELLEVE}{%
69 \ifthenelse{\equal{#1}{12}}{TOLV}{%
72 % Make TOC entries without label
73 \titlecontents{chapter} %
75 {\addvspace{1em plus 0pt}\bfseries} %
76 {\hspace{-1.3em}} % no number, remove room reserved for it
78 {\hfill \contentspage} % dots and page number
81 \dottedcontents{section} %
85 {0.75em} % space between dots
89 %% Redefines the headings to remove the chapter label
90 \titleformat{\chapter}[block]
91 {\filcenter\huge}{\filcenter}{20pt}{\Huge}
93 \titleformat{\section}
94 {\filcenter\Large\bfseries}{\thesection}{1em}{}
96 \titleformat{\subsection}
97 {\filcenter\large\bfseries}{\thesubsection}{1em}{}
98 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101 % https://amyrhoda.wordpress.com/2012/06/04/latex-to-lulu-the-making-of-aosa-other-useful-packages-and-settings/
103 % The microtype package provides the ability to micromanage your
104 % typography. When invoked without any options it does some nice things
105 % like protruding punctuation over the edge of the right margin to make
106 % the margin appear smoother. Basically it makes your book look more
107 % professional with very little effort. It also has a ton of options if
108 % you want to micromanage even more.
109 \usepackage{microtype}
111 % By dafault, LaTeX will try and make all your pages the length that
112 % you set using the geometry setting. If a page has images, tables,
113 % headings or paragraph breaks which make it shorter than that page
114 % length, LaTeX will pad the page by adding whitespace between
115 % elements. We thought that looked sillier than having pages be
116 % different lengths, so we used the raggedbottom command.
119 % Hint for figure with empty title: remove the colon label separator
121 \captionsetup[figure]{labelsep=none}