]> pere.pagekite.me Git - text-infor-lif-else-laula.git/blob - myclass.cls
Typo in README.
[text-infor-lif-else-laula.git] / myclass.cls
1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesPackage{myclass}[]
3
4 %% Just use the original class and pass the options
5 \LoadClassWithOptions{report}
6 % report, book, memoir, scrreprt or scrbook ?
7
8 % Show frames, make it easier to debug borders
9 %\usepackage{showframe}% http://ctan.org/pkg/showframe
10 \makeatletter
11
12 %
13 % Customize the titlepage: remove the date, place the publisher name, and
14 % load a specific file for the verso page, containing some legal notices
15 %
16 \def\maketitle{%
17 \titlerecto%
18 \titleverso}
19
20 \def\titlerecto{\begin{titlepage}%
21 \null\vfil
22 \vskip 160\p@
23 \begin{center}%
24 {\LARGE \@title \par}%
25 \vskip 3em%
26 {\Large
27 \lineskip .75em%
28 \begin{tabular}[t]{c}%
29 \@author
30 \end{tabular}\par}%
31 \vskip 20em%
32 {\large \DBKpublishername \par}
33 \vskip .75em%
34 {\large \DBKpublisheraddress \par}%
35 \end{center}\par
36 \vfil\null
37 \end{titlepage}}%
38
39 \def\titleverso{%
40 \def\titlepagefile{titlepg.input.tex}
41 \IfFileExists{\titlepagefile}{\input{\titlepagefile}}{}
42 }%
43
44
45 % Divide by 2 the index item indentation (10pt -> 5pt)
46 \renewcommand\@idxitem{\par\hangindent 20\p@}
47 \renewcommand\subitem{\@idxitem \hspace*{10\p@}}
48 \renewcommand\subsubitem{\@idxitem \hspace*{15\p@}}
49
50 \newenvironment{colophon}{
51 \pagebreak %
52 % FIXME change when page size changes, use {x}{x*1.2}
53
54 % Note, these numbers are not correct any more for the sizes mentioned:
55 % \fontsize{6.5}{7.8}\selectfont % fits in one 4.25x6.875" pocket size page
56 % \fontsize{7.5}{9}\selectfont % fits in one 5.06x7.71" size page
57 % \fontsize{9.1}{10.92}\selectfont % fits in one 5.5x8.5" digest size page
58
59 \fontsize{8.2}{9.84}\selectfont % fits in one 6x9'' size page
60 \setlength{\parskip}{0.5em} %
61 \setlength{\parindent}{0pt} %
62 }{}
63
64
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66
67 % From
68 % https://amyrhoda.wordpress.com/2012/06/04/latex-to-lulu-the-making-of-aosa-other-useful-packages-and-settings/
69
70 % The microtype package provides the ability to micromanage your
71 % typography. When invoked without any options it does some nice things
72 % like protruding punctuation over the edge of the right margin to make
73 % the margin appear smoother. Basically it makes your book look more
74 % professional with very little effort. It also has a ton of options if
75 % you want to micromanage even more.
76 \usepackage{microtype}
77
78 % By dafault, LaTeX will try and make all your pages the length that
79 % you set using the geometry setting. If a page has images, tables,
80 % headings or paragraph breaks which make it shorter than that page
81 % length, LaTeX will pad the page by adding whitespace between
82 % elements. We thought that looked sillier than having pages be
83 % different lengths, so we used the raggedbottom command.
84 \raggedbottom
85
86 % Hint for figure with empty title: remove the colon label separator
87 \usepackage{caption}
88 \captionsetup[figure]{labelsep=none}
89
90 % Fix the page number reset done by abstract by redefining it
91 % Patch from
92 % https://github.com/petterreinholdtsen/free-culture-lessig/pull/7
93
94 \def\nocount#1#2{}
95 \let\stdsetcounter\setcounter
96 \let\stdabstract=\abstract
97 \let\endstdabstract=\endabstract
98 \renewenvironment{abstract}{%
99 \let\setcounter\nocount%
100 \begin{stdabstract}%
101 \noindent%
102 \setlength\parskip{\medskipamount}%
103 \setlength\parindent{0pt}%
104 }{
105 \end{stdabstract}
106 \let\setcounter\stdsetcounter
107 }