| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2020-2025 by Antoine Missier <[email protected]> |
| 4 |
% ---------------------------------------------------------------------- |
| 5 |
% |
| 6 |
% This file may be distributed and/or modified under the |
| 7 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 8 |
% of this license or (at your option) any later version. |
| 9 |
% The latest version of this license is in: |
| 10 |
% |
| 11 |
% http://www.latex-project.org/lppl.txt |
| 12 |
% |
| 13 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 14 |
% version 2005/12/01 or later. |
| 15 |
% |
| 16 |
% \fi |
| 17 |
% |
| 18 |
% \iffalse |
| 19 |
%<*driver> |
| 20 |
\ProvidesFile{schooldocs.dtx} |
| 21 |
%</driver> |
| 22 |
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01] |
| 23 |
%<package>\ProvidesPackage{schooldocs} |
| 24 |
%<*package> |
| 25 |
[2025/01/15 v1.6 Layout styles for school documents] |
| 26 |
%</package> |
| 27 |
% |
| 28 |
%<*driver> |
| 29 |
\documentclass{ltxdoc} |
| 30 |
\usepackage[utf8]{inputenc} |
| 31 |
\usepackage[T1]{fontenc} |
| 32 |
\usepackage[english]{babel} |
| 33 |
\usepackage{charter} |
| 34 |
\usepackage{lipsum} |
| 35 |
\usepackage{boxedminipage2e} |
| 36 |
\usepackage{sectsty} |
| 37 |
\usepackage{spacingtricks} |
| 38 |
\usepackage{schooldocs} |
| 39 |
\usepackage{hypdoc} % includes hyperref |
| 40 |
\usepackage{metalogo} |
| 41 |
%\usepackage{geometry} |
| 42 |
\geometry{textwidth=355pt,textheight=600pt,vmarginratio=1:1,hmarginratio=3:2} |
| 43 |
% modified by schoodocs, very close from the default geometry used by ltxdoc |
| 44 |
|
| 45 |
\newcommand{\bs}{\textbackslash} |
| 46 |
\setlength{\fboxsep}{13pt} |
| 47 |
\newlength{\mpwd} \setlength{\mpwd}{5.25cm} |
| 48 |
\newenvironment{stylex}{\begin{boxedminipage}[c][1.3\mpwd][t]{\mpwd}\tiny |
| 49 |
}{\end{boxedminipage}} |
| 50 |
\definecolor{darkbrown}{rgb}{0.5,0.1,0.1} |
| 51 |
\allsectionsfont{\color{darkbrown}} %\sffamily |
| 52 |
\providecommand\headtitlestyle{\scshape} |
| 53 |
\providecommand\headsubjectstyle{\scshape} |
| 54 |
\providecommand\schoolstyle{\scshape} |
| 55 |
|
| 56 |
%\EnableCrossrefs |
| 57 |
%\CodelineIndex |
| 58 |
%\RecordChanges |
| 59 |
|
| 60 |
\title{The \textsf{schooldocs} package}%\thanks{This document |
| 61 |
% corresponds to \textsf{schooldocs}~\fileversion, dated \filedate.}} |
| 62 |
\subject{Antoine Missier \\ % |
| 63 |
\texttt{[email protected]}} |
| 64 |
\date{\filedate, \fileversion} |
| 65 |
|
| 66 |
\hypersetup{% |
| 67 |
colorlinks, |
| 68 |
linkcolor=red, |
| 69 |
filecolor=blue, |
| 70 |
pdftitle={schoodocs}, |
| 71 |
pdfsubject={LaTeX package}, |
| 72 |
pdfauthor={Antoine Missier} |
| 73 |
} |
| 74 |
|
| 75 |
\begin{document} |
| 76 |
\DocInput{schooldocs.dtx} |
| 77 |
\PrintChanges |
| 78 |
\PrintIndex |
| 79 |
\end{document} |
| 80 |
%</driver> |
| 81 |
% \fi% |
| 82 |
% |
| 83 |
% \changes{v0.0}{2010/09/01}{Initial personal version} |
| 84 |
% \changes{v0.1}{2020/01/05}{Initial documentation in French} |
| 85 |
% \changes{v0.2}{2020/05/04}{Examples file} |
| 86 |
% \changes{v1.0}{2020/07/13}{Initial public version with documentation in English} |
| 87 |
% \changes{v1.1}{2021/09/18}{Using the translations package for internationalization} |
| 88 |
% \changes{v1.2}{2022/11/14}{ |
| 89 |
% - New parameter smalltitletopskip, |
| 90 |
% - Forename discarded from the identity style, |
| 91 |
% - sffamily discarded from the default titlestyle |
| 92 |
% - smalltitletopskip changed from -2.0cm to -1.32cm} |
| 93 |
% \changes{v1.2}{2023/01/24}{ |
| 94 |
% - Small changes in the documentation (charter font is now used) |
| 95 |
% and the examples file (with several fonts)} |
| 96 |
% \changes{v1.3}{2023/08/28}{English corrections in the documentation} |
| 97 |
% \changes{v1.4}{2023/12/28}{ |
| 98 |
% - Headtitlestyle in exam and collection styles set to scshape instead of MakeUppercase} |
| 99 |
% \changes{v1.5}{2024/01/30}{ |
| 100 |
% - Possibility to call maketitle several times with different information fields |
| 101 |
% that can be changed outside the preamble |
| 102 |
% - The schooldocs-examples.pdf file is now generated in a single compilation} |
| 103 |
% \changes{v1.6}{2025/01/15}{ |
| 104 |
% - Using totpages package instead of lastpage (nowadays incompatible with hyperref)} |
| 105 |
% |
| 106 |
% \GetFileInfo{schooldocs.dtx} |
| 107 |
% |
| 108 |
% \maketitle |
| 109 |
% |
| 110 |
% \section{Introduction} |
| 111 |
% |
| 112 |
% The aim of this package is to offer diverse layout styles |
| 113 |
% for school-related documents. |
| 114 |
% It serves well in creating exercise sheets, exams, and course materials. |
| 115 |
% The package defines page geometry (text and margins dimensions) |
| 116 |
% and title formatting. |
| 117 |
% Various \emph{styles} are available defining settings for headers, footers |
| 118 |
% or alternative title formatting, providing many customizable features. |
| 119 |
% Six different styles are proposed that are named: |
| 120 |
% \begin{center} \bfseries |
| 121 |
% \hfill classic \hfill elegant \hfill modern \hfill soft |
| 122 |
% \hfill exam \hfill collection \hfill \mbox{} |
| 123 |
% \end{center} |
| 124 |
% Furthermore, a specific style named \textbf{identity} is provided |
| 125 |
% for documents like exam sheets that need to be completed and returned. |
| 126 |
% This style replaces the left header with ``\identityname'', |
| 127 |
% while keeping the center and right parts empty. |
| 128 |
% |
| 129 |
% \medskip |
| 130 |
% An overview of these styles is presented in section \ref{par:styles} |
| 131 |
% and you can observe the visual outcomes of each style in the file |
| 132 |
% \href{run:schooldocs-examples.pdf}{\textsf{schooldocs-examples.pdf}}. |
| 133 |
% |
| 134 |
% \section{Usage} |
| 135 |
% |
| 136 |
% \subsection{Choosing a style} |
| 137 |
% After loading the package with |\usepackage{schooldocs}|, |
| 138 |
% the style is defined by placing |\pagestyle|\marg{style} in the preamble. |
| 139 |
% This command comes from the \textsf{fancyhdr} package by Piet van Oostrum. |
| 140 |
% It can be placed before of after entering the information described in the next subsection. |
| 141 |
% |
| 142 |
% \medskip |
| 143 |
% To change the style of a particular page place |
| 144 |
% |\thispagestyle|\marg{style} on the page you desire. |
| 145 |
% For example, on an appendix page that needs to be rendered |
| 146 |
% you can use the command |\thispagestyle{identity}|. |
| 147 |
% |
| 148 |
% \subsection{Information fields} |
| 149 |
% |
| 150 |
% \DescribeMacro{\title} |
| 151 |
% Typically a \LaTeX\ document title is assembled using information |
| 152 |
% from the macros |\title|, |\date|, and |\author|. |
| 153 |
% The |\title| macro has been extended with an enriched syntax: |
| 154 |
% |\title|\oarg{head}\marg{title}. |
| 155 |
% The optional parameter \meta{head} corresponds to the text displayed in the header |
| 156 |
% instead of \meta{title}. |
| 157 |
% When not provided, the mandatory argument \meta{title} will be used in headers. |
| 158 |
% |
| 159 |
% The macros |\date| and |\author| have not been altered, but the provided information |
| 160 |
% is also used in titles, headers or footers |
| 161 |
% (depending on the chosen style) |
| 162 |
% \footnote{The macro \texttt{\bslash and}, |
| 163 |
% which can be employed in the \texttt{\bslash author} command |
| 164 |
% to typeset a title with several authors, does not function here, |
| 165 |
% except in the \textbf{collection} style. Attempting to use it will result |
| 166 |
% in a compilation error. The \texttt{\bslash thanks} macro also |
| 167 |
% doesn't work, although it does not generate an error.}. |
| 168 |
% |
| 169 |
% \pagebreak |
| 170 |
% \medskip |
| 171 |
% \DescribeMacro{\subject} \DescribeMacro{\school} \DescribeMacro{\institute} |
| 172 |
% Two additional information macros |
| 173 |
% are provided for use in titles, headers or footers, depending on the style: |
| 174 |
% |\subject| and |\school| (or its alias |\institute|). |
| 175 |
% The |\subject| macro includes an optional argument, similar to |\title|: |
| 176 |
% |\subject|\oarg{head}\marg{title}. This enables the placement of an alternative text |
| 177 |
% in the header, distinct from the text displayed in the title. |
| 178 |
% |
| 179 |
% \medskip |
| 180 |
% Information macros must be invoked in the preamble |
| 181 |
% \footnote{However, the macros \texttt{\bslash date} and \texttt{\bslash author} |
| 182 |
% can be used within the document body.}, |
| 183 |
% they are optional. In cases of omission, the corresponding field will remain empty -- |
| 184 |
% except for the date field, which will display today's date. |
| 185 |
% Therefore, if you wish to exclude the date, you can simply enter |\date{}|. |
| 186 |
% If certain title elements, such as subject or date, are absent, the title height |
| 187 |
% will be reduced accordingly. |
| 188 |
% |
| 189 |
% All of these information macros, except for |\date|, accept multi-line arguments, \eg |
| 190 |
% |\school{Royal College of Pataphysics\\London}|. |
| 191 |
% Within the |\title| macro, if you wish to typeset two (or more) lines, use |\\[1ex]| |
| 192 |
% for a proper vertical spacing. |
| 193 |
% |
| 194 |
% When employing the \textsf{hyperref} package |
| 195 |
% (developed by Sebastian Rahtz and Heiko Oberdiek), |
| 196 |
% the information provided via |\title|, |\subject|, and |\author| |
| 197 |
% (as well as |\school| |
| 198 |
% \footnote{The \emph{author} field of the PDF properties will be filled |
| 199 |
% as follows: \textsf{author (school)}. |
| 200 |
% However \texttt{\bs author} should be called before \texttt{\bs school} in the preamble. |
| 201 |
% }) |
| 202 |
% will also be included in the PDF properties. |
| 203 |
% |
| 204 |
% \medskip |
| 205 |
% The file \textsf{schooldocs-examples.pdf} utilizes the information fields |
| 206 |
% outlined in the following table. |
| 207 |
% \begin{center} |
| 208 |
% \begin{tabular}{ll} |
| 209 |
% \hline |
| 210 |
% Macro & Example \\ |
| 211 |
% \hline |
| 212 |
% |\title| & |\title[The classic style]{The classic style layout}| \\ |
| 213 |
% |\subject| & |\subject[Pathography / M2A]{Pathography / Master 2A}| \\ |
| 214 |
% |\author| & |\author{Antoine Missier}| \\ |
| 215 |
% |\school| & |\school{Royal College of Pataphysics}| \\ |
| 216 |
% |\date| & |\date{May 4, 2020}| \\ |
| 217 |
% \hline |
| 218 |
% \end{tabular} |
| 219 |
% \end{center} |
| 220 |
% |
| 221 |
% \DescribeMacro{\subtitle} |
| 222 |
% Within the \textbf{exam} style, the title includes an additional field |
| 223 |
% provided by the macro |\subtitle|\marg{text}. The \meta{text} argument |
| 224 |
% will be positioned beneath the other title elements and above the separation rule, |
| 225 |
% if present. For instance, |\subtitle{Duration of the test: 2\,h}|. |
| 226 |
% For a multi-line argument, use |\par| for line breaks instead of |\\|. |
| 227 |
% |
| 228 |
% \subsection{Making the title} |
| 229 |
% |
| 230 |
% \DescribeMacro{\maketitle} |
| 231 |
% Just like in the standard \LaTeX\ classes, the title is generated |
| 232 |
% using the |\maketitle| macro, which is placed after |\begin{document}|. |
| 233 |
% This macro has been redefined by the package. |
| 234 |
% In fact, the default title produced by the \LaTeX\ \texttt{article} class |
| 235 |
% appears unsuitable for school documents such as exercise sheets. |
| 236 |
% Vertical spacing before the title has been reduced and, |
| 237 |
% a horizontal rule is inserted to separate the title from the subsequent text. |
| 238 |
% By default, the title is centered, but this can be altered, |
| 239 |
% as demonstrated in section \ref{par:title-set}, to achieve |
| 240 |
% a left or right alignment (or even boxing). |
| 241 |
% Various title examples can be found in the file |
| 242 |
% \href{run:schooldocs-examples.pdf}{\textsf{schooldocs-examples.pdf}}. |
| 243 |
% |
| 244 |
% The macro has on optional parameter |\maketitle|\oarg{rulelength} |
| 245 |
% to define the length of the separation rule, which is 2.5\,cm by default. |
| 246 |
% The rule can be completely removed by setting the |
| 247 |
% optional argument to 0\,cm. Alternatively, you can typeset a rule spanning |
| 248 |
% the entire line using |\maketitle[\linewidth]|. ^^A or |\maketitle[\textwidth]|. |
| 249 |
% |
| 250 |
% Each style has its own title formatting. Nevertheless the package offers |
| 251 |
% a ``standard'' title formatting when no specific style is loaded or when using |
| 252 |
% the \LaTeX\ styles \textbf{empty} or \textbf{plain}. |
| 253 |
% The \textbf{elegant} style also retains this ``standard'' title formatting. |
| 254 |
% |
| 255 |
% \medskip |
| 256 |
% \DescribeMacro{\seprule} |
| 257 |
% Just like in the title, a rule can also be used within |
| 258 |
% the text body for creating separations. |
| 259 |
% This is achieved using the |\seprule|\oarg{length} macro, |
| 260 |
% producing a horizontal and centered rule of optional \meta{length}, |
| 261 |
% with a default of 2.5\,cm. |
| 262 |
% |
| 263 |
% \medskip |
| 264 |
% \DescribeMacro{\correct} |
| 265 |
% To typeset a correct version of an exercise sheet, we provide the |\correct| macro, |
| 266 |
% which adds `` -- Correct Version'' to the title. |
| 267 |
% It should be placed in the preamble. |
| 268 |
% When used with packages that manage multiple versions of a document, |
| 269 |
% this macro eliminates the need to define distinct titles for an exercise sheet |
| 270 |
% an its correct version. |
| 271 |
% However in the \textbf{exam} style, the text ``Correct version'' |
| 272 |
% replaces the subtitle instead of being added in the main title (except in headers). |
| 273 |
% |
| 274 |
% \medskip |
| 275 |
% \DescribeMacro{\makesmalltitle} |
| 276 |
% Inspired by the package \textsf{phfnote} by Philippe Faist, we also offer |
| 277 |
% a compact title format. This format combines the details from |
| 278 |
% |\title|, |\subject| and |\date| into a single line, |
| 279 |
% depending on the chosen style (see \textsf{schooldocs-examples.pdf}). |
| 280 |
% The rule is always displayed and spans the entire line width. |
| 281 |
% |
| 282 |
% \subsection{Style layouts} \label{par:styles} |
| 283 |
% |
| 284 |
% In accordance with typographic good practices, |
| 285 |
% the header on the title page is usually left empty |
| 286 |
% (see The \LaTeX\ Companion). |
| 287 |
% However, this ``rule'' is often disregarded in school documents. |
| 288 |
% On the first page, it is common to find information such as author, school, etc., |
| 289 |
% at the top left and the date at the top right, resembling the layout of a letter. |
| 290 |
% While we adhere to good practices for the headers (except in the \textbf{classic} style), |
| 291 |
% we still include certain information in the footer. |
| 292 |
% |
| 293 |
% Below, we present miniature previews illustrating the six styles layout. |
| 294 |
% The file \href{run:schooldocs-examples.pdf}{\textsf{schooldocs-examples.pdf}} |
| 295 |
% provides an actual representation. |
| 296 |
% In several styles, a rule is placed below the header. |
| 297 |
% It can be displayed or removed by setting its width, and the same applies to a rule |
| 298 |
% above the footer. |
| 299 |
% The formatting of each element, as well as specific spacing settings, |
| 300 |
% can be freely customized as detailed in \ref{par:head-settings}. |
| 301 |
% |
| 302 |
% \medskip |
| 303 |
% \begin{stylex} |
| 304 |
% {\schoolstyle School} \hfill {Author}\\[-0.3ex] |
| 305 |
% {\headsubjectstyle Subject} \hfill {date}\\ |
| 306 |
% \vspace{0.04\mpwd} |
| 307 |
% \centered{\footnotesize\bfseries The classic style} |
| 308 |
% \vspace{-0.25ex}\centered{\rule{0.15\mpwd}{0.1pt}} |
| 309 |
% \vspace{0.85\mpwd} |
| 310 |
% \centered{1/2} |
| 311 |
% \end{stylex} |
| 312 |
% \qquad |
| 313 |
% \begin{stylex} |
| 314 |
% \mbox{}\\[1ex] |
| 315 |
% {\headtitlestyle Title} \hfill {\headsubjectstyle Subject}\\ |
| 316 |
% \vspace{0.97\mpwd} |
| 317 |
% \centered{2/2} |
| 318 |
% \end{stylex} |
| 319 |
% \medskip |
| 320 |
% |
| 321 |
% \begin{stylex} |
| 322 |
% \mbox{}\vspace{0.03\mpwd} |
| 323 |
% \begin{center} |
| 324 |
% {\footnotesize\bfseries The elegant style}\\[1.7ex] |
| 325 |
% {\scriptsize Subject} \\[0.5ex] |
| 326 |
% {\scriptsize date} \\ |
| 327 |
% \vspace{-0.5ex}\rule{0.15\mpwd}{0.1pt} |
| 328 |
% \end{center} |
| 329 |
% \vspace{0.72\mpwd} |
| 330 |
% {\schoolstyle School} \hfill Author |
| 331 |
% \end{stylex} |
| 332 |
% \qquad |
| 333 |
% \begin{stylex} |
| 334 |
% {\headtitlestyle Title} \hfill Page |
| 335 |
% \end{stylex} |
| 336 |
% \medskip |
| 337 |
% |
| 338 |
% \begin{stylex} |
| 339 |
% \mbox{}\vspace{0.03\mpwd} |
| 340 |
% \begin{center} |
| 341 |
% {\footnotesize\bfseries The modern style}\\[1.7ex] |
| 342 |
% {\scriptsize Subject} \\ |
| 343 |
% \vspace{-0.5ex}\rule{0.15\mpwd}{0.1pt} |
| 344 |
% \end{center} |
| 345 |
% \vspace{0.75\mpwd} |
| 346 |
% {\schoolstyle School} \hfill \begin{tabular}[c]{r@{}}Author\\[-0.5ex] date\end{tabular} |
| 347 |
% \end{stylex} |
| 348 |
% \qquad |
| 349 |
% \begin{stylex} |
| 350 |
% {\headtitlestyle Title} \hfill {\headsubjectstyle Subject} \par |
| 351 |
% \vspace{-1.9ex}\rule{0.82\mpwd}{0.1pt} |
| 352 |
% |
| 353 |
% \vspace{1.01\mpwd} |
| 354 |
% \centered{2/2} |
| 355 |
% \end{stylex} |
| 356 |
% \medskip |
| 357 |
% |
| 358 |
% \begin{stylex} |
| 359 |
% \mbox{}\vspace{0.03\mpwd} |
| 360 |
% \begin{center} |
| 361 |
% {\footnotesize\bfseries The soft style}\\ |
| 362 |
% \vspace{-0.5ex}\rule{0.15\mpwd}{0.1pt} |
| 363 |
% \end{center} |
| 364 |
% \vspace{0.83\mpwd} |
| 365 |
% {\schoolstyle School} \hfill {\headsubjectstyle Subject}\\ |
| 366 |
% Author \hfill date |
| 367 |
% \end{stylex} |
| 368 |
% \qquad |
| 369 |
% \begin{stylex} |
| 370 |
% {\headtitlestyle Title} \hfill Page \par |
| 371 |
% \vspace{-1.9ex}\rule{0.82\mpwd}{0.1pt} |
| 372 |
% \vspace{0.97\mpwd} |
| 373 |
% |
| 374 |
% \schoolstyle School \hfill \headsubjectstyle Subject |
| 375 |
% \end{stylex} |
| 376 |
% \medskip |
| 377 |
% |
| 378 |
% \begin{stylex} |
| 379 |
% \mbox{}\vspace{0.1\mpwd} |
| 380 |
% \begin{center} |
| 381 |
% {\footnotesize THE EXAM STYLE}\\[3.2ex] |
| 382 |
% {\scriptsize\bfseries Subject} \\[2.8ex] |
| 383 |
% {\scriptsize date} \\[2ex] |
| 384 |
% {\scriptsize\slshape subtitle} \\ |
| 385 |
% \rule{0.15\mpwd}{0.1pt} |
| 386 |
% \end{center} |
| 387 |
% \vspace{0.51\mpwd} |
| 388 |
% \begin{tabular}[c]{@{}l}Author\\[-0.5ex] \schoolstyle School\end{tabular} \hfill {Page} |
| 389 |
% \end{stylex} |
| 390 |
% \qquad |
| 391 |
% \begin{stylex} |
| 392 |
% {\headtitlestyle Title} \hfill {\headsubjectstyle Subject} \par |
| 393 |
% \vspace{-1.9ex}\rule{0.82\mpwd}{0.1pt} |
| 394 |
% |
| 395 |
% \vspace{1.01\mpwd} |
| 396 |
% \begin{tabular}[c]{@{}l}Author\\[-0.5ex] \schoolstyle School\end{tabular} \hfill {Page} |
| 397 |
% \end{stylex} |
| 398 |
% \medskip |
| 399 |
% |
| 400 |
% \begin{stylex} |
| 401 |
% \mbox{}\vspace{0.1\mpwd} |
| 402 |
% \begin{center} |
| 403 |
% {\footnotesize THE COLLECTION STYLE}\\[3.2ex] |
| 404 |
% {\scriptsize\bfseries Subject} \\[2.8ex] |
| 405 |
% {\scriptsize Author} \\[1.5ex] |
| 406 |
% {\scriptsize School} \\[1.5ex] |
| 407 |
% {\scriptsize date} \\ |
| 408 |
% \rule{0.15\mpwd}{0.1pt} |
| 409 |
% \end{center} |
| 410 |
% \end{stylex} |
| 411 |
% \qquad |
| 412 |
% \begin{stylex} |
| 413 |
% {\headtitlestyle Title} \hfill {\headsubjectstyle Section} \par |
| 414 |
% \vspace{-1.9ex}\rule{0.82\mpwd}{0.1pt} |
| 415 |
% |
| 416 |
% \vspace{1.01\mpwd} |
| 417 |
% {\schoolstyle School} \hfill {2} |
| 418 |
% \end{stylex} |
| 419 |
% \bigskip |
| 420 |
% |
| 421 |
% The \textbf{collection} style is well-suited for longer documents. |
| 422 |
% In this style the name of the current section is displayed in the right header |
| 423 |
% and updates as the content progresses, similar to the behavior |
| 424 |
% in the \LaTeX\ \textbf{book} class. |
| 425 |
% |
| 426 |
% \section{Settings} |
| 427 |
% |
| 428 |
% \subsection{Page layout} |
| 429 |
% |
| 430 |
% The page layout is set in the same way for all styles. |
| 431 |
% It is defined by the |\geometry| macro of the package |
| 432 |
% \textsf{geometry} (by Hideo Umeki and David Carlisle). |
| 433 |
% Following good typographic practice (see the \LaTeX\ Companion, |
| 434 |
% the \textsf{typearea} package or the \textsf{KOMA-Script} bundle documentation), |
| 435 |
% the ratio between the text body (referred to as the ``type area'' by typographers) |
| 436 |
% and the page size must be the same horizontally and vertically. |
| 437 |
% This ratio gauges the ``shade of gray'' of a page. |
| 438 |
% The default scale in the \textsf{geometry} package is 0.7. |
| 439 |
% However, for school documents, this setting seems to result in excessive white |
| 440 |
% space in the margins. Thus we have adjusted this ratio to 0.75. |
| 441 |
% You can modify it using the |\newgeometry| command |
| 442 |
% \footnote{You can also call \textsf{geometry} before \textsf{schooldocs}. |
| 443 |
% Setting the scale factor several times doesn't work.}. |
| 444 |
% |
| 445 |
% Moreover, in accordance with ``canons of page construction'', in a one-sided document, |
| 446 |
% the ratio between the left and right margins should be 1:1, |
| 447 |
% while the ratio between top and bottom margins should be 1:2. |
| 448 |
% It appears that this recommended 1:2 ratio is rarely observed, |
| 449 |
% as it results in an overly wide bottom margin. |
| 450 |
% Additionally, when loading the \textsf{geometry} package, the default vertical |
| 451 |
% ratio is set at 2:3 and not 1:2. |
| 452 |
% To achieve more balanced margins, we have preferred to set it at 3:4, using |
| 453 |
% |\geometry{scale=0.75,vmarginratio=3:4,heightrounded}| |
| 454 |
% \footnote{The \texttt{heightrounded} option rounds text height to a multiple of $n$ times |
| 455 |
% the height of a line (where $n$ is an integer), preventing occurrences |
| 456 |
% of ``underfull vbox'' at times.}. |
| 457 |
% |
| 458 |
% \subsection{Title settings} \label{par:title-set} |
| 459 |
% |
| 460 |
% Several parameters allow for customizing the title composition. |
| 461 |
% They are presented in the table below along with their default settings. |
| 462 |
% Colors can be altered using |\definecolor|, macros using |\renewcommand| |
| 463 |
% and lengths using |\setlength|. |
| 464 |
% Most command names are self-explanatory and don't require additional information |
| 465 |
% about their usage. |
| 466 |
% The |\titleflush| command handles alignment: |
| 467 |
% it is centered by default, but can be left-aligned using |
| 468 |
% |\renewcommand{\titleflush}{flushleft}| (\texttt{flushright} for right alignment) |
| 469 |
% \footnote{This macro has no effect |
| 470 |
% with the \textbf{exam} and \textbf{collection} styles, |
| 471 |
% where the title is always centered.}. |
| 472 |
% |
| 473 |
% The length |\titlesep| determines the vertical spacing between the \emph{title} |
| 474 |
% and \emph{subject} fields, except for the \textbf{classic} and \textbf{soft} styles, |
| 475 |
% witch contain only the \emph{title} field, or when the \emph{subject} field |
| 476 |
% is not provided. |
| 477 |
% Vertical space between other title fields is defined relative to |
| 478 |
% |\titlesep| (|0.5\titlesep| for most). |
| 479 |
% |
| 480 |
% Unless specified otherwise, the ``special settings'' column in the following table |
| 481 |
% applies to the \textbf{exam} and \textbf{collection} styles. |
| 482 |
% |
| 483 |
% \begin{center} \small |
| 484 |
% \begin{tabular}{ccc} |
| 485 |
% \hline |
| 486 |
% Parameter & Default settings & Special settings \\ |
| 487 |
% \hline |
| 488 |
% |titlecolor| & |black| & \\ |
| 489 |
% |\titlestyle| & |\LARGE\bfseries| & |\LARGE\MakeUppercase| \\ |
| 490 |
% |\subjectstyle| & |\large| & |\Large\bfseries|\\ |
| 491 |
% |\datestyle| & |\large| \\ |
| 492 |
% |\smalltitledatestyle| & |\large\slshape| & \\ |
| 493 |
% |\titleflush| & |center| & \\ |
| 494 |
% |\titletopskip| & -1.32\,cm & -0.67\,cm (\textbf{classic, soft}), 0.67\,cm \\ |
| 495 |
% |\smalltitletopskip| & -1.32\,cm & \\ |
| 496 |
% |\titlebottomskip| & |\medskipamount| \\ |
| 497 |
% |\titlesep| & |2\medskipamount| & |2\bigskipamount| \\ |
| 498 |
% |\seprulewidth| & 0.3\,pt &\\ |
| 499 |
% |\seprulelength| & 2.5\,cm &\\ |
| 500 |
% \hline |
| 501 |
% \end{tabular} |
| 502 |
% \end{center} |
| 503 |
% |
| 504 |
% \DescribeMacro{\subtitlestyle}\DescribeMacro{\titlecorrectstyle} |
| 505 |
% The \textbf{exam} style has two additional setting macros: |
| 506 |
% |\subtitlestyle|, set by default to |\large\slshape|, |
| 507 |
% and |\titlecorrectstyle|, for the ``\textsf{Correct Version}'' composition |
| 508 |
% via |\correct|, with the default being |\color{red}\large\scshape|. |
| 509 |
% |
| 510 |
% \DescribeMacro{\authorstyle} |
| 511 |
% In the \textbf{collection} style, the |
| 512 |
% \emph{school} and \emph{author} fields are incorporated into the title. |
| 513 |
% Their attributes are governed by |\authorstyle| |
| 514 |
% \footnote{In other styles, the \texttt{\bs authorstyle} macro |
| 515 |
% (set to \texttt{\bs textnormal}) |
| 516 |
% is utilized within header or footer.} which is set to |\Large|. |
| 517 |
% |
| 518 |
% To create a separate title page |
| 519 |
% (especially for the \textbf{exam} or \textbf{collection} styles), |
| 520 |
% you can enclose |\maketitle| within the |titlepage| environment provided by \LaTeX. |
| 521 |
% |
| 522 |
% \medskip |
| 523 |
% \DescribeMacro{\boxedshape} |
| 524 |
% A specific formatting has been predefined to create a lightly |
| 525 |
% shaded box around the title: |\boxedshape|\marg{text} |
| 526 |
% (thanks to the \textsf{fancybox} package by Timothy Van Zandt). |
| 527 |
% It can be used within the command |\titlestyle| |
| 528 |
% if you want to achieve this kind of effect, for instance: |
| 529 |
% \centeredline{|\renewcommand{\titlestyle}{\LARGE\sffamily\bfseries\boxedshape}|.} |
| 530 |
% |
| 531 |
% \subsection{Headers and footers} \label{par:head-settings} |
| 532 |
% |
| 533 |
% The typesetting of headers and footers is achieved using specialized macros |
| 534 |
% \footnote{The \textsf{fancyhdr} package offers |
| 535 |
% the commands \texttt{\bs lhead}, \texttt{\bs chead}, \texttt{\bs rhead} |
| 536 |
% for the left, center and right portions of the header, and similarly for the footer: |
| 537 |
% \texttt{\bs lfoot}, \texttt{\bs cfoot} and \texttt{\bs rfoot}.} |
| 538 |
% from the \textsf{fancyhdr} package. |
| 539 |
% Similar to the title, various macros enable customization of specific settings. |
| 540 |
% They are outlined in the table below. |
| 541 |
% Note that |\pagenamestyle| determines the format of the word ``\emph{page}'' |
| 542 |
% displayed preceding the page number. |
| 543 |
% |
| 544 |
% The |\headstyle| and |\footstyle| commands are common for all |
| 545 |
% headers and footers components, respectively. |
| 546 |
% These commands are combined with macros that provide |
| 547 |
% distinct settings for each individual field. |
| 548 |
% \begin{center} |
| 549 |
% \begin{tabular}{cc} |
| 550 |
% \hline |
| 551 |
% Parameter & Default setting \\ |
| 552 |
% \hline |
| 553 |
% |headingcolor| & |black| \\ |
| 554 |
% |\headstyle| & |\small\color{headingcolor}| \\ |
| 555 |
% |\footstyle| & |\small\color{headingcolor}| \\ |
| 556 |
% |\headtitlestyle| & |\scshape| \\ |
| 557 |
% |\headsubjectstyle| & |\scshape| \\ |
| 558 |
% |\schoolstyle| & |\scshape| \\ |
| 559 |
% |\headdatestyle| & |\textnormal| \\ |
| 560 |
% |\authorstyle| & |\textnormal| \\ |
| 561 |
% |\pagenamestyle| & |\textnormal| \\ |
| 562 |
% \hline |
| 563 |
% \end{tabular} |
| 564 |
% \end{center} |
| 565 |
% |
| 566 |
% \medskip |
| 567 |
% Macros that enable the display (or removal) of the rule in the header |
| 568 |
% \footnote{In fact, we have redefined the \texttt{\bs headrule} macro |
| 569 |
% so that the rule never appears on the first page.} |
| 570 |
% or the footer are provided |
| 571 |
% by the \textsf{fancyhdr} package. For example, in any style, |
| 572 |
% the header rule can be removed using: |
| 573 |
% |\renewcommand{\headrulewidth}{0pt}|, |
| 574 |
% and it can be displayed in the footer with: |
| 575 |
% |\renewcommand\footrulewidth{0.4pt}|. |
| 576 |
% |
| 577 |
% \subsection{Internationalization} |
| 578 |
% Three keywords are utilized by the package: \emph{page}, \emph{Correct version}, |
| 579 |
% and \emph{Name}, |
| 580 |
% defined by the macros |\pagename|, |\correctname| and |\identityname|. |
| 581 |
% |\pagename| is used in the header or footer, |\correctname| by the |\correct| |
| 582 |
% macro and |\identityname| by the \textbf{identity} style. |
| 583 |
% These keywords are automatically translated into a few languages |
| 584 |
% \footnote{Translation is currently built into the package |
| 585 |
% for the following languages: |
| 586 |
% French, German, Spanish, Italian, Portuguese.} |
| 587 |
% based on the selected language using the \textsf{babel} or \textsf{polyglossia} package. |
| 588 |
% They can be redefined using |\renewcommand|, |
| 589 |
% or you can also utilize macros from Clemens Niederberger's \textsf{translations} package |
| 590 |
% (allowing dynamic language changes), such as |
| 591 |
% |\DeclareTranslation{romanian}{pagin\u{a}}| (in the preamble). |
| 592 |
% |
| 593 |
% |
| 594 |
% \StopEventually{} |
| 595 |
% |
| 596 |
% \section{Implementation} |
| 597 |
% |
| 598 |
% \subsection{Required packages and geometry settings} |
| 599 |
% |
| 600 |
% \begin{macrocode} |
| 601 |
\@ifpackageloaded{geometry}{}{\RequirePackage{geometry}} |
| 602 |
\let\footruleskip\relax % because the memoir class uses it |
| 603 |
\RequirePackage{fancyhdr} |
| 604 |
\RequirePackage{ifthen} |
| 605 |
\RequirePackage{totpages} % lastpage nowadays incompatible with hyperref |
| 606 |
\RequirePackage{fancybox} |
| 607 |
\RequirePackage{xcolor} |
| 608 |
\RequirePackage{translations} |
| 609 |
|
| 610 |
\geometry{scale=0.75,vmarginratio=3:4,heightrounded} |
| 611 |
|
| 612 |
% \end{macrocode} |
| 613 |
% If the \textsf{geometry} package has been previously loaded, |
| 614 |
% we do not load it again to prevent conflict with options. |
| 615 |
% |
| 616 |
% To modify the scale factor, utilize |\newgeometry| as the |
| 617 |
% |\geometry| command will not function when the scale is already set. |
| 618 |
%\medskip |
| 619 |
% \subsection{Internationalization} |
| 620 |
% |
| 621 |
% \begin{macrocode} |
| 622 |
\DeclareTranslationFallback{schooldocs-pagename}{page} |
| 623 |
\DeclareTranslationFallback{schooldocs-correct}{Correct version} |
| 624 |
\DeclareTranslationFallback{schooldocs-name}{Name:} |
| 625 |
|
| 626 |
\DeclareTranslation{english}{schooldocs-pagename}{page} |
| 627 |
\DeclareTranslation{english}{schooldocs-correct}{Correct version} |
| 628 |
\DeclareTranslation{english}{schooldocs-name}{Name:} |
| 629 |
|
| 630 |
\DeclareTranslation{french}{schooldocs-pagename}{page} |
| 631 |
\DeclareTranslation{french}{schooldocs-correct}{Corrigé} |
| 632 |
\DeclareTranslation{french}{schooldocs-name}{Nom :} |
| 633 |
|
| 634 |
\DeclareTranslation{german}{schooldocs-pagename}{Seite} |
| 635 |
\DeclareTranslation{german}{schooldocs-correct}{Musterlösung} |
| 636 |
\DeclareTranslation{german}{schooldocs-name}{Name:} |
| 637 |
|
| 638 |
\DeclareTranslation{spanish}{schooldocs-pagename}{página} |
| 639 |
\DeclareTranslation{spanish}{schooldocs-correct}{Correccion} |
| 640 |
\DeclareTranslation{spanish}{schooldocs-name}{Apellido:} |
| 641 |
|
| 642 |
\DeclareTranslation{italian}{schooldocs-pagename}{pagina} |
| 643 |
\DeclareTranslation{italian}{schooldocs-correct}{Corretto} |
| 644 |
\DeclareTranslation{italian}{schooldocs-name}{Nome:} |
| 645 |
|
| 646 |
\DeclareTranslation{portuges}{schooldocs-pagename}{página} |
| 647 |
\DeclareTranslation{portuges}{schooldocs-correct}{Corrigiu} |
| 648 |
\DeclareTranslation{portuges}{schooldocs-name}{Nome:} |
| 649 |
|
| 650 |
\newcommand*\pagename{\GetTranslation{schooldocs-pagename}} |
| 651 |
\newcommand*\correctname{\GetTranslation{schooldocs-correct}} |
| 652 |
\newcommand*\identityname{\GetTranslation{schooldocs-name}} |
| 653 |
|
| 654 |
% \end{macrocode} |
| 655 |
% Whether in French or German, the word that translates `correctname' contains |
| 656 |
% an accented letter. The |\correct| macro will add this translated word to the title. |
| 657 |
% However, when compiling with pdf\LaTeX\ and using the \textsf{hyperref} package, |
| 658 |
% the encoding of these accented characters might be incorrect in the PDF metadata. |
| 659 |
% In this case, compile with \XeLaTeX\ or add |\renewcommand\correctname{...}| |
| 660 |
% in the preamble. |
| 661 |
% |
| 662 |
% \medskip |
| 663 |
% \subsection{Information fields} |
| 664 |
% |
| 665 |
% The PDF information fields are filled in using the information macros, |
| 666 |
% but this only works in the preamble, hence the test |\ifx@onlypreamble@notprerr|. |
| 667 |
% This allows using these macros outside the preamble, which is the normal behavior |
| 668 |
% for |\title|, |\date|, |\author|, etc. with the 'article' class. |
| 669 |
% |
| 670 |
% Once defined, information fields are initially set to empty |
| 671 |
% to ensure that tests for empty fields work correctly. |
| 672 |
|
| 673 |
% |
| 674 |
% \begin{macrocode} |
| 675 |
\renewcommand{\title}[2][]{\long\def\@title{#2} |
| 676 |
\ifthenelse{\equal{#1}{}}{\def\@headtitle{#2}}{\def\@headtitle{#1}} |
| 677 |
\ifx\@onlypreamble\@notprerr\else |
| 678 |
\@ifpackageloaded{hyperref}% |
| 679 |
{\hypersetup{pdftitle={\@headtitle}}}{} |
| 680 |
\fi |
| 681 |
} |
| 682 |
\title{} |
| 683 |
\author{} |
| 684 |
|
| 685 |
\newcommand\school[1]{\long\def\@school{#1} |
| 686 |
\ifx\@onlypreamble\@notprerr\else |
| 687 |
\@ifpackageloaded{hyperref}{ |
| 688 |
\hypersetup{pdfauthor={\@author\ (\@school)}}}{} |
| 689 |
\fi |
| 690 |
} |
| 691 |
\school{} |
| 692 |
\newcommand{\institute}{\school} |
| 693 |
|
| 694 |
\let\subject\relax |
| 695 |
\newcommand{\subject}[2][]{\long\def\@subject{#2} |
| 696 |
\ifthenelse{\equal{#1}{}}% |
| 697 |
{\def\@headsubject{#2}}{\def\@headsubject{#1}} |
| 698 |
\ifx\@onlypreamble\@notprerr\else |
| 699 |
\@ifpackageloaded{hyperref}% |
| 700 |
{\hypersetup{pdfsubject={\@headsubject}}}{} |
| 701 |
\fi |
| 702 |
} |
| 703 |
\def\@subject{} |
| 704 |
\def\@headsubject{} |
| 705 |
% \end{macrocode} |
| 706 |
% Due to the usage of the |\subject| macro by the \textsf{KOMA-Script} package, |
| 707 |
% we include a |\relax| command before defining this macro. |
| 708 |
% |
| 709 |
% The |\subject{}| command doesn't function properly with the |\@empty| test |
| 710 |
% employed below in the |\maketitle| command. Consequently, |
| 711 |
% we define |\@subject| and |\@headsubject| as empty by default. |
| 712 |
% |
| 713 |
% \subsection{Settings} |
| 714 |
% |
| 715 |
% First we present the title settings. |
| 716 |
% \begin{macrocode} |
| 717 |
\definecolor{titlecolor}{named}{black} |
| 718 |
\newcommand{\titlestyle}{\LARGE\bfseries} |
| 719 |
\newcommand{\subjectstyle}{\large} |
| 720 |
\newcommand{\datestyle}{\large} |
| 721 |
\newcommand{\smalltitledatestyle}{\large\slshape} |
| 722 |
\newcommand{\titleflush}{center} |
| 723 |
\newlength{\titletopskip} \setlength{\titletopskip}{-1.32cm} |
| 724 |
\newlength{\smalltitletopskip} \setlength{\smalltitletopskip}{-1.32cm} |
| 725 |
\newlength{\titlesep} \setlength{\titlesep}{2\medskipamount} |
| 726 |
\newlength{\titlebottomskip} \setlength{\titlebottomskip}{\medskipamount} |
| 727 |
\newlength{\seprulewidth} \setlength{\seprulewidth}{0.3pt} |
| 728 |
\newlength{\seprulelength} \setlength{\seprulelength}{2.5cm} |
| 729 |
|
| 730 |
\newcommand{\boxedshape}[1]{% |
| 731 |
\color{gray} % no effect |
| 732 |
\setlength{\fboxsep}{4.5pt} |
| 733 |
\setlength{\shadowsize}{3pt} |
| 734 |
\shadowbox{\quad\textcolor{titlecolor}{\rule{0pt}{2ex}#1}\quad} |
| 735 |
} |
| 736 |
|
| 737 |
% \end{macrocode} |
| 738 |
% The default value for |\fboxsep| is 3\,pt and for |\shadowsize| it's 4\,pt. |
| 739 |
% These settings have a local scope. |
| 740 |
% |
| 741 |
% \medskip |
| 742 |
% Then, we move on to the settings for headers and footers. |
| 743 |
% \begin{macrocode} |
| 744 |
\definecolor{headingcolor}{named}{black} |
| 745 |
\newcommand{\headstyle}{\small\color{headingcolor}} |
| 746 |
\newcommand{\footstyle}{\small\color{headingcolor}} |
| 747 |
\newcommand{\headtitlestyle}{\scshape} |
| 748 |
\newcommand{\headsubjectstyle}{\scshape} |
| 749 |
\newcommand{\schoolstyle}{\scshape} |
| 750 |
\newcommand{\headdatestyle}{\textnormal} |
| 751 |
\newcommand{\authorstyle}{\textnormal} |
| 752 |
\newcommand{\pagenamestyle}{\textnormal} |
| 753 |
\setlength{\headheight}{\baselineskip} |
| 754 |
\renewcommand{\headrule}{\ifthenelse{\thepage=1}% |
| 755 |
{\vspace{-2ex}\rule{\headwidth}{0pt}}% |
| 756 |
{\vspace{-2ex}\rule{\headwidth}{\headrulewidth}} |
| 757 |
} |
| 758 |
|
| 759 |
% \end{macrocode} |
| 760 |
% The redefinition of the |\headrule| macro allows for the removal |
| 761 |
% of the rule on the first page. |
| 762 |
% |
| 763 |
% The header height is set to |\baselineskip| to prevent |
| 764 |
% some error messages (``\texttt{headheight too small}'') when the text size is |
| 765 |
% equal to or greater than |\small|. |
| 766 |
% |
| 767 |
% \subsection{Title composition} |
| 768 |
% |
| 769 |
% The first macro, |\schooldocstitles|, aims to define the default composition of titles. |
| 770 |
% Several styles redefine their own title composition. |
| 771 |
% This macro allows, when using |\maketitle| multiple times at different places |
| 772 |
% in the document, to revert to the default definition when a style has modified |
| 773 |
% the title definition. |
| 774 |
% \begin{macrocode} |
| 775 |
\newcommand{\schooldocstitles}{ |
| 776 |
\renewcommand{\maketitle}[1][\seprulelength]{ |
| 777 |
\newpage\mbox{}\par\vspace{\titletopskip} |
| 778 |
\begin{\titleflush} |
| 779 |
{\color{titlecolor} |
| 780 |
{\titlestyle{\@title}} |
| 781 |
\ifx\@subject\@empty\else |
| 782 |
\par\vspace{\titlesep}\subjectstyle\@subject |
| 783 |
\fi |
| 784 |
\ifthenelse{\equal{\@date}{}}{}{% |
| 785 |
\par\vspace{0.5\titlesep} \datestyle\@date} |
| 786 |
\par\vspace{0.5\titlesep} |
| 787 |
} |
| 788 |
\ifthenelse{\lengthtest{##1>0cm}}{\rule{##1}{\seprulewidth}}{} |
| 789 |
\end{\titleflush} |
| 790 |
\vspace{\titlebottomskip} |
| 791 |
} |
| 792 |
|
| 793 |
\let\makesmalltitle\relax |
| 794 |
\newcommand{\makesmalltitle}{ |
| 795 |
\newpage\mbox{}\par\vspace{\smalltitletopskip} |
| 796 |
\begin{center} |
| 797 |
{\color{titlecolor} |
| 798 |
{\titlestyle{\@title}} |
| 799 |
\hfill \subjectstyle\@subject |
| 800 |
\ifthenelse{\equal{\@date}{}}{}{% |
| 801 |
\enskip --\enskip \smalltitledatestyle\@date} |
| 802 |
} |
| 803 |
\rule{\linewidth}{\seprulewidth} |
| 804 |
\end{center} |
| 805 |
\vspace{\titlebottomskip} |
| 806 |
} |
| 807 |
|
| 808 |
\let\correct\relax |
| 809 |
\newcommand\correct{% |
| 810 |
\let\@originalheadtitle\@headtitle |
| 811 |
\def\@headtitle{\@originalheadtitle ~--~\correctname} |
| 812 |
\ifx\@onlypreamble\@notprerr\else |
| 813 |
\@ifpackageloaded{hyperref}{% |
| 814 |
\AtBeginDocument{\hypersetup{pdftitle={\@headtitle}}}}{} |
| 815 |
\fi |
| 816 |
\let\@originaltitle\@title |
| 817 |
\def\@title{\@originaltitle ~--~\correctname} |
| 818 |
} |
| 819 |
} |
| 820 |
\schooldocstitles |
| 821 |
|
| 822 |
\newcommand{\seprule}[1][\seprulelength]{\begin{center} |
| 823 |
\raisebox{0.25\baselineskip}{\rule{#1}{\seprulewidth}}\end{center}} |
| 824 |
|
| 825 |
% \end{macrocode} |
| 826 |
% |
| 827 |
% \subsection{Basic styles} |
| 828 |
% |
| 829 |
% In the \textbf{classic} style, the header is displayed on two lines, |
| 830 |
% thus requiring an increase in the |\headheight|. |
| 831 |
% |
| 832 |
% To include the header or footer into the total body, |
| 833 |
% add |\geometry{includehead}| or |\geometry{includefoot}| |
| 834 |
% in the preamble. |
| 835 |
% \begin{macrocode} |
| 836 |
\fancypagestyle{classic}{% |
| 837 |
\renewcommand{\headrulewidth}{0pt} |
| 838 |
\addtolength{\headheight}{\baselineskip} |
| 839 |
\lhead{\headstyle\ifthenelse{\thepage=1}{\schoolstyle\@school\mbox{}\\ |
| 840 |
\headsubjectstyle\@subject}{\headtitlestyle\@headtitle} } |
| 841 |
\rhead{\headstyle\ifthenelse{\thepage=1}{\authorstyle\@author\mbox{}\\ |
| 842 |
\headdatestyle\@date}{\headsubjectstyle\@headsubject}} |
| 843 |
\cfoot{\footstyle \thepage /\pageref{TotPages}} |
| 844 |
\setlength{\titletopskip}{-0.67cm} |
| 845 |
\renewcommand{\maketitle}[1][\seprulelength]{% |
| 846 |
\newpage\mbox{}\par\vspace{\titletopskip} |
| 847 |
\begin{\titleflush} |
| 848 |
{\color{titlecolor}\titlestyle{\@title}} |
| 849 |
\par\vspace{0.5\titlesep} |
| 850 |
\ifthenelse{\lengthtest{##1>0cm}}{\rule{##1}{\seprulewidth}}{} |
| 851 |
\end{\titleflush} |
| 852 |
\vspace{\titlebottomskip} |
| 853 |
} |
| 854 |
\renewcommand{\makesmalltitle}{ |
| 855 |
\newpage\mbox{}\par\vspace{\smalltitletopskip} |
| 856 |
\begin{center} |
| 857 |
{\color{titlecolor} |
| 858 |
{\titlestyle{\@title}} |
| 859 |
\hfill \subjectstyle\@subject |
| 860 |
} |
| 861 |
\rule{\linewidth}{\seprulewidth} |
| 862 |
\end{center} |
| 863 |
\vspace{\titlebottomskip} |
| 864 |
} |
| 865 |
} |
| 866 |
|
| 867 |
\fancypagestyle{elegant}{% |
| 868 |
\renewcommand{\headrulewidth}{0pt} |
| 869 |
\lhead{\headstyle |
| 870 |
\ifthenelse{\thepage=1}{}{\headtitlestyle\@headtitle}} |
| 871 |
\rhead{\headstyle |
| 872 |
\ifthenelse{\thepage=1}{}{% |
| 873 |
\pagenamestyle\pagename~\thepage /\pageref{TotPages}}} |
| 874 |
\lfoot{\ifthenelse{\thepage=1}{\footstyle\schoolstyle\@school}{}} |
| 875 |
\cfoot{} |
| 876 |
\rfoot{\ifthenelse{\thepage=1}{\footstyle\authorstyle\@author}{}} |
| 877 |
} |
| 878 |
|
| 879 |
\fancypagestyle{modern}{% |
| 880 |
\lhead{\headstyle |
| 881 |
\ifthenelse{\thepage=1}{}{\headtitlestyle\@headtitle}} |
| 882 |
\rhead{\headstyle |
| 883 |
\ifthenelse{\thepage=1}{}{\headsubjectstyle\@headsubject}} |
| 884 |
\lfoot{\ifthenelse{\thepage=1}{\footstyle\schoolstyle\@school}{}} |
| 885 |
\cfoot{\ifthenelse{\thepage=1}{}{ |
| 886 |
\footstyle\thepage /\pageref{TotPages}}} |
| 887 |
\rfoot{\footstyle\ifthenelse{\thepage=1}{% |
| 888 |
\authorstyle\@author |
| 889 |
\ifx\@author\empty\else\\ \fi |
| 890 |
\headdatestyle\@date\ignorespaces}{} |
| 891 |
} |
| 892 |
\renewcommand{\maketitle}[1][\seprulelength]{% |
| 893 |
\newpage\mbox{}\par\vspace{\titletopskip} |
| 894 |
\begin{\titleflush} |
| 895 |
{\color{titlecolor} |
| 896 |
{\titlestyle{\@title}} |
| 897 |
\ifx\@subject\@empty\else |
| 898 |
\par\vspace{\titlesep}\subjectstyle\@subject |
| 899 |
\fi |
| 900 |
\par\vspace{0.5\titlesep} |
| 901 |
} |
| 902 |
\ifthenelse{\lengthtest{##1>0cm}}{\rule{##1}{\seprulewidth}}{} |
| 903 |
\end{\titleflush} |
| 904 |
\vspace{\titlebottomskip} |
| 905 |
} |
| 906 |
\renewcommand{\makesmalltitle}{ |
| 907 |
\newpage\mbox{}\par\vspace{\smalltitletopskip} |
| 908 |
\begin{center} |
| 909 |
{\color{titlecolor} |
| 910 |
{\titlestyle{\@title}} |
| 911 |
\hfill \subjectstyle\@subject |
| 912 |
} |
| 913 |
\rule{\linewidth}{\seprulewidth} |
| 914 |
\end{center} |
| 915 |
\vspace{\titlebottomskip} |
| 916 |
} |
| 917 |
} |
| 918 |
|
| 919 |
\fancypagestyle{soft}{% |
| 920 |
\lhead{\headstyle |
| 921 |
\ifthenelse{\thepage=1}{}{\headtitlestyle\@headtitle}} |
| 922 |
\rhead{\headstyle |
| 923 |
\ifthenelse{\thepage=1}{}{% |
| 924 |
\pagenamestyle\pagename~\thepage /\pageref{TotPages}}} |
| 925 |
\lfoot{\footstyle{\schoolstyle\@school} |
| 926 |
\ifthenelse{\thepage=1}{\ifx\@author\empty\else\\ \fi |
| 927 |
\authorstyle\@author}{} |
| 928 |
} |
| 929 |
\cfoot{} |
| 930 |
\rfoot{\footstyle{\headsubjectstyle\@headsubject} |
| 931 |
\ifthenelse{\thepage=1}{\ifx\@date\empty\else\\ \fi |
| 932 |
\headdatestyle\@date\ignorespaces}{} |
| 933 |
} |
| 934 |
\setlength{\titletopskip}{-0.67cm} |
| 935 |
\renewcommand{\maketitle}[1][\seprulelength]{% |
| 936 |
\newpage\mbox{}\par\vspace{\titletopskip} |
| 937 |
\begin{\titleflush} |
| 938 |
{\color{titlecolor}\titlestyle{\@title}} |
| 939 |
\par\vspace{0.5\titlesep} |
| 940 |
\ifthenelse{\lengthtest{##1>0cm}}{\rule{##1}{\seprulewidth}}{} |
| 941 |
\end{\titleflush} |
| 942 |
\vspace{\titlebottomskip} |
| 943 |
} |
| 944 |
\renewcommand{\makesmalltitle}{ |
| 945 |
\newpage\mbox{}\par\vspace{\smalltitletopskip} |
| 946 |
\begin{center} |
| 947 |
{\color{titlecolor} |
| 948 |
{\titlestyle{\@title}} |
| 949 |
\hfill \mbox{} |
| 950 |
} |
| 951 |
\rule{\linewidth}{\seprulewidth} |
| 952 |
\end{center} |
| 953 |
\vspace{\titlebottomskip} |
| 954 |
} |
| 955 |
} |
| 956 |
|
| 957 |
\fancypagestyle{identity}{% |
| 958 |
\lhead{\headstyle\headtitlestyle \identityname} |
| 959 |
\chead{} |
| 960 |
\rhead{} |
| 961 |
} |
| 962 |
|
| 963 |
% \end{macrocode} |
| 964 |
% |
| 965 |
% \subsection{Extended styles} |
| 966 |
% |
| 967 |
% \begin{macrocode} |
| 968 |
\fancypagestyle{exam}{% |
| 969 |
\let\subtitle\relax % because KOMA-Script uses it |
| 970 |
\newcommand\subtitle[1]{\long\def\@subtitle{##1}} |
| 971 |
\subtitle{} |
| 972 |
\lhead{\headstyle |
| 973 |
\ifthenelse{\thepage=1}{}{\headtitlestyle{\@headtitle}}} |
| 974 |
\rhead{\headstyle |
| 975 |
\ifthenelse{\thepage=1}{}{\headsubjectstyle\@headsubject}} |
| 976 |
\lfoot{\footstyle |
| 977 |
\authorstyle\@author |
| 978 |
\ifx\@author\empty\else\\ \fi |
| 979 |
\schoolstyle\@school |
| 980 |
} |
| 981 |
\cfoot{} |
| 982 |
\rfoot{\footstyle \pagenamestyle\pagename~\thepage/\pageref{TotPages}} |
| 983 |
\setlength{\titletopskip}{0.67cm} |
| 984 |
\setlength{\titlesep}{2\bigskipamount} |
| 985 |
\renewcommand{\titlestyle}{\LARGE\MakeUppercase} |
| 986 |
\renewcommand{\subjectstyle}{\Large\bfseries} |
| 987 |
\let\subtitlestyle\relax |
| 988 |
\newcommand{\subtitlestyle}{\large\slshape} |
| 989 |
\let\titlecorrectstyle\relax |
| 990 |
\newcommand*{\titlecorrectstyle}{\color{red}\large\scshape} |
| 991 |
\renewcommand\correct{% |
| 992 |
\let\@originalheadtitle\@headtitle |
| 993 |
\def\@headtitle{\@originalheadtitle ~--~\correctname} |
| 994 |
\ifx\@onlypreamble\@notprerr\else |
| 995 |
\@ifpackageloaded{hyperref}{% |
| 996 |
\AtBeginDocument{\hypersetup{pdftitle={\@headtitle}}}}{} |
| 997 |
\fi |
| 998 |
\renewcommand{\subtitlestyle}{\titlecorrectstyle} |
| 999 |
\subtitle{\correctname} |
| 1000 |
} |
| 1001 |
\renewcommand{\maketitle}[1][\seprulelength]{% |
| 1002 |
\newpage\mbox{}\par\vspace{\titletopskip} |
| 1003 |
\begin{center} |
| 1004 |
{\color{titlecolor} |
| 1005 |
{\titlestyle{\@title}} |
| 1006 |
\par\vspace{\titlesep}{\subjectstyle \@subject} |
| 1007 |
\par\vspace{\titlesep} |
| 1008 |
\ifthenelse{\equal{\@date}{}}{}{% |
| 1009 |
\datestyle\@date\par\vspace{0.5\titlesep}} |
| 1010 |
\ifthenelse{\equal{\@subtitle}{}}{}{% |
| 1011 |
\subtitlestyle\@subtitle\par\vspace{0.5\titlesep} |
| 1012 |
} |
| 1013 |
} |
| 1014 |
\ifthenelse{\lengthtest{##1>0cm}}{\rule{##1}{\seprulewidth}}{} |
| 1015 |
\end{center} |
| 1016 |
\vspace{\titlebottomskip} |
| 1017 |
} |
| 1018 |
} |
| 1019 |
|
| 1020 |
\fancypagestyle{collection}{% |
| 1021 |
\lhead{\headstyle\headtitlestyle\@headtitle} |
| 1022 |
\ifx\@onlypreamble\@notprerr |
| 1023 |
\renewcommand{\sectionmark}[1]{\markboth{##1}{}} |
| 1024 |
\else |
| 1025 |
\AtBeginDocument{\renewcommand{\sectionmark}[1]{\markboth{##1}{}}} |
| 1026 |
\fi |
| 1027 |
\rhead{\headstyle\headsubjectstyle\leftmark} %\@section |
| 1028 |
\lfoot{\footstyle\schoolstyle \@school} |
| 1029 |
\cfoot{} |
| 1030 |
\rfoot{\footstyle\thepage} |
| 1031 |
\setlength{\titletopskip}{0.67cm} |
| 1032 |
\setlength{\titlesep}{2\bigskipamount} |
| 1033 |
\renewcommand{\titlestyle}{\LARGE\MakeUppercase} |
| 1034 |
\renewcommand{\subjectstyle}{\Large\bfseries} |
| 1035 |
\renewcommand{\authorstyle}{\Large} |
| 1036 |
\renewcommand{\datestyle}{\Large} |
| 1037 |
\renewcommand{\maketitle}[1][\seprulelength]{% |
| 1038 |
\thispagestyle{empty} |
| 1039 |
\newpage\mbox{}\par\vspace{\titletopskip} |
| 1040 |
\begin{center} |
| 1041 |
{\color{titlecolor} |
| 1042 |
{\titlestyle{\@title}} |
| 1043 |
\par\vspace{\titlesep} {\subjectstyle{\@subject}} |
| 1044 |
\par\vspace{\titlesep} |
| 1045 |
\ifx\@author\empty |
| 1046 |
\else \authorstyle |
| 1047 |
\begin{tabular}[t]{c}\@author\end{tabular} |
| 1048 |
\ifx\@school\empty\else\par\vspace{1ex} \@school\fi |
| 1049 |
\par\vspace{0.5\titlesep} |
| 1050 |
\fi |
| 1051 |
\ifthenelse{\equal{\@date}{}}{}{% |
| 1052 |
\datestyle\@date \par\vspace{0.5\titlesep}} |
| 1053 |
} |
| 1054 |
\ifthenelse{\lengthtest{##1>0cm}}{\rule{##1}{\seprulewidth}}{} |
| 1055 |
\end{center} |
| 1056 |
\vspace{\titlebottomskip} |
| 1057 |
} |
| 1058 |
} |
| 1059 |
% \end{macrocode} |
| 1060 |
% |
| 1061 |
% In the \textbf{collection} style, |
| 1062 |
% we redefine |\sectionmark| using |\AtBeginDocument| to prevent a possible redefinition |
| 1063 |
% of |\headtitlestyle| as |\MakeUppercase| from removing the section number |
| 1064 |
% (alternatively, you can use |\nouppercase| here). |
| 1065 |
% |
| 1066 |
% The |\ifthenelse| command doesn't function properly when |\and| is used within |\author|. |
| 1067 |
% |
| 1068 |
% Note the |\pagestyle{empty}| command in |\maketitle|, which ensures that there is |
| 1069 |
% no header on the first page. |
| 1070 |
% |
| 1071 |
% \Finale |
| 1072 |
\endinput |