]> pere.pagekite.me Git - text-madewithcc.git/blob - myclass.cls
Translated using Weblate (Norwegian Bokmål)
[text-madewithcc.git] / myclass.cls
1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesPackage{myclass}[]
3
4 %% Just use the original class and pass the options
5 \LoadClassWithOptions{report}
6
7 % Place page number at the outer foot edge of content pages
8 \usepackage[pagestyles]{titlesec}
9 \newpagestyle{mystyle}{\setfoot[\thepage][][]{}{}{\thepage}}
10 \pagestyle{mystyle}
11
12 \renewcommand{\baselinestretch}{1.2}
13 \newcommand{\beforetitle}{}
14 \newcommand{\publisherlogos}{}
15
16 \makeatletter
17
18 \usepackage{hyphenat}
19 %
20 % Customize the titlepage: remove the date, place the publisher name, and
21 % load a specific file for the verso page, containing some legal notices
22 %
23 \def\maketitle{%
24 \titlerecto%
25 \titleverso}
26
27 \def\titlerecto{\begin{titlepage}%
28 \beforetitle
29 \null\vfil
30 \thispagestyle{empty}
31 \vskip 160\p@
32 \begin{center}%
33 {\LARGE \@title \par}%
34 \vskip 3em%
35 {\Large
36 \lineskip .75em%
37 \begin{tabular}[t]{c}%
38 \@author
39 \end{tabular}\par}%
40 \vskip 20em%
41 {\large \DBKpublishername \par}
42 \vskip .75em%
43 {\large \DBKpublisheraddress \par}%
44 \publisherlogos
45 \end{center}\par
46 \vfil\null
47 \end{titlepage}}%
48
49 \def\titleverso{%
50 \def\titlepagefile{titlepg.input.tex}
51 \IfFileExists{\titlepagefile}{\input{\titlepagefile}}{}
52 }%
53
54 % Allow line break on hyphen (-) in URLs, to make sure long URLs in
55 % footnotes do not pass out of the margins.
56 \usepackage[hyphens]{url}
57
58 \newenvironment{colophon}{
59 \pagebreak %
60 % FIXME change when page size changes, use {x}{x*1.2}
61
62 % Note, these numbers are not correct any more for the sizes mentioned:
63 % \fontsize{6.5}{7.8}\selectfont % fits in one 4.25x6.875" pocket size page
64 % \fontsize{7.5}{9}\selectfont % fits in one 5.06x7.71" size page
65 % \fontsize{9.1}{10.92}\selectfont % fits in one 5.5x8.5" digest size page
66
67 \fontsize{8.2}{9.84}\selectfont % fits in one 6x9'' size page
68 \setlength{\parskip}{0.5em} %
69 \setlength{\parindent}{0pt} %
70 }{}
71
72 \usepackage{titlesec}
73 \titleformat{\chapter}{\huge}{\thechapter.}{20pt}{\hyphenpenalty=10000 \Huge}
74 \titleformat{\section}{\Large}{\thesection}{1em}{}
75 \titleformat{\subsection}{\large}{\thesubsection}{1em}{}
76 %% \titleformat{\paragraph}{\normalsize}{\theparagraph}{1em}{}
77 %% \titleformat{\subparagraph}{\normalsize}{\thesubparagraph}{1em}{}
78
79 \usepackage{titletoc}
80
81 % indented subsection (in toc)
82 \titlecontents{part}
83 [0.0cm] % left margin
84 {\vskip 0.5em} % above code
85 {% % numbered format
86 {\Large\thecontentslabel\quad}%
87 }%
88 {\Large} % unnumbered format
89 {\hfill \contentspage \vskip 0.2em} % filler-page-format, e.g dots
90
91
92 % indented subsection (in toc)
93 \titlecontents{chapter}
94 [0.0cm] % left margin
95 {} % above code
96 {% % numbered format
97 {\large\thecontentslabel.\quad}%
98 }%
99 {\large} % unnumbered format
100 {\hfill \contentspage} % filler-page-format, e.g dots
101
102 % We have many short chapters. Avoid them all starting on right-side
103 % pages, as it wastes too much space
104 \let\cleardoublepage\clearpage