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 % Divide by 2 the index item indentation (10pt -> 5pt)
26 \renewcommand\@idxitem{\par\hangindent 20\p@}
27 \renewcommand\subitem{\@idxitem \hspace*{10\p@}}
28 \renewcommand\subsubitem{\@idxitem \hspace*{15\p@}}
31 % Put the index in the TOC
33 \let\stdindex=\theindex
34 \let\endstdindex=\endtheindex
35 \renewenvironment{theindex}{
37 % Use a smaller font except for the letter heading which is bold
38 \newfontfamily\indexfont[Scale=0.7,
39 BoldFeatures={Scale=1}]{Crimson Text}
40 \@ifundefined{chapter}{}{
41 % To not have the number, replace by:
42 % \addcontentsline{toc}{chapter}{\numberline{}\indexname}
43 \refstepcounter{chapter}
44 \ifnum \c@secnumdepth >\z@
45 \ifnum \value{part} >\z@
46 \addcontentsline{toc}{part}{\numberline{\thechapter}\hspace{-1em}\indexname}
48 \addcontentsline{toc}{chapter}{\numberline{\thechapter}\indexname}
51 \addcontentsline{toc}{chapter}{\indexname}
54 % Adapt the vertical sizes to the smaller font
55 \setlength{\baselineskip}{0.7\baselineskip}%
56 \setlength{\parskip}{0.2\baselineskip}%
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 % Based on ideas from https://bugs.debian.org/684772
68 % Useless with unnumbered sections (e.g. use of \setcounter{secnumdepth}{0})
71 \newcommand\makeletterof[1]{%
72 \ifthenelse{\equal{#1}{1}}{EN}{%
73 \ifthenelse{\equal{#1}{2}}{TO}{%
74 \ifthenelse{\equal{#1}{3}}{TRE}{%
75 \ifthenelse{\equal{#1}{4}}{FIRE}{%
76 \ifthenelse{\equal{#1}{5}}{FEM}{%
77 \ifthenelse{\equal{#1}{6}}{SEKS}{%
78 \ifthenelse{\equal{#1}{7}}{SJU}{%
79 \ifthenelse{\equal{#1}{8}}{ÅTTE}{%
80 \ifthenelse{\equal{#1}{9}}{NI}{%
81 \ifthenelse{\equal{#1}{10}}{TI}{%
82 \ifthenelse{\equal{#1}{11}}{ELLEVE}{%
83 \ifthenelse{\equal{#1}{12}}{TOLV}{%
86 % Make TOC entries without label
87 \titlecontents{chapter} %
89 {\addvspace{1em plus 0pt}\bfseries} %
90 {\hspace{-1.3em}} % no number, remove room reserved for it
92 {\hfill \contentspage} % dots and page number
95 \dottedcontents{section} %
99 {0.75em} % space between dots
103 %% Redefines the headings to remove the chapter label
104 \titleformat{\chapter}[block]
105 {\filcenter\huge}{\filcenter}{20pt}{\Huge}
107 \titleformat{\section}
108 {\filcenter\Large\bfseries}{\thesection}{1em}{}
110 \titleformat{\subsection}
111 {\filcenter\large\bfseries}{\thesubsection}{1em}{}
112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115 % https://amyrhoda.wordpress.com/2012/06/04/latex-to-lulu-the-making-of-aosa-other-useful-packages-and-settings/
117 % The microtype package provides the ability to micromanage your
118 % typography. When invoked without any options it does some nice things
119 % like protruding punctuation over the edge of the right margin to make
120 % the margin appear smoother. Basically it makes your book look more
121 % professional with very little effort. It also has a ton of options if
122 % you want to micromanage even more.
123 \usepackage{microtype}
125 % By dafault, LaTeX will try and make all your pages the length that
126 % you set using the geometry setting. If a page has images, tables,
127 % headings or paragraph breaks which make it shorter than that page
128 % length, LaTeX will pad the page by adding whitespace between
129 % elements. We thought that looked sillier than having pages be
130 % different lengths, so we used the raggedbottom command.
133 % Hint for figure with empty title: remove the colon label separator
135 \captionsetup[figure]{labelsep=none}