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