]> pere.pagekite.me Git - text-madewithcc.git/blob - myclass.cls
Translated using Weblate (Russian)
[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 \DBKpublisheraddress \par}
42 \vskip .75em%
43 {\large \DBKpublishername \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 % We have specified @openright to allow the chapters to start in
55 % either page (recto or verso), but we don't want that behavior for
56 % parts - The part heading should start in the right page (recto)
57 % always.
58 %
59 % When a \part clears the preceding page, we don't want the page
60 % number in it either.
61
62 \renewcommand\part{%
63 \clearpage
64 \thispagestyle{empty}%
65 \ifodd\value{page}
66 \null%
67 \else
68 \null\newpage\thispagestyle{empty}%
69 \fi
70 \null\vfil
71 \secdef\@part\@spart}
72
73 \def\@endpart{\vfil\newpage}
74
75 % Allow line break on hyphen (-) in URLs, to make sure long URLs in
76 % footnotes do not pass out of the margins.
77 \usepackage[hyphens]{url}
78
79 \newenvironment{colophon}{
80 \pagebreak %
81 % FIXME change when page size changes, use {x}{x*1.2}
82
83 % Note, these numbers are not correct any more for the sizes mentioned:
84 % \fontsize{6.5}{7.8}\selectfont % fits in one 4.25x6.875" pocket size page
85 % \fontsize{7.5}{9}\selectfont % fits in one 5.06x7.71" size page
86 % \fontsize{9.1}{10.92}\selectfont % fits in one 5.5x8.5" digest size page
87
88 \fontsize{8.2}{9.84}\selectfont % fits in one 6x9'' size page
89 \setlength{\parskip}{0.5em} %
90 \setlength{\parindent}{0pt} %
91 }{}
92
93 \usepackage{titlesec}
94 \titleformat{\chapter}{\huge}{\thechapter.}{20pt}{\hyphenpenalty=10000 \Huge}
95 \titleformat{\section}{\Large}{\thesection}{1em}{}
96 \titleformat{\subsection}{\large}{\thesubsection}{1em}{}
97 %% \titleformat{\paragraph}{\normalsize}{\theparagraph}{1em}{}
98 %% \titleformat{\subparagraph}{\normalsize}{\thesubparagraph}{1em}{}
99
100 \usepackage{titletoc}
101
102 % indented subsection (in toc)
103 \titlecontents{part}
104 [0.0cm] % left margin
105 {\vskip 0.5em} % above code
106 {% % numbered format
107 {\Large\thecontentslabel\quad}%
108 }%
109 {\Large} % unnumbered format
110 {\hfill \contentspage \vskip 0.2em} % filler-page-format, e.g dots
111
112
113 % indented subsection (in toc)
114 \titlecontents{chapter}
115 [0.0cm] % left margin
116 {} % above code
117 {% % numbered format
118 {\large\thecontentslabel.\quad}%
119 }%
120 {\large} % unnumbered format
121 {\hfill \contentspage} % filler-page-format, e.g dots
122
123 % We have many short chapters. Avoid them all starting on right-side
124 % pages, as it wastes too much space
125 \let\cleardoublepage\clearpage