X-Git-Url: https://pere.pagekite.me/gitweb/text-madewithcc.git/blobdiff_plain/50cc8ff17e5876c32f7a40367872126387c9ce8e..cd1786fbd009c5ebcf9ebc5a9c563ad2cee63858:/myclass.cls?ds=sidebyside diff --git a/myclass.cls b/myclass.cls index e7f2f01..355eb86 100644 --- a/myclass.cls +++ b/myclass.cls @@ -4,8 +4,18 @@ %% Just use the original class and pass the options \LoadClassWithOptions{report} +% Place page number at the outer foot edge of content pages +\usepackage[pagestyles]{titlesec} +\newpagestyle{mystyle}{\setfoot[\thepage][][]{}{}{\thepage}} +\pagestyle{mystyle} + +\renewcommand{\baselinestretch}{1.2} +\newcommand{\beforetitle}{} +\newcommand{\publisherlogos}{} + \makeatletter +\usepackage{hyphenat} % % Customize the titlepage: remove the date, place the publisher name, and % load a specific file for the verso page, containing some legal notices @@ -15,7 +25,9 @@ \titleverso} \def\titlerecto{\begin{titlepage}% + \beforetitle \null\vfil + \thispagestyle{empty} \vskip 160\p@ \begin{center}% {\LARGE \@title \par}% @@ -26,9 +38,10 @@ \@author \end{tabular}\par}% \vskip 20em% - {\large \DBKpublishername \par} + {\large \DBKpublisheraddress \par} \vskip .75em% - {\large \DBKpublisheraddress \par}% + {\large \DBKpublishername \par}% + \publisherlogos \end{center}\par \vfil\null \end{titlepage}}% @@ -38,6 +51,31 @@ \IfFileExists{\titlepagefile}{\input{\titlepagefile}}{} }% +% We have specified @openright to allow the chapters to start in +% either page (recto or verso), but we don't want that behavior for +% parts - The part heading should start in the right page (recto) +% always. +% +% When a \part clears the preceding page, we don't want the page +% number in it either. + +\renewcommand\part{% + \clearpage + \thispagestyle{empty}% + \ifodd\value{page} + \null% + \else + \null\newpage\thispagestyle{empty}% + \fi + \null\vfil + \secdef\@part\@spart} + +\def\@endpart{\vfil\newpage} + +% Allow line break on hyphen (-) in URLs, to make sure long URLs in +% footnotes do not pass out of the margins. +\usepackage[hyphens]{url} + \newenvironment{colophon}{ \pagebreak % % FIXME change when page size changes, use {x}{x*1.2} @@ -51,3 +89,37 @@ \setlength{\parskip}{0.5em} % \setlength{\parindent}{0pt} % }{} + +\usepackage{titlesec} +\titleformat{\chapter}{\huge}{\thechapter.}{20pt}{\hyphenpenalty=10000 \Huge} +\titleformat{\section}{\Large}{\thesection}{1em}{} +\titleformat{\subsection}{\large}{\thesubsection}{1em}{} +%% \titleformat{\paragraph}{\normalsize}{\theparagraph}{1em}{} +%% \titleformat{\subparagraph}{\normalsize}{\thesubparagraph}{1em}{} + +\usepackage{titletoc} + +% indented subsection (in toc) +\titlecontents{part} +[0.0cm] % left margin +{\vskip 0.5em} % above code +{% % numbered format +{\Large\thecontentslabel\quad}% +}% +{\Large} % unnumbered format +{\hfill \contentspage \vskip 0.2em} % filler-page-format, e.g dots + + +% indented subsection (in toc) +\titlecontents{chapter} +[0.0cm] % left margin +{} % above code +{% % numbered format +{\large\thecontentslabel.\quad}% +}% +{\large} % unnumbered format +{\hfill \contentspage} % filler-page-format, e.g dots + +% We have many short chapters. Avoid them all starting on right-side +% pages, as it wastes too much space +\let\cleardoublepage\clearpage