diff options
15 files changed, 6182 insertions, 2431 deletions
diff --git a/Master/texmf-dist/doc/latex/skrapport/README b/Master/texmf-dist/doc/latex/skrapport/README new file mode 100644 index 00000000000..92f3c99ab0d --- /dev/null +++ b/Master/texmf-dist/doc/latex/skrapport/README @@ -0,0 +1,45 @@ +%% skrapport Skånings rapportklass +%% +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Simon Sigurdhsson. +%% +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo + +This is version 0.12a of the skrapport document class, intended for simple +reports submitted by the author at Chalmers University of Technology. + +The following files are enclosed. + + README - This file + Makefile - GNU Makefile for making the package and documentation + skrapport.tex - LaTeX source code of the class and documentation + skrapport.pdf - PDF version of the documentation + +Installation notes: +The easiest way to install this package, assuming you have obtained the +source code from Github or CTAN, is to simply run `make install`. This +will generate package code and documentation, install it into TEXMFHOME +and run `mktexlsr`. If you wish to compile the package but not install +it, run `make all` instead. If you insist on doing it manually, remember +that you must use `pdflatex` (not `tex` or `latex`). diff --git a/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf b/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf Binary files differindex f23e632c343..bb78e6b57b2 100644 --- a/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf +++ b/Master/texmf-dist/doc/latex/skrapport/skrapport.pdf diff --git a/Master/texmf-dist/doc/latex/skrapport/skrapport.tex b/Master/texmf-dist/doc/latex/skrapport/skrapport.tex deleted file mode 100644 index c9b6bc8ad65..00000000000 --- a/Master/texmf-dist/doc/latex/skrapport/skrapport.tex +++ /dev/null @@ -1,1790 +0,0 @@ -%% chscite Skånings rapportklass -%% -%% Copyright (C) 2012 by Simon Sigurdhsson <sigurdhsson@gmail.com> -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3 -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% http://www.latex-project.org/lppl.txt -%% and version 1.3 or later is part of all distributions of LaTeX -%% version 2005/12/01 or later. -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Simon Sigurdhsson. -%% -%% This work consists of the file skrapport.tex and the -%% derived files skrapport.cls, skrapport-colortheme-default.sty, -%% skrapport-colortheme-unscathed.sty, skrapport-colortheme-violet.sty -%% and skrapport-colortheme-cruelwater.sty. -\documentclass{skdoc} -\usepackage{hologo,booktabs} -\usepackage[style=authoryear]{biblatex} -\usepackage{csquotes} -%\usepackage{chslacite} - -% Hide the implementation -\OnlyDescription - -% Bibliography entries -\begin{filecontents}{skrapport.bib} - @article{kpfonts, - author = {Christophe Caignaert}, - title = {KP-Fonts 3.31}, - year = {2010}, - url = {http://www.tex.ac.uk/tex-archive/fonts/kpfonts/doc/kpfonts.pdf} - } -\end{filecontents} -\addbibresource{skrapport.bib} - -% Declare the target files -\SelfPreambleTo{\mypreamble} -\DeclareFile[key=class,preamble=\mypreamble]{skrapport.cls} -\DeclareFile[key=theme-default,preamble=\mypreamble]% - {skrapport-colortheme-default.sty} -\DeclareFile[key=theme-unscathed,preamble=\mypreamble]% - {skrapport-colortheme-unscathed.sty} -\DeclareFile[key=theme-cruelwater,preamble=\mypreamble]% - {skrapport-colortheme-cruelwater.sty} -\DeclareFile[key=theme-violet,preamble=\mypreamble]% - {skrapport-colortheme-violet.sty} - -% This is where the documentation begins -\begin{document} - % Change & version info - \version{0.10b} - \changes{0.01}{Initial version} - \changes{0.03}{Removed \cs{rd} and \cs{id}} - \changes{0.04}{Added \pkg{microtype} package} - \changes{0.05}{Improved documentation} - \changes{0.06}{Corrected cheksum, further improved documentation} - \changes{0.07}{Various bugfixes, \hologo{XeLaTeX} compatibility, - better float settings, quote style fix, - \opt{intlimits} option to \pkg{amsmath}} - \changes{0.07a}{Fixed \pkg{kpfonts} issues} - \changes{0.09}{Introduced \pkg{kvoptions}, - fixed abstract in twocolumn mode} - \changes{0.10}{Include skmath if exists - and wanted. Gobble optional arguments to - \env{figure} and \env{table} in two-column mode.} - \changes{0.10a}{Include \pkg{xparse} (fixes breakage).} - - % Metadata - \package[ctan=skbundle,vcs=https://github.com/urdh/skrapport]{skrapport} - \title{The \textbf{\thepackage} document class} - \author{Simon Sigurdhsson} - \email{sigurdhsson@gmail.com} - - % First page - \maketitle - \begin{abstract} - A document class intended for simple documents \emph{e.g.} - reports handed in to courses and such. It is small, - straightforwars and heavily inspired by the Prac\TeX{} - Journal style. - \end{abstract} - \tableofcontents - - \section{Documentation} - \subsection{Loading the class} - The document class is loaded using \cs{documentclass} as usual, - but it has a bunch of options that you might want to know about. - - \subsubsection{Compatibility options} - There are a couple of options that are mostly provided for - compatibility with the standard \LaTeXe\ document classes. These - will do exactly the same thing they do in the standard classes, - although they may differ in default value. Although some of these - are key-value options, for compatibility their valid values may - also be passed as keys. - - \Options{paper}\WithValues{a4paper, a5paper}\AndDefault{a4paper} - Specifying paper size is possible using the \opt{paper} option - (the values of which are based - on European paper sizes; use the \pkg{geometry} package for other - standards). Only A4 and A5 are defined since these two sizes cover - pretty much all intended use of the class. \opt{a4paper} is the - default value of this option, and the only other valid value is - \opt{a5paper}. - - \Options{ptsize}\WithValues{10pt, 11pt, 12pt}\AndDefault{11pt} - The same font sizes specified in the standard classes are also - available in \thepackage\ (\emph{i.e.} \opt{10pt}, - \opt{11pt} and \opt{12pt}. The default font size is - \opt{11pt}, and there should be no compelling reason to change - this. - - \Options{draft,final} - The \opt{draft} and \opt{final} options work as expected, triggering - or untriggering the familiar draft mode. The default is \opt{final}. - - \Options{fleqn,leqno} - Purely for compatibility \thepackage\ also defines the \opt{fleqn} - and \opt{leqno} options. As with the standard \LaTeXe\ classes, - \opt{fleqn} aligns equations with the left-hand margin and - \opt{leqno} places equation numbers to the left. None of these - are activated by default. - - \subsubsection{Typographic options} - There is also a number of options available to change certain - aspects of the typography of the typeset document. - - \Options{titles}\WithValues{rm, bf, sf}\AndDefault{rm} - There are three different ways to typeset section headings in - \thepackage: \texttt{rm} (upright serif), \texttt{bf} (boldfaced - serif) and \texttt{sf} (sans serif). The default is \texttt{rm}. - - \Options{font}\WithValues{nofont, lmodern, palatino, kpfonts}\AndDefault{kpfonts} - In addition, the specific font can also be changed --- the available - choices are \texttt{lmodern} (Latin Modern), \texttt{kpfonts} - (Kp-Fonts) and \texttt{palatino} (either \TeX-Gyre Pagella or - Pazo Math depending on what's available), with the default being - \texttt{kpfonts}. It is also possible to tell \thepackage\ not - to use any font (\texttt{nofont}), which is sometimes useful - when using \hologo{XeLaTeX}, among other things. - - \Options{indent,noindent} - Controlling indentation is posible using the options - \texttt{(no)indent}. The default, \texttt{noindent}, behaves - much like the \pkg{parskip} package in that it replaces - paragraph indentation with vertical spacing. - - \Options{onecolumn,twocolumn} - Similar to the options available in the standard classes, these - options specify wether to typeset the document in one or two - columns. Unlike the standard classes, the two-column mode is - implemented using \pkg{multicol}. The default is \opt{onecolumn}. - - \subsubsection{Other options} - \Options{swe,eng} - Either \pkg{babel} or \pkg{polyglossia} (depending on engine) is - loaded by the package. These options specify what language should - be used as the main language (swedish or english); both languages - are always loaded. The default is \opt{swe}. - - \Options{color,nocolor} - It is also possible to load \pkg{xcolor} inside the package. If - this is done, a range of color themes (discussed later) will be - available in the package and these will affect the document. The - default value is \opt{nocolor}. - - \Options{math,nomath} - Loading the \pkg{skmath} package is recommended and as such it is - loaded by default. If this for some reason is undesirable, the - \opt{nomath} option will supress this behaviour. - - \subsection{Macros and environments} - In general, the class defines the same macros as the \pkg{article} class, and adds a few. Only the novel ones are described here, as - the inherited ones should behave identically. - - \subsubsection{Front-matter and metadata} - \DescribeMacro\license{<license>} - The \cs{license} macro specifies the name of a license under which - the document is available. This will be typeset on the lower right - corner of the title page. - - \DescribeMacro\regarding{<text>} - The class adds a \cs{regarding} macro, which is used like the - standard \cs{author} and \cs{title} macros and should be given an - accurate but short description of the purpose of the report (i.e. - ~course name or similar). This is printed along with the date on - the top of the title/first page. - - \DescribeMacro\author[<email>]{<author>} - The \cs{author} macro is redefined in two ways. To begin with, the - macro now acceps an optional argument specifying the email address - of the author. If the macro is used multiple times, authors are - appended to the list of author names displayed by \cs{maketitle}. - - \DescribeMacro\maketitle - The title page (or rather, block) has been refashioned to mimic the - Prac\TeX\ Journal style. This means a fairly compact block, starting - with a line of text containing the date and subject matter, followed - by a large skip and then the title, author and optionally an - abstract set ragged-right and fairly close together. - - \subsubsection{Useful macros} - The class defines a few additional macros that aren't available in - \pkg{article} but don't fit in any specifiv \enquote{set} of - features. These include commands to typeset comments. - - \DescribeMacro\comment*{<comment>} - \DescribeMacro\com*{<comment>} - \DescribeMacro\note*{<comment>} - The \cs{comment} macro (also available in an unstarred variant) - typesets a comment. The starred variant typesets the commen in red - prefixed by the word \enquote{Comment}, while the unstarred variant - typesets the comment as a margin note (but still prefixed). The - \cs{com} and \cs{note} macros are aliases of \cs{comment}. - - \subsubsection{Two-column mode} - \DescribeEnv[<content>]{onecol} - In \opt{twocolumn} mode, the package defines an environment - \env{onecol} which typesets its contents in a single column. - Additionally, it redefines \env{figure} and \env{table} as - non-floats, leaving the starred versions intact. - - \subsubsection{Color themes} - \DescribeMacro\colortheme{<theme>} - If the package is loaded with the \opt{color} option, changing the color theme is - possible using \cs{colortheme}, which loads an - appropriate package. At the moment, four color themes are available. - - \Theme{default} - The \thm{default} theme is fairly conservative, only coloring - \pkg{hyperef} links with more readable, slightly darker colors than - the standard ones. It should print well even on non-color printers. - - \Theme{unscathed} - The \thm{unscathed} theme is based on a palette with the same - name on COLOURlovers% -\footnote{\url{http://www.colourlovers.com/palette/1440498/unscathed}}, - and applies a \textcolor[HTML]{463335}{dark brown} color to - emphasized text, a \textcolor[HTML]{CF5D3B}{rusty} color to links, - a \textcolor[HTML]{B34430}{darker rust} color to titles and a - \textcolor[HTML]{70524A}{lighter brown} to quotes. - - \Theme{cruelwater} - The \thm{cruelwater} theme is also based on a palette from - COLOURlovers% -\footnote{\url{http://www.colourlovers.com/palette/126030/Cruel_Water_at_Night}}, - and applies a \textcolor[HTML]{030C22}{dark blue} color to bold - text and captions, a \textcolor[HTML]{20293F}{slightly less dark - blue} to titles and emphasized text, a \textcolor[HTML]{A9B0B3}{ - light gray} color to small print and a \textcolor[HTML]{404749}{ - darker gray} to quotes. - - \Theme{violet} - The \thm{violet} theme, like \thm{unscathed} and \thm{cruelwater}, - is based on a COLOURlovers palette% -\footnote{\url{http://www.colourlovers.com/palette/1831303/Violet_White_Bedrm}}. - It colors all links \textcolor[HTML]{932444}{bright purple}, applies - a \textcolor[HTML]{311A2A}{dark puple} color to titles, bold text - and captions, a \textcolor[HTML]{D6CBCF}{grayish purple} to small - print, a \textcolor[HTML]{463335}{dark brown} color to quotes and a - \textcolor[HTML]{98758D}{pastel violet} color to emphasized text. - - \subsection{Additional information} - The document class includes a number of packages by default. This - is useful to know, since passing explicit options to these packages - will require you to utilize the \cs{PassOptionsToPackage} macro - before you load the class using \cs{documentclass}. - Table~\ref{tab:pkgs} lists the packages included by \thepkg\ along - with their options (if applicable). - - \begin{table}[tbp] - \centering - \caption{User-level packages included by \thepkg.} - \label{tab:pkgs} - \begin{tabular}{llp{15em}} - \toprule - \textbf{Package} & \textbf{Options} & \textbf{Comments} \\ - \midrule - \pkg{amsmath} & \texttt{intlimits} & Provides \hologo{AmS} commands and environments. \\ - \pkg{amssymb} & & Only if not using \opt{kpfonts}.\\ - \pkg{babel} & see options \opt{swe} and \opt{eng} & Only loaded if \emph{not} using \hologo{XeTeX}.\\ - \pkg{calc} & & \\ - \pkg{fontenc} & \texttt{T1} & Only loaded if \emph{not} using \hologo{XeTeX}. Makes sure we are using a good font encoding for crisp appearance on-screen (OT1 is horrible). \\ - \pkg{fontspec} & \texttt{quiet} & Only loaded if using \hologo{XeTeX}. Provides basic OTF font selection commands.\\ - \pkg{geometry} & \texttt{a4paper} or \texttt{a5paper} & This is used by the \opt{paper} option to set the paper area. \\ - \pkg{icomma} & & \\ - \pkg{microtype} & & Provides micro-typographic improvements.\\ - \pkg{multicol} & & Only loaded with the \opt{twocolumn} option. \\ - \pkg{polyglossia} & see options \opt{swe} and \opt{eng} & Only loaded if using \hologo{XeTeX}.\\ - \pkg{skmath} & & Only if it exists and \opt{nomath} isn't set.\\ - \pkg{textcomp} & & Only if not using \opt{kpfonts}.\\ - \pkg{xcolor} & & Only loaded with the \opt{color} option.\\ - \bottomrule - \end{tabular} - \end{table} - - \subsection{Known issues} - A list of current issues is available in the Github repository of this - package\footnote{\url{https://github.com/urdh/skrapport/issues}}, but as - of the release of \theversion, there are only two known issues: - \begin{description} - \item[\#6] When using the \opt{color} option, sometimes captions are - uncolored. It seems that color only appears when the caption - is long enough to break a line. It is unknown wether this is - due to some error in \thepackage\ or something caused by - \pkg{caption} (or another dependency). - \item[\#7] As of a recent update to \pkg{xparse}, the \opt{twocolumn} - option is broken. When loading \thepackage\ with that option, - \pkg{xparse} emits a warning stating that \enquote{Argument - specification for expandable command ends with optional - argument}. Presumably this is because environments are now - defined using expandable macros, whereas they weren't before. - %It's a tricky one to solve while keeping the \env{figure} and - %\env{table} environments API-compatible across \opt{onecolumn} - %and \opt{twocolumn} documents. - \end{description} - If you discover any bugs in this package, please report them to the issue - tracker in the \thepackage\ Github repository. - - \Implementation - \section{Implementation} - Start with the standard \LaTeX\ cruft. -\begin{MacroCode}{class} -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesClass{skrapport}% - [2013/01/09 v0.10a Skånings rapportklass] -\end{MacroCode} - Then, start by including \pkg{kvoptions} and defining some - variables for future use. -\begin{MacroCode}{class} -\RequirePackage{xparse,xstring} -\RequirePackage{kvoptions} -\SetupKeyvalOptions{family=skrapport,prefix=skrapport@} -\newcommand\@ptsize{} -\IfFileExists{ifxetex.sty}{% - \RequirePackage{ifxetex}% -}{% - \newif\ifxetex\xetexfalse% -} -\end{MacroCode} - - \subsection{Options} - \begin{option}{paper}{a4paper, a5paper} - \begin{option}{a4paper} - \begin{option}{a5paper} - Declare the paper size options. -\begin{MacroCode}{class} -\DeclareStringOption[a4paper]{paper} -\DeclareVoidOption{a4paper}{\skrapport@SetupPaper} -\DeclareVoidOption{a5paper}{\skrapport@SetupPaper} -\newcommand*{\skrapport@SetupPaper}{\expandafter\@skrapport@SetupPaper\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupPaper}[1]{\setkeys{skrapport}{paper={#1}}} -\end{MacroCode} - \end{option} - \end{option} - \end{option} - - \begin{option}{ptsize}{10pt, 11pt, 12pt} - \begin{option}{10pt} - \begin{option}{11pt} - \begin{option}{12pt} - Declare point size options. -\begin{MacroCode}{class} -\DeclareStringOption[11pt]{ptsize} -\DeclareVoidOption{10pt}{\skrapport@SetupPtsize} -\DeclareVoidOption{11pt}{\skrapport@SetupPtsize} -\DeclareVoidOption{12pt}{\skrapport@SetupPtsize} -\newcommand*{\skrapport@SetupPtsize}{\expandafter\@skrapport@SetupPtsize\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupPtsize}[1]{\setkeys{skrapport}{ptsize={#1}}} -\end{MacroCode} - \end{option} - \end{option} - \end{option} - \end{option} - - \begin{option}{twocolumn} - \changes{0.08}{Added option \opt{twocolumn}} - \begin{option}{onecolumn} - Declare column options. -\begin{MacroCode}{class} -\DeclareBoolOption[false]{twocolumn} -\DeclareComplementaryOption{onecolumn}{twocolumn} -\end{MacroCode} - \end{option} - \end{option} - - \begin{option}{draft} - \begin{option}{final} - Declare \opt{draft} and \opt{final} options. -\begin{MacroCode}{class} -\DeclareBoolOption[false]{draft} -\DeclareComplementaryOption{final}{draft} -\end{MacroCode} - \end{option} - \end{option} - - - Declare the \opt{fleqn} and \opt{leqno} options for - compatibility with the \pkg{article} class. - \begin{option}{leqno} -\begin{MacroCode}{class} -\DeclareBoolOption[false]{leqno} -\end{MacroCode} - \end{option} - \begin{option}{fleqn} -\begin{MacroCode}{class} -\DeclareBoolOption[false]{fleqn} -\end{MacroCode} - \end{option} - - \begin{option}{titles}{rm, bf, sf} - Declare options for section titles. - \begin{option}{rmtitles} - \begin{option}{bftitles} - \begin{option}{sftitles} - \changes{0.09}{Added \opt{sftitles} option} -\begin{MacroCode}{class} -\DeclareStringOption[rm]{titles} -\DeclareVoidOption{rmtitles}{\skrapport@SetupTitles} -\DeclareVoidOption{bftitles}{\skrapport@SetupTitles} -\DeclareVoidOption{sftitles}{\skrapport@SetupTitles} -\newcommand*{\skrapport@SetupTitles}{\expandafter\@skrapport@SetupTitles\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupTitles}[1]{% - \IfStrEq{#1}{bftitles}{% - \setkeys{skrapport}{titles={bf}}% - }{\IfStrEq{#1}{sftitles}{% - \setkeys{skrapport}{titles={sf}}% - }{ - \setkeys{skrapport}{titles={rm}}% - }}} -\end{MacroCode} - \end{option} - \end{option} - \end{option} - \end{option} - - \begin{option}{swe} - \begin{option}{eng} - Declare options for swedish/english \pkg{babel} or - \pkg{polyglossia} support. -\begin{MacroCode}{class} -\DeclareBoolOption[false]{eng} -\DeclareComplementaryOption{swe}{eng} -\end{MacroCode} - \end{option} - \end{option} - - \begin{option}{font}{nofont, kpfonts, lmodern, palatino} - Declare font options. - \begin{option}{kpfonts} - \changes{0.07}{Added option \opt{kpfonts}, set as default - option for fonts} - \begin{option}{lmodern} - \begin{option}{palatino} - \begin{option}{nofont} -\begin{MacroCode}{class} -\DeclareStringOption[kpfonts]{font} -\DeclareVoidOption{kpfonts}{\skrapport@SetupFont} -\DeclareVoidOption{lmodern}{\skrapport@SetupFont} -\DeclareVoidOption{palatino}{\skrapport@SetupFont} -\DeclareVoidOption{nofont}{\skrapport@SetupFont} -\newcommand*{\skrapport@SetupFont}{\expandafter\@skrapport@SetupFont\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupFont}[1]{\setkeys{skrapport}{font={#1}}} -\end{MacroCode} - \end{option} - \end{option} - \end{option} - \end{option} - \end{option} - - \begin{option}{indent} - \changes{0.02}{Added option of indented paragraphs} - \begin{option}{noindent} - Declare indentation options. -\begin{MacroCode}{class} -\DeclareBoolOption[false]{indent} -\DeclareComplementaryOption{noindent}{indent} -\end{MacroCode} - \end{option} - \end{option} - - \begin{option}{color} - \changes{0.09}{Added \opt{color} option} - \begin{option}{nocolor} - Declare color options. -\begin{MacroCode}{class} -\DeclareBoolOption[true]{color} -\DeclareComplementaryOption{nocolor}{color} -\end{MacroCode} - \end{option} - \end{option} - - \begin{option}{math} - \begin{option}{nomath} - Declare math options. -\begin{MacroCode}{class} -\DeclareBoolOption[true]{math} -\DeclareComplementaryOption{nomath}{math} -\end{MacroCode} - \end{option} - \end{option} - - Execute default options and process given options. -\begin{MacroCode}{class} -\ProcessKeyvalOptions* -\end{MacroCode} - - \subsection{Loading packages} - \subsubsection{Optional packages} - Require packages as per given options. Start with the paper size. -\begin{MacroCode}{class} -\IfStrEq{\skrapport@paper}{a4paper}{% - \RequirePackage[a4paper]{geometry} - \setlength\paperheight {297mm} - \setlength\paperwidth {210mm} -}{\IfStrEq{\skrapport@paper}{a5paper}{% - \RequirePackage[a5paper]{geometry} - \setlength\paperheight {210mm} - \setlength\paperwidth {148mm} -}{% - \ClassError{skrapport}{% - Option `paper' has unknown value `\skrapport@paper'! - }{} -}} -\end{MacroCode} - - \begin{macro}{\@ptsize} - Follow up with the point size. -\begin{MacroCode}{class} -\IfStrEq{\skrapport@ptsize}{10pt}{% - \renewcommand\@ptsize{0} -}{% - \IfStrEq{\skrapport@ptsize}{11pt}{% - \renewcommand\@ptsize{1} - }{% - \IfStrEq{\skrapport@ptsize}{12pt}{% - \renewcommand\@ptsize{2} - }{% - \ClassError{skrapport}{% - Option `ptsize' has unknown value `\skrapport@ptsize'! - }{} - } - } -} -\end{MacroCode} - \end{macro} - - Setting \opt{draft} mode is fairly easy, we only need - \cs{overfullrule}s. -\begin{MacroCode}{class} -\ifskrapport@draft - \setlength\overfullrule{5pt} -\else - \setlength\overfullrule{0pt} -\fi -\end{MacroCode} - - Load \file{leqno.clo} and \file{fleqno.clo} if those options are desired. -\begin{MacroCode}{class} -\ifskrapport@leqno\input{leqno.clo}\fi -\ifskrapport@fleqn\input{fleqn.clo}\fi -\end{MacroCode} - - \begin{macro*}{\@titstyle} - Set the title font as prescribed. -\begin{MacroCode}{class} -\IfStrEq{\skrapport@titles}{bf}{% - \let\@titstyle\bfseries% -}{\IfStrEq{\skrapport@titles}{sf}{% - \let\@titstyle\sffamily\bfseries% -}{% - \let\@titstyle\relax% -}} -\end{MacroCode} - \end{macro*} - - Now things get tricky. If we are using \hologo{XeTeX}, we don't - want \pkg{fontenc} because it makes no sense. We \emph{do} want - \pkg{fontspec}, though, because we want to be able to specify - fonts. We also include a \cs{nobreakspace} macro which seems to - be broken in \hologo{XeTeX}. -\begin{MacroCode}{class} -\ifxetex - \RequirePackage[quiet]{fontspec} -\end{MacroCode} - \begin{macro}{\nobreakspace} -\begin{MacroCode}{class} - \DeclareRobustCommand\nobreakspace{\leavevmode\nobreak\space} -\end{MacroCode} - \end{macro} -\begin{MacroCode}{class} -\else - \RequirePackage[T1]{fontenc} -\fi -\end{MacroCode} - - The \opt{color} option requires both \pkg{etoolbox} and - \pkg{xcolor} to be loaded. -\begin{MacroCode}{class} -\ifskrapport@color - \RequirePackage{etoolbox} - \RequirePackage{xcolor} -\fi -\end{MacroCode} - - We also need to handle the \opt{font} option. Note that we only - load \pkg{tpagella} if it exists, and fall back to \pkg{mathpazo} - otherwise. -\begin{MacroCode}{class} -\IfStrEq{\skrapport@font}{nofont}{}{% - \IfStrEq{\skrapport@font}{kpfonts}{% - \RequirePackage[easyscsl,intlimits,sumlimits]{kpfonts} - }{% - \IfStrEq{\skrapport@font}{palatino}{% - \IfFileExists{tgpagella.sty}{% - \RequirePackage{tgpagella} - }{% - \RequirePackage[sc]{mathpazo} - } - }{% - \IfStrEq{\skrapport@font}{lmodern}{% - \RequirePackage{lmodern} - }{% - \ClassError{skrapport}{% - Option `font' has unknown value `\skrapport@font'! - }{} - } - } - } -} -\end{MacroCode} - - Language options follow. It it a bit convoluted since we load - \pkg{polyglossia} in \hologo{XeTeX} and \pkg{babel} in \TeX, - but it's fairly easy to follow. -\begin{MacroCode}{class} -\ifxetex - \RequirePackage{xkeyval} - \RequirePackage{polyglossia} - \ifskrapport@eng - \setmainlanguage[variant=british]{english} - \setotherlanguage{swedish} - \else - \setmainlanguage{swedish} - \setotherlanguage[variant=british]{english} - \fi -\else - \ifskrapport@eng - \RequirePackage[swedish,british]{babel} - \else - \RequirePackage[british,swedish]{babel} - \fi -\fi -\end{MacroCode} - - Two-column mode requires \pkg{etoolbox} and \pkg{multicol}. -\begin{MacroCode}{class} -\ifskrapport@twocolumn - \RequirePackage{etoolbox} - \RequirePackage{multicol} -\fi -\end{MacroCode} - - \subsubsection{Required packages} - We also include some essential packages per default. The - \pkg{calc} package, for instance, is essential in later - definitions. -\begin{MacroCode}{class} -\RequirePackage{calc} -\end{MacroCode} - - At the end of the class definition we load a couple of very - useful packages that improve typesetting. These are - \pkg{microtype}, \pkg{icomma} and \pkg{amsmath}. Additionally, - we load \pkg{skmath} if it exists and is wanted, and unless we - are using KP-Fonts, we load \pkg{amssymb} and \pkg{textcomp} (the - reason being that \pkg{kpfonts} load these packages itself, see - \textcite[p.~1]{kpfonts}, and we don't want conflicting options). -\begin{MacroCode}{class} -\AtEndOfClass{ - \RequirePackage{microtype} - \RequirePackage{icomma} - \IfStrEq{\skrapport@font}{kpfonts}{}{\RequirePackage[intlimits]{amsmath}} - \let\Finv\relax - \let\Game\relax - \let\beth\relax - \let\gimel\relax - \let\daleth\relax - \IfStrEq{\skrapport@font}{kpfonts}{}{\RequirePackage{amssymb}} - \IfStrEq{\skrapport@font}{kpfonts}{}{\RequirePackage{textcomp}} - \ifskrapport@math\IfFileExists{skmath.sty}{\RequirePackage{skmath}}{}\fi -} -\end{MacroCode} - - When the document starts, we set the URL style if the user has - loaded the \pkg{url} package. -\begin{MacroCode}{class} -\AtBeginDocument{ - \@ifundefined{urlstyle}{}{\urlstyle{same}} -} -\end{MacroCode} - - Lastly, we include the correct point size \texttt{.clo} file from the - \pkg{article} class. -\begin{MacroCode}{class} -\input{size1\@ptsize.clo} -\end{MacroCode} - - \subsection{Hidden things} - Set some default measurements. -\begin{MacroCode}{class} -\addtolength\textwidth{0.5\oddsidemargin} -\addtolength\textwidth{0.5\evensidemargin} -\addtolength\oddsidemargin{-0.5\oddsidemargin} -\addtolength\evensidemargin{-0.5\evensidemargin} -\setlength\lineskip{1\p@} -\setlength\normallineskip{1\p@} -\end{MacroCode} - \begin{macro}{\baselinestretch} -\begin{MacroCode}{class} -\renewcommand\baselinestretch{} -\end{MacroCode} - \end{macro} - - \subsubsection{Indentation} - Indentation code. Undo the indentation set by the \pkg{article} - class if indentation was requested by the user. See the - \pkg{parskip} package for further information. Enable french - spacing as well. -\begin{MacroCode}{class} -\ifskrapport@indent\else - \setlength\parskip{0.5\baselineskip \@plus 2pt} - \parindent=\z@ - \setlength\parfillskip{30\p@ \@plus 1fil} -\end{MacroCode} - \begin{macro*}{\@listI} - \begin{macro*}{\@listi} -\begin{MacroCode}{class} - \def\@listI{\leftmargin\leftmargini - \topsep\z@ \parsep\parskip \itemsep\z@} - \let\@listi\@listI -\end{MacroCode} - \end{macro*} - \end{macro*} -\begin{MacroCode}{class} - \@listi -\end{MacroCode} - \begin{macro*}{\@listii} -\begin{MacroCode}{class} - \def\@listii{\leftmargin\leftmarginii - \labelwidth\leftmarginii\advance\labelwidth-\labelsep - \topsep\z@ \parsep\parskip \itemsep\z@} -\end{MacroCode} - \end{macro*} - \begin{macro*}{\@listiii} -\begin{MacroCode}{class} - \def\@listiii{\leftmargin\leftmarginiii - \labelwidth\leftmarginiii\advance\labelwidth-\labelsep - \topsep\z@ \parsep\parskip \itemsep\z@} -\end{MacroCode} - \end{macro*} -\begin{MacroCode}{class} - \partopsep=\z@ - \@ifundefined{CheckCommand}{}{% - \CheckCommand*{\@starttoc}[1]{% - \begingroup - \makeatletter - \@input{\jobname.#1}% - \if@filesw - \expandafter\newwrite\csname tf@#1\endcsname - \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax - \fi - \@nobreakfalse - \endgroup}} -\end{MacroCode} - \begin{macro*}{\@starttoc} -\begin{MacroCode}{class} - \renewcommand*{\@starttoc}[1]{% - \begingroup - \makeatletter - \parskip\z@ - \@input{\jobname.#1}% - \if@filesw - \expandafter\newwrite\csname tf@#1\endcsname - \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax - \fi - \@nobreakfalse - \endgroup} -\end{MacroCode} - \end{macro*} -\begin{MacroCode}{class} -\fi -\frenchspacing -\end{MacroCode} - - \subsubsection{Penalties} -\begin{MacroCode}{class} -\@lowpenalty 51 -\@medpenalty 151 -\@highpenalty 301 -\setcounter{topnumber}{2} -\setcounter{bottomnumber}{1} -\setcounter{totalnumber}{4} -\setcounter{dbltopnumber}{2} -\end{MacroCode} - \begin{macro*}{\topfraction} - \begin{macro*}{\bottomfraction} - \begin{macro*}{\textfraction} - \begin{macro*}{\floatpagefraction} - \begin{macro*}{\dbltopfraction} - \begin{macro*}{\dblfloatpagefraction} -\begin{MacroCode}{class} -\renewcommand\topfraction{.75} -\renewcommand\bottomfraction{.5} -\renewcommand\textfraction{.25} -\renewcommand\floatpagefraction{.625} -\renewcommand\dbltopfraction{.75} -\renewcommand\dblfloatpagefraction{.625} -\end{MacroCode} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - - \subsection{User-level commands} - \subsubsection{The front page} - \begin{macro}{\author} - \changes{0.10b}{Improved \cs{author} macro} - The \cs{author} macro is redefined to accept an optional argument - and to be used multiple times. - \begin{macro*}{\skrapport@email} - The \cs{skrapport@email} helper macro typesets an email address - using \pkg{hyperref} if that package is used. This is suboptimal, - the macro behaves differently with respect to special characters - depending on wether \pkg{hyperref} is loaded or not. -\begin{MacroCode}{class} -\ProvideDocumentCommand\skrapport@email{m}{\texttt{#1}} -\AtBeginDocument{ - \@ifpackageloaded{hyperref}{% - \DeclareDocumentCommand\skrapport@email{m}{% - \href{mailto:#1}{\nolinkurl{#1}}% - }% - }{}% -} -\end{MacroCode}{class} - \end{macro*} - \begin{macro*}{\@author} -\begin{MacroCode}{class} -\def\@author{\relax} -\DeclareDocumentCommand\author{om}{% - \def\skrapport@tempi{#2\IfNoValueTF{#1}{}{~$\langle$\skrapport@email{#1}$\rangle$}} - \if\@author\relax - \xdef\@author{\skrapport@tempi} - \else - \expandafter\gdef\expandafter\@author\expandafter{\@author\\[0.5ex]\skrapport@tempi} - \fi -} -\end{MacroCode} - \end{macro*} - \end{macro} - - \begin{macro}{\regarding} - This macro defines a variable used by \cs{maketitle} to insert a - simple text into the header on the title page. - \begin{macro*}{\@regarding} -\begin{MacroCode}{class} -\def\@regarding{\relax} -\newcommand{\regarding}[1]{\gdef\@regarding{#1}} -\end{MacroCode} - \end{macro*} - \end{macro} - - \begin{macro}{\license} - \changes{0.07}{Added command \cs{license}} - This macro defines a variable used by \cs{maketitle} to insert a - license into the footer on the titlepage. - \begin{macro*}{\@copyright} -\begin{MacroCode}{class} -\def\@copyright{\relax} -\newcommand{\license}[1]{\gdef\@copyright{#1}} -\end{MacroCode} - \end{macro*} - \end{macro} - - \begin{macro}{\maketitle} - The standard \cs{maketitle} command as taken from the \pkg{article} - class but with some basic restyling. -\begin{MacroCode}{class} -\let\@smallprintstyle\relax -\newcommand\maketitle{\par% - \begingroup - \renewcommand\thefootnote{\@fnsymbol\c@footnote}% - \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% - \long\def\@makefntext##1{\parindent 1em\noindent% - \hb@xt@1.8em{\hss\@textsuperscript{\normalfont\@thefnmark}}##1}% - \newpage - \global\@topnum\z@ - \@maketitle - \thispagestyle{plain}\@thanks - \endgroup - \setcounter{footnote}{0}% -} -\end{MacroCode} - \end{macro} - \begin{macro*}{\@maketitle} -\begin{MacroCode}{class} -\def\@maketitle{% - \newpage - \null - \begin{flushleft}% - \vspace{-\headsep} - {\small% - \@smallprintstyle - \if\@regarding\relax\else\@regarding{, }\fi% - \@date\par% - }% - \vspace{1.5cm}% - {\Huge\@titstyle\@title\par}% - \vspace{.125cm}% - {\Large\@titstyle\@author}% - \vspace{.75cm}% - \end{flushleft}% - \par% -} -\end{MacroCode} - \end{macro*} - - \begin{environment}{abstract} - Standard restyled \env{abstract} environment from the - \pkg{article} class. -\begin{MacroCode}{class} -\newenvironment{abstract}{\newlength\skrapport@abstract@tw\newlength\skrapport@abstract@aw\settowidth{\skrapport@abstract@tw}{\bfseries\abstractname}\setlength{\skrapport@abstract@aw}{\the\textwidth-\the\skrapport@abstract@tw-1em}\begin{minipage}[t]{\skrapport@abstract@tw}\begin{flushright}\leavevmode\bfseries\abstractname\end{flushright}\end{minipage}\hspace{1em}\begin{minipage}[t]{\skrapport@abstract@aw}}{\end{minipage}} -\end{MacroCode} - \end{environment} - - \begin{environment}{titlepage} - Titlepage environment. - \begin{macro*}{\ps@skrapport@titlepage} -\begin{MacroCode}{class} -\newcommand\ps@skrapport@titlepage{\def\@oddhead{}\def\@evenhead{}\def\@oddfoot{\begin{minipage}{\textwidth}\raggedleft\small\par\@smallprintstyle\@copyright\end{minipage}}\let\@evenfoot\@oddfoot} -\end{MacroCode} - \end{macro*} -\begin{MacroCode}{class} -\newenvironment{titlepage}{\cleardoublepage\setcounter{page}\@ne}{\thispagestyle{skrapport@titlepage}\cleardoublepage\setcounter{page}\@ne} -\end{MacroCode} - \end{environment} - - \subsubsection{Sectioning} - Sectioning commands. -\begin{MacroCode}{class} -\setcounter{secnumdepth}{3} -\newcounter{section} -\newcounter{subsection}[section] -\newcounter{subsubsection}[subsection] -\newcounter{paragraph}[subsubsection] -\newcounter{subparagraph}[paragraph] -\end{MacroCode} - \begin{macro*}{\thesection} - \begin{macro*}{\thesubsection} - \begin{macro*}{\thesubsubsection} - \begin{macro*}{\theparagraph} - \begin{macro*}{\thesubparagraph} -\begin{MacroCode}{class} -\renewcommand\thesection{\@arabic\c@section} -\renewcommand\thesubsection{\thesection.\@arabic\c@subsection} -\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection} -\renewcommand\theparagraph{\thesubsubsection.\@arabic\c@paragraph} -\renewcommand\thesubparagraph{\theparagraph.\@arabic\c@subparagraph} -\end{MacroCode} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \begin{macro}{\section} -\begin{MacroCode}{class} -\newcommand\section{\@startsection{section}{1}{\z@}% - {-4ex \@plus 1ex \@minus -1ex}% - {.5ex \@plus.5ex}% - {\normalfont\LARGE\@titstyle}} -\end{MacroCode} - \end{macro} - \begin{macro}{\subsection} -\begin{MacroCode}{class} -\newcommand\subsection{\@startsection{subsection}{2}{\z@}% - {-3ex \@plus 1ex \@minus -1ex}% - {.25ex \@plus.25ex}% - {\normalfont\Large\@titstyle}} -\end{MacroCode} - \end{macro} - \begin{macro}{\subsubsection} -\begin{MacroCode}{class} -\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% - {-2ex \@plus .5ex \@minus -.5ex}% - {.125ex \@plus.125ex}% - {\normalfont\large\@titstyle}} -\end{MacroCode} - \end{macro} - \begin{macro}{\paragraph} -\begin{MacroCode}{class} -\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}% - {1ex \@plus .25ex \@minus -.25ex}% - {-1em}% - {\normalfont\normalsize\bfseries}} -\end{MacroCode} - \end{macro} - \begin{macro}{\subparagraph} -\begin{MacroCode}{class} -\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% - {1ex \@plus .25ex \@minus -.25ex}% - {-1em}% - {\normalfont\normalsize\itshape}} -\end{MacroCode} - \end{macro} - - \subsubsection{Commands from \pkg{article}} - Itemization commands. -\begin{MacroCode}{class} -\setlength\leftmargini{2em} -\leftmargin\leftmargini -\setlength\leftmarginii{2em} -\setlength\leftmarginiii{1.5em} -\setlength\leftmarginiv{1.5em} -\setlength\leftmarginv{1em} -\setlength\leftmarginvi{1em} -\setlength\labelsep{.5em} -\setlength\labelwidth{\leftmargini} -\addtolength\labelwidth{-\labelsep} -\@beginparpenalty -\@lowpenalty -\@endparpenalty -\@lowpenalty -\@itempenalty -\@lowpenalty -\end{MacroCode} - \begin{macro*}{\theenumi} - \begin{macro*}{\theenumii} - \begin{macro*}{\theenumiii} - \begin{macro*}{\theenumiv} -\begin{MacroCode}{class} -\renewcommand\theenumi{\@arabic\c@enumi} -\renewcommand\theenumii{\@alph\c@enumii} -\renewcommand\theenumiii{\@roman\c@enumiii} -\renewcommand\theenumiv{\@Alph\c@enumiv} -\end{MacroCode} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \begin{macro*}{\labelenumi} - \begin{macro*}{\labelenumii} - \begin{macro*}{\labelenumiii} - \begin{macro*}{\labelenumiv} -\begin{MacroCode}{class} -\newcommand\labelenumi{\theenumi.} -\newcommand\labelenumii{\theenumii)} -\newcommand\labelenumiii{\theenumiii.} -\newcommand\labelenumiv{\theenumiv.} -\end{MacroCode} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \begin{macro*}{\p@enumii} - \begin{macro*}{\p@enumiii} - \begin{macro*}{\p@enumiiv} -\begin{MacroCode}{class} -\renewcommand\p@enumii{\theenumi} -\renewcommand\p@enumiii{\theenumi(\theenumii)} -\renewcommand\p@enumiv{\p@enumiii\theenumiii} -\end{MacroCode} - \end{macro*} - \end{macro*} - \end{macro*} - \begin{macro*}{\labelitemi} - \begin{macro*}{\labelitemii} - \begin{macro*}{\labelitemiii} - \begin{macro*}{\labelitemiv} -\begin{MacroCode}{class} -\newcommand\labelitemi{\textbullet} -\newcommand\labelitemii{\textopenbullet} -\newcommand\labelitemiii{\normalfont\bfseries\textendash} -\newcommand\labelitemiv{\textrightarrow} -\end{MacroCode} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \begin{environment}{description} -\begin{MacroCode}{class} -\newenvironment{description} - {\list{}{\labelwidth\z@\itemindent-\leftmargin - \let\makelabel\descriptionlabel}}{\endlist} -\newcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bfseries #1} -\end{MacroCode} - \end{environment} - - Quotation environments. - \begin{environment}{quote} -\begin{MacroCode}{class} -\newenvironment{quote}{\list{}{\rightmargin\leftmargin}\item\relax\itshape}{\endlist} -\end{MacroCode} - \end{environment} - \begin{environment}{quotation} -\begin{MacroCode}{class} -\newenvironment{quotation}{\bigskip\begin{quote}}{\end{quote}\bigskip} -\end{MacroCode} - \end{environment} - \begin{environment}{verse} -\begin{MacroCode}{class} -\newenvironment{verse}{\begin{quote}}{\end{quote}} -\end{MacroCode} - \end{environment} - - \begin{macro}{\appendix} - Appendix macro. -\begin{MacroCode}{class} -\newcommand\appendix{\par\setcounter{section}{0}\setcounter{subsection}{0}\gdef\thesection{\@Alph\c@section}} -\end{MacroCode} - \end{macro} - - Old font commands. - \begin{macro}{\rm} -\begin{MacroCode}{class} -\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} -\end{MacroCode} - \end{macro} - \begin{macro}{\sf} -\begin{MacroCode}{class} -\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} -\end{MacroCode} - \end{macro} - \begin{macro}{\tt} -\begin{MacroCode}{class} -\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} -\end{MacroCode} - \end{macro} - \begin{macro}{\bf} -\begin{MacroCode}{class} -\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} -\end{MacroCode} - \end{macro} - \begin{macro}{\it} -\begin{MacroCode}{class} -\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} -\end{MacroCode} - \end{macro} - \begin{macro}{\sl} -\begin{MacroCode}{class} -\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} -\end{MacroCode} - \end{macro} - \begin{macro}{\sc} -\begin{MacroCode}{class} -\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} -\end{MacroCode} - \end{macro} - - \begin{macro}{\emph} - Redefining the \cs{emph} style to be bold when nested. - \begin{macro*}{\em} -\begin{MacroCode}{class} -\let\@emstyle\relax -\DeclareRobustCommand\em{% - \@nomath\em% - \ifdim \fontdimen\@ne\font >\z@% - \itshape\bfseries% - \else% - \itshape% - \fi% - \@emstyle% -} -\end{MacroCode} - \end{macro*} - \end{macro} - - \begin{macro*}{\footnoterule} - Footnote code. - \begin{macro*}{\@makefntext} -\begin{MacroCode}{class} -\renewcommand\footnoterule{% - \kern-3\p@ - \hrule\@width.4\columnwidth - \kern2.6\p@} -\newcommand\@makefntext[1]{% - \parindent 1em% - \noindent - \hb@xt@1.8em{\hss\@makefnmark}#1} -\end{MacroCode} - \end{macro*} - \end{macro*} - - Basic translatable texts. - \begin{macro}{\contentsname} -\begin{MacroCode}{class} -\newcommand\contentsname{Innehåll} -\end{MacroCode} - \end{macro} - \begin{macro}{\refname} -\begin{MacroCode}{class} -\newcommand\refname{Referenser} -\end{MacroCode} - \end{macro} - \begin{macro}{\figurename} -\begin{MacroCode}{class} -\newcommand\figurename{Figur} -\end{MacroCode} - \end{macro} - \begin{macro}{\tablename} -\begin{MacroCode}{class} -\newcommand\tablename{Tabell} -\end{MacroCode} - \end{macro} - \begin{macro}{\appendixname} -\begin{MacroCode}{class} -\newcommand\appendixname{Bilaga} -\end{MacroCode} - \end{macro} - \begin{macro}{\abstractname} -\begin{MacroCode}{class} -\newcommand\abstractname{Sammanfattning} -\end{MacroCode} - \end{macro} - \begin{macro}{\today} -\begin{MacroCode}{class} -\def\today{\year--\month--\day} -\end{MacroCode} - \end{macro} - - \subsubsection{Floats} - Figure and table floats. -\begin{MacroCode}{class} -\setlength\arraycolsep{5\p@} -\setlength\tabcolsep{6\p@} -\setlength\arrayrulewidth{.4\p@} -\setlength\doublerulesep{2\p@} -\setlength\tabbingsep{\labelsep} -\skip\@mpfootins=\skip\footins -\setlength\fboxsep{3\p@} -\setlength\fboxrule{.4\p@} -\end{MacroCode} - \begin{macro*}{\theequation} -\begin{MacroCode}{class} -\renewcommand\theequation{\@arabic\c@equation} -\end{MacroCode} - \end{macro*} -\begin{MacroCode}{class} -\newcounter{figure}\renewcommand\thefigure{\@arabic\c@figure} -\def\fps@figure{tb} -\def\ftype@figure{1} -\def\ext@figure{lof} -\def\fnum@figure{\figurename~\thefigure} -\end{MacroCode} - \begin{environment}{figure} - \begin{environment*}{figure*} -\begin{MacroCode}{class} -\newenvironment{figure}{\@float{figure}}{\end@float} -\newenvironment{figure*}{\@dblfloat{figure}}{\end@dblfloat} -\end{MacroCode} - \end{environment*} - \end{environment} -\begin{MacroCode}{class} -\newcounter{table}\renewcommand\thetable{\@arabic\c@table} -\def\fps@table{tb} -\def\ftype@table{2} -\def\ext@table{lot} -\def\fnum@table{\tablename~\thetable} -\end{MacroCode} - \begin{environment}{table} - \begin{environment*}{table*} -\begin{MacroCode}{class} -\newenvironment{table}{\@float{table}}{\end@float} -\newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat} -\end{MacroCode} - \end{environment*} - \end{environment} - - Captions. -\begin{MacroCode}{class} -\let\@captionstyle\relax -\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@} -\newlength\belowcaptionskip\setlength\belowcaptionskip{10\p@} -\end{MacroCode} - \begin{macro*}{\@makecaption} -\begin{MacroCode}{class} -\long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{\small{\bfseries#1:} \itshape#2}% - \ifdim \wd\@tempboxa >\hsize - \small{\bfseries\@captionstyle#1:} \itshape#2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% - \fi - \vskip\belowcaptionskip} -\end{MacroCode} - \end{macro*} - - \subsubsection{Table of contents} -\begin{MacroCode}{class} -\newcommand\@pnumwidth{1.55em} -\newcommand\@tocrmarg{2em} -\newcommand\@dotsep{1.7} -\setcounter{tocdepth}{5} -\end{MacroCode} - \begin{macro}{\tableofcontents} -\begin{MacroCode}{class} -\newcommand\tableofcontents{% - \section*{\contentsname - \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname} - }% - \vskip\baselineskip% - \@starttoc{toc}% -} -\end{MacroCode} - \end{macro} - \begin{macro*}{\l@section} - \begin{macro*}{\l@subsection} - \begin{macro*}{\l@subsubsection} - \begin{macro*}{\l@paragraph} - \begin{macro*}{\l@subparagraph} -\begin{MacroCode}{class} -\newcommand*\l@section{\@dottedtocline{1}{0em}{1.3em}} -\newcommand*\l@subsection{\@dottedtocline{2}{1.3em}{2em}} -\newcommand*\l@subsubsection{\@dottedtocline{3}{3.3em}{3.15em}} -\newcommand*\l@paragraph{\@dottedtocline{4}{6.45em}{4.15em}} -\newcommand*\l@subparagraph{\@dottedtocline{5}{10.6em}{5.15em}} -\end{MacroCode} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - \end{macro*} - - Fix for \emph{e.g.}~\pkg{tocloft} package. -\begin{MacroCode}{class} -\let\l@figure\@empty -\let\l@table\@empty -\end{MacroCode} - - \subsubsection{Basic bibliography support} -\begin{MacroCode}{class} -\newdimen\bibindent -\setlength\bibindent{2em} -\end{MacroCode} - \begin{environment}{thebibliography} -\begin{MacroCode}{class} -\newenvironment{thebibliography}[1] - {\section*{\refname}% - \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}% - \list{\@biblabel{\@arabic\c@enumiv}}% - {\settowidth\labelwidth{\@biblabel{#1}}% - \leftmargin\labelwidth - \advance\leftmargin\labelsep - \@openbib@code - \usecounter{enumiv}% - \let\p@enumiv\@empty - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy - \clubpenalty4000 - \@clubpenalty \clubpenalty - \widowpenalty4000}% - {\def\@noitemerr - {\@latex@warning{Empty ‘thebibliography’ environment}}% - \endlist} -\end{MacroCode} - \end{environment} - \begin{macro*}{\newblock} -\begin{MacroCode}{class} -\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em} -\end{MacroCode} - \end{macro*} -\begin{MacroCode}{class} -\let\@openbib@code\@empty -\end{MacroCode} - \begin{environment}{theindex} -\begin{MacroCode}{class} -\newenvironment{theindex} - {\twocolumn[\section*{\indexname}]% - \@mkboth{\MakeUppercase\indexname}% - {\MakeUppercase\indexname}% - \thispagestyle{plain}\parindent\z@ - \parskip\z@ \@plus .3\p@\relax - \columnseprule \z@ - \columnsep 35\p@ - \let\item\@idxitem} - {\onecolumn} -\end{MacroCode} - \end{environment} - \begin{macro*}{\@idxitem} -\begin{MacroCode}{class} -\newcommand\@idxitem{\par\hangindent 40\p@} -\end{MacroCode} - \end{macro*} - \begin{macro}{\subitem} -\begin{MacroCode}{class} -\newcommand\subitem{\@idxitem \hspace*{20\p@}} -\end{MacroCode} - \end{macro} - \begin{macro}{\subsubitem} -\begin{MacroCode}{class} -\newcommand\subsubitem{\@idxitem \hspace*{30\p@}} -\end{MacroCode} - \end{macro} - \begin{macro*}{\indexspace} -\begin{MacroCode}{class} -\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} -\end{MacroCode} - \end{macro*} - - \subsubsection{Two-column mode} - The twocolumn hacks implemented. -\begin{MacroCode}{class} -\ifskrapport@twocolumn - \AtBeginDocument{ -\end{MacroCode} - We include the \pkg{grid} package in two-column mode, because - it looks way better that way. -\begin{MacroCode}{class} - \IfStrEq{\skrapport@paper}{a4paper} - {\def\@@@lines{40}}{\def\@@@lines{28}} - \IfStrEq{\skrapport@ptsize}{10pt}{ - \RequirePackage[fontsize=10pt,% - baseline=12pt,% - lines=\@@@lines]{grid} - }{ - \IfStrEq{\skrapport@ptsize}{11pt}{ - \RequirePackage[fontsize=11pt,% - baseline=13.2pt,% - lines=\@@@lines]{grid} - }{ - \RequirePackage[fontsize=12pt,% - baseline=14.4pt,% - lines=\@@@lines]{grid} - } - } -\end{MacroCode} - Now, we patch commands. First up is \env{abstract}. -\begin{MacroCode}{class} - \renewenvironment{abstract}{\section*{\abstractname}}{} -\end{MacroCode} - Then \env{document} and \cs{maketitle}. -\begin{MacroCode}{class} - \AfterEndPreamble{\begin{multicols}{2}} - \AtEndDocument{\end{multicols}} - \pretocmd{\maketitle}{\end{multicols}}{}{} - \apptocmd{\maketitle}{\begin{multicols}{2}}{}{} -\end{MacroCode} - Always typeset \env{equation} and friends outside the grid: -\begin{MacroCode}{class} - \BeforeBeginEnvironment{equation}{\begin{gridenv}} - \AfterEndEnvironment{equation}{\end{gridenv}} - \BeforeBeginEnvironment{equation*}{\begin{gridenv}} - \AfterEndEnvironment{equation*}{\end{gridenv}} - \BeforeBeginEnvironment{multline}{\begin{gridenv}} - \AfterEndEnvironment{multline}{\end{gridenv}} - \BeforeBeginEnvironment{multline*}{\begin{gridenv}} - \AfterEndEnvironment{multline*}{\end{gridenv}} - \BeforeBeginEnvironment{gather}{\begin{gridenv}} - \AfterEndEnvironment{gather}{\end{gridenv}} - \BeforeBeginEnvironment{gather*}{\begin{gridenv}} - \AfterEndEnvironment{gather*}{\end{gridenv}} - \BeforeBeginEnvironment{align}{\begin{gridenv}} - \AfterEndEnvironment{align}{\end{gridenv}} - \BeforeBeginEnvironment{align*}{\begin{gridenv}} - \AfterEndEnvironment{align*}{\end{gridenv}} - \BeforeBeginEnvironment{flalign}{\begin{gridenv}} - \AfterEndEnvironment{flalign}{\end{gridenv}} - \BeforeBeginEnvironment{flalign*}{\begin{gridenv}} - \AfterEndEnvironment{flalign*}{\end{gridenv}} - \BeforeBeginEnvironment{alignat}{\begin{gridenv}} - \AfterEndEnvironment{alignat}{\end{gridenv}} - \BeforeBeginEnvironment{alignat*}{\begin{gridenv}} - \AfterEndEnvironment{alignat*}{\end{gridenv}} -\end{MacroCode} - The \env{figure} environment is patched... -\begin{MacroCode}{class} - \expandafter\let\expandafter - \old@figurest\csname figure*\endcsname - \expandafter\let\expandafter - \old@endfigurest\csname endfigure*\endcsname - \RenewDocumentEnvironment{figure}{o}{% - \begin{gridenv}% - \vspace{\intextsep}% - \begin{minipage}{\linewidth}% - \def\@captype{figure}% - }{% - \end{minipage}% - \vspace{\intextsep}% - \end{gridenv}% - } - \RenewDocumentEnvironment{figure*}{o}{\old@figurest}% - {\old@endfigurest} -\end{MacroCode} - ...as is \env{table}. -\begin{MacroCode}{class} - \expandafter\let\expandafter - \old@tablest\csname table*\endcsname - \expandafter\let\expandafter - \old@endtablest\csname endtable*\endcsname - \RenewDocumentEnvironment{table}{o}{% - \begin{gridenv}% - \vspace{\intextsep}% - \begin{minipage}{\linewidth}% - \def\@captype{table}% - \let\@old@caption\caption% - \renewcommand{\caption}[1]{% - \setlength{\@tempdima}{\abovecaptionskip}% - \setlength{\abovecaptionskip}{\belowcaptionskip}% - \setlength{\belowcaptionskip}{\@tempdima}% - \@old@caption{##1}% - \vspace{\belowcaptionskip}% - }% - }{% - \end{minipage}% - \vspace{\intextsep}% - \end{gridenv}% - } - \let\oldoldtablest\oldtablest - \renewcommand{\oldtablest}{% - \oldoldtablest% - \let\@old@caption\caption% - \renewcommand{\caption}[1]{% - \setlength{\@tempdima}{\abovecaptionskip}% - \setlength{\abovecaptionskip}{\belowcaptionskip}% - \setlength{\belowcaptionskip}{\@tempdima}% - \@old@caption{##1}% - \vspace{\belowcaptionskip}% - }% - } - \RenewDocumentEnvironment{table*}{o}{\old@tablest}% - {\old@endtablest} -\end{MacroCode} - \begin{environment}{onecol} - \changes{0.10}{Fixed, now not completely broken} - Finally, we define an environment \env{onecol} that typesets - arbitrary material in a single column. This is a bit tricky to - do, and probably cargo-cult as well. We define the start of the - environment to immediately end itself (with the empty ending), - then end the \env{multiols} environment, redefine our end macro - to start \env{multicols} as well as redefining the start of - \env{onecol} to simply reset itself, then start the environment - again only to have it ended at once. - - Basically, we trick \LaTeX\ into thinking that we have an empty - \env{onecol} environment at the end of the first \env{multicols}, - then some content inside a fake \env{onecol}, then an empty - \env{onecol} at the start of the next \env{multicols}. Voilá, no - wierd group errors! -\begin{MacroCode}{class} - \newenvironment{onecol}{ - \end{onecol} - \end{multicols} - \begingroup - \def\endonecol{ - \endgroup - \begin{multicols}{2} - \let\old@onecol\onecol - \def\onecol{ - \let\onecol\old@onecol - } - \begin{onecol} - } - \def\onecol{} - \begin{onecol} - }{} - } -\end{MacroCode} - \end{environment} -\begin{MacroCode}{class} -\fi -\end{MacroCode} - - \subsubsection{Miscellaneous} - A macro \cs{comment} (alias \cs{com}/\cs{note}) is defined to let - the user add comments and notes to the document. - \begin{macro}{\@comment} -\begin{MacroCode}{class} -\NewDocumentCommand\@comment{m}{% - {\textbf{Comment:} #1}% -} -\end{MacroCode} - \end{macro} - \begin{macro}{\comment} - \changes{0.10}{Added macro for comments} -\begin{MacroCode}{class} -\NewDocumentCommand\comment{sm}{% - \IfBooleanTF{#1}% - {\colorbox{red!50}{\@comment{#2}}}% - {\marginpar{\@comment{#2}}}% -} -\end{MacroCode} - \end{macro} - \begin{macro}{\com} - \begin{macro}{\note} - \changes{0.10b}{Fixed a silly error in \cs{com} and \cs{note}} -\begin{MacroCode}{class} -\ProvideDocumentCommand\com{sm}% - {\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}} -\ProvideDocumentCommand\note{sm}% - {\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}} -\end{MacroCode} - \end{macro} - \end{macro} - - \subsubsection{Color theme support} - Color theme setup. Start by patching commands and declaring - default colors. Not implemented: background colors for e.g. - quote environments and sections headings, different colors - for the different sectioning levels. -\begin{MacroCode}{class} -\ifskrapport@color - \apptocmd{\bfseries}{\color{skrapport@boldcolor}}{}{\ClassError{skrapport}{Could not patch \protect\bfseries}{}} - \apptocmd{\itshape}{\color{skrapport@italiccolor}}{}{\ClassError{skrapport}{Could not patch \protect\itshape}{}} - \if\@titstyle\relax - \def\@titstyle{\color{skrapport@titlecolor}} - \else - \apptocmd{\@titstyle}{\color{skrapport@titlecolor}}{}{\ClassError{skrapport}{Could not patch \protect\@titstyle}{}} - \fi - \def\@smallprintstyle{\color{skrapport@smallprintcolor}} - \AtBeginDocument{% - \let\@abstractname\abstractname - \def\abstractname{\color{skrapport@titlecolor}\@abstractname} - } - \apptocmd{\quote}{\color{skrapport@quotecolor}}{}{} - \def\@captionstyle{\color{skrapport@captioncolor}} - \def\@emstyle{\color{skrapport@emphcolor}} - \ifskrapport@twocolumn\AtBeginDocument{% - \renewcommand\section{\@startsection {section}{1}{\z@}% - {-.999\baselineskip}{0.001\baselineskip}{\bfseries\mathversion{bold}\color{skrapport@titlecolor}}} - \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% - {\baselineskip}{-.35\baselineskip}{\bfseries\color{skrapport@titlecolor}\unskip}} - \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% - {\baselineskip}{-.35\baselineskip}{\itshape\color{skrapport@titlecolor}\unskip}} - }\fi - \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% - {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\bfseries\color{skrapport@titlecolor}}} - \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% - {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\itshape\color{skrapport@titlecolor}}} - \AtBeginDocument{\@ifpackageloaded{hyperref}{% - \hypersetup{% - citebordercolor=skrapport@citecolor,citecolor=skrapport@citecolor,% - filebordercolor=skrapport@filecolor,filecolor=skrapport@filecolor,% - linkbordercolor=skrapport@linkcolor,linkcolor=skrapport@linkcolor,% - menubordercolor=skrapport@menucolor,menucolor=skrapport@menucolor,% - urlbordercolor=skrapport@urlcolor,urlcolor=skrapport@urlcolor,% - runbordercolor=skrapport@runcolor,runcolor=skrapport@runcolor% - } - }{}} - \AtBeginDocument{\color{skrapport@defaultcolor}} -\end{MacroCode} - \begin{macro}{\colortheme} - The \cs{colortheme} macro allows the end-user to load color themes - (described later) to customize the colors of the document when the - class is loaded with the \opt{color} option. -\begin{MacroCode}{class} - \newcommand\colortheme[1]{\usepackage{skrapport-colortheme-#1}} -\end{MacroCode} - \end{macro} -\begin{MacroCode}{class} - \colortheme{default} -\fi -\end{MacroCode} - - \subsection{Final class setup} - We end the document class by setting a few lengths along with the - page style and page numbering. Also, activate \cs{raggedbottom} and - \cs{onexolumn} (since we always do all the two-column stuff - ourselves anyway). -\begin{MacroCode}{class} -\setlength\columnsep{10\p@} -\setlength\columnseprule{0\p@} -\pagestyle{plain} -\pagenumbering{arabic} -\raggedbottom -\onecolumn -\endinput -\end{MacroCode} - - \subsection{Color themes} - As described earlier, the user can load color themes to customize - the appearance of the document if the class was loaded with the - \opt{color} option. Four themes are available by default. - - \subsubsection{Default color theme} - \begin{theme}{Default} - \changes{0.09}{Added default color theme} -\begin{MacroCode}{theme-default} -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-default}% - [2012/06/07 v1.0 skrapport color theme default] -\definecolor{skrapport@citecolor}{named}{green} -\definecolor{skrapport@filecolor}{named}{teal} -\definecolor{skrapport@linkcolor}{named}{red} -\definecolor{skrapport@menucolor}{named}{red} -\definecolor{skrapport@urlcolor}{named}{cyan} -\definecolor{skrapport@runcolor}{named}{teal} -\definecolor{skrapport@boldcolor}{named}{black} -\definecolor{skrapport@titlecolor}{named}{black} -\definecolor{skrapport@italiccolor}{named}{black} -\definecolor{skrapport@smallprintcolor}{named}{black} -\definecolor{skrapport@quotecolor}{named}{black} -\definecolor{skrapport@captioncolor}{named}{black} -\definecolor{skrapport@emphcolor}{named}{black} -\definecolor{skrapport@defaultcolor}{named}{black} -\endinput -\end{MacroCode} - \end{theme} - - \subsubsection{Unscathed color theme} - \begin{theme}{Unscathed} - \changes{0.09}{Added ``Unschathed'' color theme} -\begin{MacroCode}{theme-unscathed} -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-unscathed}% - [2012/06/07 v1.0 skrapport color theme unscathed] -\definecolor{skrapport@citecolor}{named}{skrapport@defaultcolor} -\definecolor{skrapport@filecolor}{named}{skrapport@defaultcolor} -\definecolor{skrapport@menucolor}{named}{skrapport@defaultcolor} -\definecolor{skrapport@runcolor}{named}{skrapport@defaultcolor} -\definecolor{skrapport@emphcolor}{HTML}{463335} -\definecolor{skrapport@linkcolor}{HTML}{CF5D3B} -\definecolor{skrapport@urlcolor}{named}{skrapport@linkcolor} -\definecolor{skrapport@titlecolor}{HTML}{B34430} -\definecolor{skrapport@captioncolor}{named}{skrapport@titlecolor} -\definecolor{skrapport@quotecolor}{HTML}{70524A} -\definecolor{skrapport@smallprintcolor}{named}{skrapport@quotecolor} -\endinput -\end{MacroCode} - \end{theme} - - \subsubsection{Cruelwater color theme} - \begin{theme}{Cruelwater} - \changes{0.09}{Added ``Cruelwater'' color theme} -\begin{MacroCode}{theme-cruelwater} -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-cruelwater}% - [2012/06/07 v1.0 skrapport color theme cruelwater] -\definecolor{skrapport@citecolor}{named}{black} -\definecolor{skrapport@filecolor}{named}{black} -\definecolor{skrapport@linkcolor}{named}{black} -\definecolor{skrapport@menucolor}{named}{black} -\definecolor{skrapport@urlcolor}{named}{black} -\definecolor{skrapport@runcolor}{named}{black} -\definecolor{skrapport@boldcolor}{HTML}{030C22} -\definecolor{skrapport@titlecolor}{HTML}{20293F} -\definecolor{skrapport@italiccolor}{named}{black} -\definecolor{skrapport@smallprintcolor}{HTML}{A9B0B3} -\definecolor{skrapport@quotecolor}{HTML}{404749} -\definecolor{skrapport@captioncolor}{HTML}{030C22} -\definecolor{skrapport@emphcolor}{HTML}{20293F} -\definecolor{skrapport@defaultcolor}{named}{black} -\endinput -\end{MacroCode} - \end{theme} - - \subsubsection{Violet color theme} - \begin{theme}{Violet} -\changes{0.09}{Added ``Violet'' color theme} -\begin{MacroCode}{theme-violet} -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-violet}% - [2012/06/07 v1.0 skrapport color theme violet] -\definecolor{skrapport@citecolor}{HTML}{932444} -\definecolor{skrapport@filecolor}{HTML}{932444} -\definecolor{skrapport@linkcolor}{HTML}{932444} -\definecolor{skrapport@menucolor}{HTML}{932444} -\definecolor{skrapport@urlcolor}{HTML}{932444} -\definecolor{skrapport@runcolor}{HTML}{932444} -\definecolor{skrapport@boldcolor}{HTML}{311A2A} -\definecolor{skrapport@titlecolor}{HTML}{311A2A} -\definecolor{skrapport@italiccolor}{named}{black} -\definecolor{skrapport@smallprintcolor}{HTML}{D6CBCF} -\definecolor{skrapport@quotecolor}{HTML}{463335} -\definecolor{skrapport@captioncolor}{HTML}{311A2A} -\definecolor{skrapport@emphcolor}{HTML}{98758D} -\definecolor{skrapport@defaultcolor}{named}{black} -\endinput -\end{MacroCode} - \end{theme} - - \Finale - \PrintChanges - \PrintIndex - \printbibliography -\end{document} diff --git a/Master/texmf-dist/source/latex/skrapport/skrapport.tex b/Master/texmf-dist/source/latex/skrapport/skrapport.tex new file mode 100644 index 00000000000..0db7af4c976 --- /dev/null +++ b/Master/texmf-dist/source/latex/skrapport/skrapport.tex @@ -0,0 +1,4125 @@ +%% skrapport Skånings rapportklass +%% +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Simon Sigurdhsson. +%% +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo +\documentclass{skdoc} +\let\SI\relax +\usepackage{siunitx} +\DeclareSIUnit\point{pt} +\usepackage{hologo,booktabs,xcoffins,calc} +\usepackage[style=authoryear]{biblatex} +\usepackage{csquotes} +\usepackage{varioref,cleveref} +%\usepackage{chslacite} + +\ExplSyntaxOn +\cs_set_protected_nopar:Npn\ExplHack{ + \char_set_catcode_letter:n{ 58 } + \char_set_catcode_letter:n{ 95 } +} +\ExplSyntaxOff + +% Hide the implementation +\OnlyDescription + +% Bibliography entries +\begin{filecontents}{skrapport.bib} + @article{kpfonts, + author = {Christophe Caignaert}, + title = {KP-Fonts 3.31}, + year = {2010}, + url = {http://www.tex.ac.uk/tex-archive/fonts/kpfonts/doc/kpfonts.pdf} + } + @standard{ISO216, + title = {ISO 216:2007}, + subtitle = {Writing paper and certain classes of printed matter -- Trimmed sizes -- A and B series, and indication of machine direction}, + author = {{International Organization for Standardization, Technical Committee 6}}, + year = {2007} + } + @standard{ISO8601, + title = {ISO 8601:2004}, + subtitle = {Data elements and interchange formats -- Information interchange -- Representation of dates and times}, + author = {{International Organization for Standardization, Technical Committee 154}}, + year = {2004} + } +\end{filecontents} +\addbibresource{skrapport.bib} + +% Declare the target files +\SelfPreambleTo{\mypreamble} +\DeclareFile[key=class,preamble=\mypreamble]{skrapport.cls} +\DeclareFile[key=size-common,preamble=\mypreamble]% + {skrapport-size-common.sty} +\DeclareFile[key=size-10,preamble=\mypreamble]{skrapport-size10pt.clo} +\DeclareFile[key=size-11,preamble=\mypreamble]{skrapport-size11pt.clo} +\DeclareFile[key=size-12,preamble=\mypreamble]{skrapport-size12pt.clo} +\DeclareFile[key=theme-default,preamble=\mypreamble]% + {skrapport-colortheme-default.sty} +\DeclareFile[key=theme-unscathed,preamble=\mypreamble]% + {skrapport-colortheme-unscathed.sty} +\DeclareFile[key=theme-cruelwater,preamble=\mypreamble]% + {skrapport-colortheme-cruelwater.sty} +\DeclareFile[key=theme-violet,preamble=\mypreamble]% + {skrapport-colortheme-violet.sty} +\DeclareFile[key=theme-skdoc,preamble=\mypreamble]% + {skrapport-colortheme-skdoc.sty} + +% This is where the documentation begins +\begin{document} + % Change & version info + \version{0.12a} + \changes{0.01}{Initial version} + \changes{0.03}{Removed \cs{rd} and \cs{id}} + \changes{0.04}{Added \pkg{microtype} package} + \changes{0.05}{Improved documentation} + \changes{0.06}{Corrected cheksum, further improved documentation} + \changes{0.07}{Various bugfixes, \hologo{XeLaTeX} compatibility, + better float settings, quote style fix, + \opt{intlimits} option to \pkg{amsmath}} + \changes{0.07a}{Fixed \pkg{kpfonts} issues} + \changes{0.09}{Introduced \pkg{kvoptions}, + fixed abstract in twocolumn mode} + \changes{0.10}{Include skmath if exists + and wanted. Gobble optional arguments to + \env{figure} and \env{table} in two-column mode} + \changes{0.10a}{Include \pkg{xparse} (fixes breakage)} + \changes{0.11}{Added \opt{minion} for Adobe Minion Pro font} + \changes{0.11a}{Added \opt{skdoc} font option and \thm{skdoc} color theme} + \changes{0.12}{Deprecated several macros, moved to \LaTeX3. Use of TOC depth above 3 is now unsupported} + \changes{0.12a}{The \pkg{fontspec} package is now only loaded when using the \texttt{word} or \texttt{none} font stacks on \hologo{LuaLaTeX} or \hologo{XeLaTeX}. The \texttt{word} font stack is now + the default font stack on \hologo{XeLaTeX}} + + % Metadata + \package[ctan=skrapport,vcs=https://github.com/urdh/skrapport]{skrapport} + \title{The \textbf{\thepackage} document class} + \author{Simon Sigurdhsson} + \email{sigurdhsson@gmail.com} + + % First page + \maketitle + \begin{abstract} + A document class intended for simple documents \emph{e.g.} + reports handed in to courses and such. It is small, + straight-forward and heavily inspired by the Prac\TeX{} + Journal style. + \end{abstract} + \tableofcontents + + \section{Documentation} + The \thepackage\ document class aims to make typesetting simple but + stylish documents (mostly reports) as effortless as possible. It + does this by mostly reimplementing the default \pkg{article} class + in \LaTeX3, while making modifications to both form and function + along the way. + + Because it is reimplemented in \LaTeX3, it may be incompatible with + any number of packages that patch or otherwise modify internals of + \pkg{article} or other document classes. For commonly used packages + (especially those used frequently by the author), this shouldn't be + a problem. The author gladly accepts reports of any such issues at + the project issue tracker --- see \enquote{Known issues} on + \vpageref{sec:issues}. + + \subsection{Options} + As with other document classes, the class is loaded, possibly with + options, by issuing \Macro\documentclass[<options>]{skrapport}. + The class has a number of options controlling both form and function, + by \emph{e.g.} setting the font size, selecting a font stack, setting + the section title style, and so on. + + \subsubsection{Layout} + Two options controlling the overall layout of the document are + provided. Collectively they control the paper size and text layout + of the document. + + \Option{paper}\WithValues{a4, a5}\AndDefault{a4} + The \opt{paper} option controls the paper size of the document. + Internally, this is set by the \pkg{typearea} package, so in theory + many more paper sizes could be available, but the current options + cover most useful documents. + + \Option{twocolumn} + The \opt{twocolumn} option sets up a two-column mode. This is not + provided by internal \LaTeX\ mechanics as in the original + \pkg{article} class, but instead by patching environments and macros + and using a combination of the \pkg{multicol} and \pkg{grid} + packages. In theory, this means that baselines of adjacent columns + should be aligned, and that three- or four-column modes are possible + in the future (but that'd be ridiculous). + + \subsubsection{Style} + A couple of options to control the style of the document are + provided. Two of them, \opt{leqno} and \opt{fleqn}, are mainly + provided for compatibility with the \pkg{article} class. + + \Option{leqno} + This option makes display math environments typeset their labels on + the left-hand side of the formula instead of the right-hand side. + + \Option{fleqn} + This option makes display math environments left-align the entire + formula as opposed to centering it. + + \Option{indent}\WithValues{true, false}\AndDefault{false} + The \opt{indent} option enables or disables the indentation of + paragraphs, with the default being not to indent anything. The + default behaviour thus is similar to that obtained using the + \pkg{parskip} package with the \pkg{article} package. + + \Option{titles}\WithValues{rm, bf, sf}\AndDefault{bf} + Section titles (and a few other elements) are controlled by this + option in that they are typeset either using the regular roman font, + the boldfaced roman font or the sans serif font. For historical + reasons the default is a boldfaced roman font, but the sans serif + option is very handsome. + + \Option{color}\WithValues{\meta{color theme}}\AndDefault{default} + This option tells the class to activate color theme support and + optionally load a color theme. Several color themes are available + (as detailed by \enquote{Color themes} \vpageref{ssec:color}), + and the special value \texttt{false} disables color support + entirely (which only means that the \pkg{xcolor} package isn't + loaded, and that \cs{colortheme} remains undefined). + + \subsubsection{Fonts} + Only two options control the font setup of the document class. The + class provides the same point sizes as \pkg{article}, but also + provides a large number of font stacks to choose from. + + \Option{ptsize}\WithValues{10pt, 11pt, 12pt}\AndDefault{11pt} + The document class provides the same three point sizes as the + \pkg{article} class. There is room for expansion, but there really + shouldn't be any reason to use other point sizes. + + \Option{font}\WithValues{none, kpfonts, lmodern, palatino, minion, skdoc, word}\AndDefault{kpfonts} + Several different font stacks, detailed by \vref{tab:font}, are + provided. Most of these work with \hologo{pdfLaTeX}, but there are + two special font stacks: \texttt{none} and \texttt{word}. The + former, predictably, loads no fonts whatsoever leaving the document + with Computer Modern fonts. This is useful if the fonts are replaced + later anyway, such as when using \hologo{XeLaTeX}. + + The \texttt{word} + font stack, however, does load a few fonts. The fonts must be present + and installed on the system as OTF or TTF fonts, and the font stack + requires either \hologo{XeLaTeX} or \hologo{LuaLaTeX}. + Both \texttt{word} and \texttt{none} load the \pkg{fontspec} + package, assuming the document is compiled using \hologo{XeLaTeX} + or \hologo{LuaLaTeX}. + + \Notice{The \texttt{skdoc} font stack doesn't have a math font.} + \Warning{Currently, \pkg{fontspec} is always loaded by + \hologo{XeLaTeX} regardless of options due to + the use of \pkg{polyglossia}. This means that + you \emph{have} to use OpenType fonts in your + document, otherwise \emph{only} Latin Modern + Roman (\emph{i.e.} no sans-serif or monospace + fonts) will be available. Therefore, the \texttt{word} + font stack is the default when using \hologo{XeLaTeX}. + \Hologo{LuaLaTeX} is not affected by this.} + + \begin{table}[tp] + \centering + \caption{Font stacks provided by \thepackage.} + \label{tab:font} + \NewCoffin\tempcoffin\newlength\templength + \SetHorizontalCoffin\tempcoffin{ + \begin{tabular}{lllll} + \toprule + Font stack & Serif font & Math font & Sans serif font & Monospace font \\ + \midrule + \texttt{kpfonts} & Kp-Fonts & Kp-Fonts & Kp-Fonts & Kp-Fonts \\ + \texttt{lmodern} & Latin Modern & Latin Modern & Latin Modern & Inconsolata \\ + \texttt{palatino} & \TeX\ Gyre & PX & Arev & Inconsolata \\ + \texttt{minion} & Minion Pro & Minion Pro & Myriad Pro & Inconsolata \\ + \texttt{skdoc} & PT Serif & --- & Open Sans & Inconsolata \\ + \texttt{word} & Cambria & Cambria Math & Calibri & Consolas \\ + \bottomrule + \end{tabular} + } + \setlength{\templength}{(\textwidth - \CoffinWidth\tempcoffin)/2} + \hspace*{\templength} + \TypesetCoffin\tempcoffin + \end{table} + + \subsubsection{Functionality} + The final three options affect functionality in one way or another. + Since \thepackage\ was originally designed for reports written in + either swedish or english, the class always loads either \pkg{babel} + or \pkg{polyglossia} with either of these languages. Additionally, + the class may load the \pkg{skmath} package if desirable. + + \Option{math}\WithValues{true, false}\AndDefault{true} + When \texttt{true}, the \pkg{skmath} package is loaded, providing + improvements to the math functionality of \pkg{amsmath} and friends. + + \Option{lang}\WithValues{en, sv}\AndDefault{sv} + This option specifies what main language \pkg{babel} or + \pkg{polyglossia} set up with. The other language is loaded as + well, for use in constructs that allow for a second language. + + \Option{draft}\WithValues{true, false}\AndDefault{false} + The \opt{draft} option, much like in \pkg{article}, enables + \cs{overfullrule}s and possibly similar functionality in loaded + packages (if they react to the global \opt{draft} option). + + \subsection{User-level commands and environments} + The general idea behind the document class is to provide most + (if not all) of the macros provided by the standard \LaTeXe{} + classes, as well as additional macros to simplify and beautify + the documents produced. As such, most of the documentation that + follows details macros that are present in the standard document + classes. Some of them have changed functionality or semantics, + so at least a skim through this section is recommended. + + \subsubsection{The front page} + The front page is the part of the document that has seen the most + changes in \thepackage\ compared to \pkg{article}. In addition to + the new, Prac\TeX-inspired layout, there are a few additional + pieces of information in it. Also, the \cs{author} macro has been + dramatically improved. + + \DescribeMacro\date{<ISO8601 date>} + The \cs{date} macro now internally employs \pkg{isodate} to typeset + the date of the document. This means that the input must be either + the string \enquote{today}, the token \cs{today} or a date as defined + by ISO8601\footcite{ISO8601}. The mechanisms provided by + \pkg{isodate} can be used to affect the output format. + + \DescribeMacro\author[<email>]{<name>} + In contrast with the \pkg{article} package, the \cs{author} macro + should no longer be used to typeset several author names at once. + Instead, one \cs{author} command is to be issued for every author, + optionally providing a corresponding email. These are then combined, + in the order they are given, to form a list of authors and a + corresponding list of email adresses. + + \DescribeMacro\regarding{<topic>} + This macro defines a topic or other short message detailing the + purpose of the document. It is typeset along with the date in the + upper left corner of the title page. + + \DescribeMacro\license{<license name>} + The \cs{license} macro defines a short license name to be typeset + in the lower right corner of the title page. This mechanism could of + course be used to typeset an institution name or similar as well. + It is only typeset when also using the \env{titlepage} environment + described below. + + \DescribeMacro\title{<document title>} + The \cs{title} macro, while not defined by \pkg{skrapport}, is + relevant to describe. It simply sets the title of the document, as + displayed by \cs{maketitle}. + + \DescribeMacro\maketitle[hide={date,email},nopdfinfo] + As in \pkg{article}, the \cs{maketitle} macro typesets the + information provided by \cs{title}, \cs{author} and friends to form + a stylish front page. When combined with \env{abstract}, + \env{titlepage} and/or \cs{tableofcontents}, you get a very + good-looking preamble with almost no effort. + + The optional argument is a key-value list with two valid entries, + \opt*{hide} and \opt*{nopdfinfo}. The \opt*{hide} entry accepts a + comma-separated list in which the values \opt*{date} and \opt*{email} + are interpreted as instructions to hide the corresponding entry from + the front page. The \opt*{nopdfinfo} key disables the generation of + PDF information by \pkg{hyperref}. + + \DescribeEnv[<abstract text>]{abstract} + The \env{abstract} environment defines an abstract, which is typeset + in a block with the \cs{abstractname} word next to it (see + \emph{e.g.} the title page of this manual for an example). + + \DescribeEnv[<title page contents>]{titlepage} + Normally, \cs{maketitle} doesn't reserve its own page. By enclosing + \cs{maketitle} (and \env{abstract} if appropriate) in the + \env{titlepage} environment, the contents are typeset on their + own page, without page numbering and with the \cs{license} text + in the lower right corner (if applicable). + + \subsubsection{Sectioning} + \DescribeMacro\section*[<short title>]{<title>} + \DescribeMacro\subsection*[<short title>]{<title>} + \DescribeMacro\subsubsection*[<short title>]{<title>} + \DescribeMacro\paragraph*[<short title>]{<title>} + \DescribeMacro\subparagraph*[<short title>]{<title>} + The sectioning macros are superficially very similar to those + provided by \pkg{article}, but have been completely reimplemented + in \pkg{expl3} code. Additionally, the style of these secioning + macros, as detailed by the \opt{titles} option documentation above, + can be changed. + + All of them have both arguments and behaviour in common, only + differing in style. The starred versions are unnumbered, but still + accept the opional short title (simply discarding it). The optional + short title is used in the table of contents. The + \texttt{secnumdepth} counter limits the depth of section numbering. + + The first three macros, being section titles, are typeset as actual + titles on their own line with appropriate spacing above and below. + The paragraph macros instead typeset run-in titles. + + \subsubsection{Macros and environments from \pkg{article}} + Aside from the \env{itemize} and \env{enumerate} envionments and the + font selection macros, which are carried without modification from + \LaTeXe, a couple of environments and macros are defined. + + The old font macros, whose use has been discouraged for a long time, + are now deprecated. Instead of functioning correctly, they will emit + an error and require user input. Use the \cs*{text??}/\cs*{??family} + macros instead. For emphasis, use the \cs{emph} macro. + + \DescribeMacro\emph{<text>} + Emphasized text will be typeset in italic, or bold italic if the + macro is used in a context where italic is already used (such as + inside another \cs{emph} invokation). + + \DescribeEnv[\cs*{item}\oarg{item} \meta{description}]{description} + The \env{description} environment behaves as expected, typesetting + a list of descriptions as in the \pkg{article} class. + + \DescribeEnv[<short quote>]{quote} + Intended for short quotes, the \env{quote} environment simply + typesets a centered block of italic text. + + \DescribeEnv[<long quote>]{quotation} + Longer quoted passages are typeset using the \env{quotation} + environment. This is simply a \env{quote} environment with additional + spacing above and below. + + \DescribeEnv[<pretentious poetry>]{verse} + The \env{verse} environment is intended for poetry and other text + where line breaks are critical. Use \verb|\\| to break + lines. + + \DescribeMacro\appendix + This macro signals the end of the main matter and the start of + the appendix. In essence, it resets the section numbering counter + and changes the section numbering to the upper-case alphabetic + sequence. + + \subsubsection{Floats} + Both the \env{figure} and \env{table} float environments accept an + optional positioning argument. The default positioning is + \texttt{tp}. Both environments also have starred variants, which + do nothing in one-column mode while typesetting the figure across + both columns in two-column mode. As usual, \cs{centering}, + \cs{caption} and \cs{label} should be used inside the floats. + + \DescribeEnv[<content>]{figure}[position] + This float environment is intended for figures. The most common + contents are \cs{includegraphics} statements or \env{tikzpicture} + environments. + + \DescribeEnv[<content>]{table}[position] + A float intended for tables. Probably contains \env{tabular}s. + + \DescribeEnv{figcenter} + This environment is useful for wide figures and tables. It typesets + its contents centered horizonally, but allows the content to extend + into the margin. The content is set in a horizontal coffin. + + \subsubsection{Table of contents} + \DescribeMacro\tableofcontents + The table of contents are typeset using this macro. The + \texttt{tocdepth} counter limits the depth of the table of + contents, but for stylistic reasons values higher than 3 are + unsupported. + +% \subsubsection{Basic bibliography support} + + \subsubsection{Miscellaneous} + \DescribeMacro\comment*{<comment>} + \DescribeMacro\note*{<comment>} + \DescribeMacro\com*{<comment>} + These macros, the two latter being aliases of the first one, typeset + an author's comment in the document. The starred variants typeset the + comment inline with a red background, while the unstarred variant + typesets the comment in a \cs{marginpar}. + + \subsubsection{Color theme support} + \DescribeMacro\colortheme{<theme>} + The \cs{colortheme} macro, which is only available when the + \opt{color} option is \texttt{true}, applies a color theme to + the document. For a list of available color themes, see + \enquote{Color themes} \vpageref{ssec:color}. + + \subsubsection{Font size macros} + The font size macros, expectedly, set the size of the text. They + do not take arguments, instead affecting all subsequent text of the + current \TeX\ group, so use braces to provide and limit context. + Also note that unlike \pkg{article}, these macros are \emph{all} + available, regardless of point size option. + + \DescribeMacro\tiny + Typesets {\tiny tiny} text. + \DescribeMacro\scriptsize + Typesets {\scriptsize script-size} text. + \DescribeMacro\footnotesize + Typesets {\footnotesize footnote-sized} text. + \DescribeMacro\small + Typesets {\small small} text. + \DescribeMacro\normalsize + Typesets normal text. + \DescribeMacro\large + Typesets {\large large} text. + \DescribeMacro\Large + Typesets {\Large slightly larger} text. + \DescribeMacro\LARGE + Typesets {\LARGE even larger} text. + \DescribeMacro\huge + Typesets {\huge huge} text. + \DescribeMacro\Huge + Typesets {\Huge really huge} text. + + \subsection{Color themes}\label{ssec:color} + \DescribeMacro\colortheme{<theme>} + If the package is loaded with the \opt{color} option, changing the color theme is + possible using \cs{colortheme}, which loads an + appropriate package. At the moment, four color themes are available. + + \Theme{default} + The \thm{default} theme is fairly conservative, only coloring + \pkg{hyperef} links with more readable, slightly darker colors than + the standard ones. It should print well even on non-color printers. + + \Theme{unscathed} + The \thm{unscathed} theme is based on a palette with the same + name on COLOURlovers% +\footnote{\url{http://www.colourlovers.com/palette/1440498/unscathed}}, + and applies a \textcolor[HTML]{463335}{dark brown} color to + emphasized text, a \textcolor[HTML]{CF5D3B}{rusty} color to links, + a \textcolor[HTML]{B34430}{darker rust} color to titles and a + \textcolor[HTML]{70524A}{lighter brown} to quotes. + + \Theme{cruelwater} + The \thm{cruelwater} theme is also based on a palette from + COLOURlovers% +\footnote{\url{http://www.colourlovers.com/palette/126030/Cruel_Water_at_Night}}, + and applies a \textcolor[HTML]{030C22}{dark blue} color to bold + text and captions, a \textcolor[HTML]{20293F}{slightly less dark + blue} to titles and emphasized text, a \textcolor[HTML]{A9B0B3}{ + light gray} color to small print and a \textcolor[HTML]{404749}{ + darker gray} to quotes. + + \Theme{violet} + The \thm{violet} theme, like \thm{unscathed} and \thm{cruelwater}, + is based on a COLOURlovers palette% +\footnote{\url{http://www.colourlovers.com/palette/1831303/Violet_White_Bedrm}}. + It colors all links \textcolor[HTML]{932444}{bright purple}, applies + a \textcolor[HTML]{311A2A}{dark puple} color to titles, bold text + and captions, a \textcolor[HTML]{D6CBCF}{grayish purple} to small + print, a \textcolor[HTML]{463335}{dark brown} color to quotes and a + \textcolor[HTML]{98758D}{pastel violet} color to emphasized text. + + \Theme{skdoc} + The \thm{skdoc} theme is loosely based on the \pkg{skdoc} document class, with which this documentation is typeset. + +% \subsection{Additional information} +% The document class includes a number of packages by default. This +% is useful to know, since passing explicit options to these packages +% will require you to utilize the \cs{PassOptionsToPackage} macro +% before you load the class using \cs{documentclass}. +% Table~\ref{tab:pkgs} lists the packages included by \thepkg\ along +% with their options (if applicable). +% +% \begin{table}[tbp] +% \centering +% \caption{User-level packages included by \thepkg.} +% \label{tab:pkgs} +% \begin{tabular}{llp{15em}} +% \toprule +% \textbf{Package} & \textbf{Options} & \textbf{Comments} \\ +% \midrule +% \pkg{amsmath} & \texttt{intlimits} & Provides \hologo{AmS} commands and environments. \\ +% \pkg{amssymb} & & Only if not using \opt{kpfonts}.\\ +% \pkg{babel} & see options \opt{swe} and \opt{eng} & Only loaded if \emph{not} using \hologo{XeTeX}.\\ +% \pkg{calc} & & \\ +% \pkg{fontenc} & \texttt{T1} & Only loaded if \emph{not} using \hologo{XeTeX}. Makes sure we are using a good font encoding for crisp appearance on-screen (OT1 is horrible). \\ +% \pkg{fontspec} & \texttt{quiet} & Only loaded if using \hologo{XeTeX}. Provides basic OTF font selection commands.\\ +% \pkg{geometry} & \texttt{a4paper} or \texttt{a5paper} & This is used by the \opt{paper} option to set the paper area. \\ +% \pkg{icomma} & & \\ +% \pkg{inconsolata} & & \\ +% \pkg{microtype} & & Provides micro-typographic improvements.\\ +% \pkg{multicol} & & Only loaded with the \opt{twocolumn} option. \\ +% \pkg{polyglossia} & see options \opt{swe} and \opt{eng} & Only loaded if using \hologo{XeTeX}.\\ +% \pkg{skmath} & & Only if it exists and \opt{nomath} isn't set.\\ +% \pkg{textcomp} & & Only if not using \opt{kpfonts}.\\ +% \pkg{xcolor} & & Only loaded with the \opt{color} option.\\ +% \bottomrule +% \end{tabular} +% \end{table} + + \section{Known issues}\label{sec:issues} + A list of current issues is available in the Github repository of this + package\footnote{\url{https://github.com/urdh/skrapport/issues}}, but as + of the release of \theversion, there is one known issue: + \begin{description} + % \item[\#6] ??? + \item[--] If a \cs{subsubsection} is the last item of the Table + of Contents, it will not be indented properly. + \end{description} + + If you discover any bugs in this package, please report them to the issue + tracker in the \thepackage\ Github repository. + + \Implementation\ExplHack + \section{Implementation} + Start by including \pkg{expl3}, \pkg{l3keys2e} and some other + useful packages, as well as declaring the class. +\begin{MacroCode}{class} +\RequirePackage{expl3,l3keys2e,xparse,xstring,etoolbox} +\ProvidesExplClass{skrapport}% + {2013/06/24}{0.12a}{stylish report document class} +\end{MacroCode} + + \subsection{Messages} + Tons of messages are declared for future use. +\begin{MacroCode}{class} +\msg_new:nnnn{skrapport}{option-deprecated}{Option~`#1'~deprecated!} + {Please~use~`#2'~instead.} +\msg_new:nnnn{skrapport}{option-no-effect}{Option~`#1'~deprecated!} + {It~has~no~effect;~simply~use~nothing~instead.} +\msg_new:nnnn{skrapport}{invalid-paper-size}{Invalid~paper~size~`#1'!} + {\token_to_str:N\__skrapport_setup_paper:n~was~invoked~with~an~ + invalid~argument;~paper~size~will~remain~unchanged.} +\msg_new:nnnn{skrapport}{invalid-point-size}{Invalid~point~size~`#1'!} + {\token_to_str:N\__skrapport_setup_ptsize:n~was~invoked~with~an~ + invalid~argument;~cannot~continue~without~setting~a~valid~point~ + size.~Please~fix~the~issue~before~typesetting~again.} +\msg_new:nnnn{skrapport}{invalid-titles}{Invalid~title~type~`#1'!} + {\token_to_str:N\__skrapport_setup_titles:n~was~invoked~with~an~ + invalid~argument;~falling~back~to~`#2'.} +\msg_new:nnnn{skrapport}{invalid-lang}{Invalid~language~`#1'!} + {\token_to_str:N\__skrapport_setup_lang:n~was~invoked~with~an~ + invalid~argument;~`babel'~and/or~`polyglossia'~will~remain~ + unloaded.} +\msg_new:nnnn{skrapport}{invalid-font}{Invalid~font~`#1'!} + {\token_to_str:N\__skrapport_setup_font:n~was~invoked~with~an~ + invalid~argument;~no~font~package~has~been~loaded.~This~may~result~ + in~bad~rendering~due~to~old~Computer~Modern~fonts.} +\msg_new:nnnn{skrapport}{noop-call}{No-op~invokation~of~macro!} + {\token_to_str:N#1~was~invoked,~but~circumstances~dictate~that~the~ + macro~should~do~nothing.~Will~do~\token_to_str:N\prg_do_nothing:~ + instead.} +\msg_new:nnnn{skrapport}{old-font-deprecated}{Deprecated~macro~\token_to_str:N#1!} + {The~old~font~macro~\token_to_str:N#1~is~deprecated!~Use~ + \token_to_str:N#2~instead.} +\msg_new:nnnn{skrapport}{color-patch-failed}{Could~not~patch~macro~\token_to_str:N#1!} + {The~macro~\token_to_str:N#1~could~not~be~patched!~Color~theme~ + support~may~be~incomplete.} +\msg_new:nnnn{skrapport}{license-not-printed}{Detected~\token_to_str:N\license~but~no~`titlepage'!} + {The~text~provided~by~\token_to_str:N\license~is~only~printed~when~ + the~`titlepage'~environment~is~used,~but~it~seems~to~be~missing.} +\msg_new:nnnn{skrapport}{font-requires-xetex}{The~`font=#1'~option~requires~XeTeX~or~luaTeX!} + {Please~choose~another~font~setup~or~compile~the~document~with~ + either~xelatex~or~lualatex.} +\msg_new:nnnn{skrapport}{tocdepth-too-deep}{TOC~depth~is~too~deep!} + {The~current~tocdepth,~#1,~is~not~supported.~Please~redefine~the~ + \token_to_str:N#2~macro~to~enable~support.} +\end{MacroCode} + This message should probably not be used at all. Except in + development versions straight off Github, of course. +\begin{MacroCode}{class} +\msg_new:nnn{skrapport}{not-implemented} + {Unimplemented~macro~\token_to_str:N#1!} +\end{MacroCode} + + \subsection{Options} + First, a few booleans used by parts of the option handling code. + \begin{macro}{\g__skrapport_draft_bool} + Are we in \opt{draft} mode? +\begin{MacroCode}{class} +\bool_new:N\g__skrapport_draft_bool +\end{MacroCode} + \end{macro} + \begin{macro}{\g__skrapport_color_bool} + Are we supposed to be using \opt{color}s? +\begin{MacroCode}{class} +\bool_new:N\g__skrapport_color_bool +\end{MacroCode} + \end{macro} + \begin{macro}{\g__skrapport_has_polyglossia_bool} + Has \pkg{polyglossia} been loaded? +\begin{MacroCode}{class} +\bool_new:N\g__skrapport_has_polyglossia_bool +\end{MacroCode} + \end{macro} + + \subsubsection{Option setup macros} + In this section, all options declared in the previous section are + implemented using setup macros. Some of these may have to be called + in an appropriate order, but I haven't checked that yet. + + \begin{macro}{\__skrapport_setup_paper:n}[1] + {Paper size (\texttt{a4} or \texttt{a5})} + \changes{0.12}{Use \pkg{typearea} to set paper size} + Note the extra integer, which is set up for use with \pkg{grid}. + \begin{macro*}{\g__skrapport_grid_lines_int} +\begin{MacroCode}{class} +\int_new:N\g__skrapport_grid_lines_int +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_setup_paper:n#1{ + \str_case:nnn{#1}{ +\end{MacroCode} + The two options simply consist of passing the appropriate option + to the \pkg{typearea} package. Note that the use of \pkg{typearea} + mean that we theoretically could accept more paper size options. +\begin{MacroCode}{class} + {a4}{ + \PassOptionsToPackage{paper=A4}{typearea} + \int_gset:Nn\g__skrapport_grid_lines_int{40} + } + {a5}{ + \PassOptionsToPackage{paper=A5}{typearea} + \int_gset:Nn\g__skrapport_grid_lines_int{28} + } + }{ +\end{MacroCode} + Invalid paper sizes (such calls should never happen) are + handled by issuing a warning and hoping that the default + paper size is acceptable. +\begin{MacroCode}{class} + \msg_warning:nnn{skrapport}{invalid-paper-size}{#1} + } +\end{MacroCode} + The \pkg{typearea} package is loaded with the options specified + earlier through \cs{PassOptionsToPackage}, and some additional ones. +\begin{MacroCode}{class} + \AtEndOfClass{\RequirePackage[DIV=calc]{typearea}} +\end{MacroCode} + In case the point size changes later, or two column mode is + activated, we recalculate the typearea just before the typesetting + begins. +\begin{MacroCode}{class} + \AtBeginDocument{\recalctypearea} +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_ptsize:n}[1] + {Point size (\texttt{10pt}, \texttt{11pt} or \texttt{12pt})} + The standard point sizes are defined much like in the \pkg{article} + class, \emph{i.e.} by saving a number and loading \file{size10.clo}, + \file{size11.clo} or \file{size12.clo} as appropriate +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_setup_ptsize:n#1{ + \str_case:nnn{#1}{ +\end{MacroCode} + \begin{macro*}{\c__skrapport_ptsize_token} +\begin{MacroCode}{class} + {10pt}{\token_new:Nn\c__skrapport_ptsize_token{0}} + {11pt}{\token_new:Nn\c__skrapport_ptsize_token{1}} + {12pt}{\token_new:Nn\c__skrapport_ptsize_token{2}} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} + }{ +\end{MacroCode} + Invalid point sizes are critical errors, since we can't recover + from them in any reasonable way. Loading a default point size is + unreasonable, since all in-class calls to this macro should know + what sizes are available, and if you're calling it with invalid + parameters from elsewhere, you should be punished. +\begin{MacroCode}{class} + \msg_critical:nnn{skrapport}{invalid-point-size}{#1} + } + \file_input:n{skrapport-size#1.clo} +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_twocolumn:} + Setting up for twocolumn mode is slightly compliacted. Note that this + macro should be called from \cs{AtEndOfClass} to ensure that we patch + everything correctly. Note also that \pkg{multicol} is always loaded + as it is used for the \env{theindex} environment. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_twocolumn:{ + \RequirePackage{etoolbox} + \AtBeginDocument{ + \KOMAoptions{twocolumn=true} + } +\end{MacroCode} + We include the \pkg{grid} package in two-column mode, because + it looks way better that way. +\begin{MacroCode}{class} + \int_set:Nn\l_tmpa_int{1\c__skrapport_ptsize_token} + \int_set:Nn\l_tmpb_int{1.2*\l_tmpa_int} + \RequirePackage[fontsize=\l_tmpa_int pt, + baseline=\l_tmpb_int pt, + lines=\g__skrapport_grid_lines_int]{grid} +\end{MacroCode} + Now, we patch commands. First up is \env{abstract}. +\begin{MacroCode}{class} + \RenewDocumentEnvironment{abstract}{}{\section*{\abstractname}}{} +\end{MacroCode} + Then \env{document} (kind of, at least) and \cs{maketitle}. +\begin{MacroCode}{class} + \AfterEndPreamble{\begin{multicols}{2}} + \AtEndDocument{\end{multicols}} + \pretocmd{\maketitle}{\end{multicols}}{}{} + \apptocmd{\maketitle}{\begin{multicols}{2}}{}{} +\end{MacroCode} + Always typeset \env{equation} and friends outside the grid: +\begin{MacroCode}{class} + \BeforeBeginEnvironment{equation}{\begin{gridenv}} + \AfterEndEnvironment{equation}{\end{gridenv}} + \BeforeBeginEnvironment{equation*}{\begin{gridenv}} + \AfterEndEnvironment{equation*}{\end{gridenv}} + \BeforeBeginEnvironment{multline}{\begin{gridenv}} + \AfterEndEnvironment{multline}{\end{gridenv}} + \BeforeBeginEnvironment{multline*}{\begin{gridenv}} + \AfterEndEnvironment{multline*}{\end{gridenv}} + \BeforeBeginEnvironment{gather}{\begin{gridenv}} + \AfterEndEnvironment{gather}{\end{gridenv}} + \BeforeBeginEnvironment{gather*}{\begin{gridenv}} + \AfterEndEnvironment{gather*}{\end{gridenv}} + \BeforeBeginEnvironment{align}{\begin{gridenv}} + \AfterEndEnvironment{align}{\end{gridenv}} + \BeforeBeginEnvironment{align*}{\begin{gridenv}} + \AfterEndEnvironment{align*}{\end{gridenv}} + \BeforeBeginEnvironment{flalign}{\begin{gridenv}} + \AfterEndEnvironment{flalign}{\end{gridenv}} + \BeforeBeginEnvironment{flalign*}{\begin{gridenv}} + \AfterEndEnvironment{flalign*}{\end{gridenv}} + \BeforeBeginEnvironment{alignat}{\begin{gridenv}} + \AfterEndEnvironment{alignat}{\end{gridenv}} + \BeforeBeginEnvironment{alignat*}{\begin{gridenv}} + \AfterEndEnvironment{alignat*}{\end{gridenv}} +\end{MacroCode} + The \env{figure} environment is patched\ldots +\begin{MacroCode}{class} + \cs_set_eq:Nc\__skrapport_old_figurest:{figure*} + \cs_set_eq:Nc\__skrapport_old_endfigurest:{endfigure*} + \RenewDocumentEnvironment{figure}{o}{ + \begin{gridenv} + \vspace{\intextsep} + \begin{minipage}{\linewidth} + \cs_set:Nn\@captype{figure} + }{ + \end{minipage} + \vspace{\intextsep} + \end{gridenv} + } + \RenewDocumentEnvironment{figure*}{o}{ + \begin{onecol} + \__skrapport_old_figurest: + }{ + \__skrapport_old_endfigurest: + \end{onecol} + } +\end{MacroCode} + \ldots as is \env{table}. +\begin{MacroCode}{class} + \cs_set_eq:Nc\__skrapport_old_tablest:{table*} + \cs_set_eq:Nc\__skrapport_old_endtablest:{endtable*} + \RenewDocumentEnvironment{table}{o}{% + \begin{gridenv} + \vspace{\intextsep} + \begin{minipage}{\linewidth} + \cs_set:Nn\@captype{table} + \cs_set_eq:NN\__skrapport_old_caption:\caption + \RenewDocumentCommand{\caption}{om}{% + \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip + \skip_set_eq:NN\abovecaptionskip\belowcaptionskip + \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip + \vspace{\abovecaptionskip} + \__skrapport_old_caption:[##1]{##2} + \vspace{\belowcaptionskip} + } + }{ + \end{minipage} + \vspace{\intextsep} + \end{gridenv} + } + \cs_set_eq:NN\__skrapport_old_tablest:\__skrapport_old_old_tablest: + \cs_set:Nn\__skrapport_old_tablest:{ + \__skrapport_old_old_tablest: + \cs_set_eq:NN\__skrapport_old_caption:\caption + \RenewDocumentCommand{\caption}{om}{% + \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip + \skip_set_eq:NN\abovecaptionskip\belowcaptionskip + \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip + \vspace{\abovecaptionskip} + \__skrapport_old_caption:[##1]{##2} + \vspace{\belowcaptionskip} + } + } + \RenewDocumentEnvironment{table*}{o}{ + \begin{onecol} + \__skrapport_old_tablest: + }{ + \__skrapport_old_endtablest: + \end{onecol} + } +\end{MacroCode} + \begin{environment}{onecol} + \changes{0.10}{Fixed, now not completely broken} + Finally, we define an environment \env{onecol} that typesets + arbitrary material in a single column. This is a bit tricky to + do, and probably cargo-cult as well. We define the start of the + environment to immediately end itself (with the empty ending), + then end the \env{multiols} environment, redefine our end macro + to start \env{multicols} as well as redefining the start of + \env{onecol} to simply reset itself, then start the environment + again only to have it ended at once. + + Basically, we trick \LaTeX\ into thinking that we have an empty + \env{onecol} environment at the end of the first \env{multicols}, + then some content inside a fake \env{onecol}, then an empty + \env{onecol} at the start of the next \env{multicols}. Voilá, no + wierd group errors! +\begin{MacroCode}{class} + \DeclareDocumentEnvironment{onecol}{ + \end{onecol} + \end{multicols} + \group_begin: + \cs_set:Nn\endonecol{ + \group_end: + \begin{multicols}{2} + \cs_set_eq:NN\__skrapport_old_onecol:\onecol + \cs_set:Nn\onecol{ + \cs_set_eq:NN\onecol\__skrapport_old_onecol: + } + \begin{onecol} + } + \cs_set:Nn\onecol{} + \begin{onecol} + }{} +\end{MacroCode} + \end{environment} +\begin{MacroCode}{class} +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_leqno:} + Instead of loading \file{leqno.clo}, we reimplement the (tiny) file + as LaTeX3 code and include it directly. It's not terribly advanced. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_leqno:{ + \RenewDocumentCommand\@eqnnum{}{ + \hbox_to_wd:nn{.01pt}{} + \hbox_overlap_right:n{ + \normalfont\normalcolor + \skip_horizontal:n{-\displaywidth} + (\theequation) + } + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_fleqn:} + The \file{fleqn.clo} functionality is more complex, so we include + the file instead of reimplementing. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_fleqn:{ + \file_input:n{fleqn.clo} +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_titles:n}[1] + {Title style (\texttt{rm}, \texttt{bf} or \texttt{sf})} + The title styles are implemented by creating a new macro + \cs{__skrapport_title_style:} which will later be used by + \cs{section} and friends. +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_setup_titles:n#1{ + \str_case:nnn{#1}{ +\end{MacroCode} + \begin{macro*}{\__skrapport_title_style:} + \changes{0.11a}{Removed incorrect \cs{bfseries}, replaced + \cs{relax} with \cs{rmfamily}} +\begin{MacroCode}{class} + {rm}{\cs_new_protected:Nn\__skrapport_title_style:{\rmfamily}} + {bf}{\cs_new_protected:Nn\__skrapport_title_style:{\bfseries}} + {sf}{\cs_new_protected:Nn\__skrapport_title_style:{\sffamily}} +\end{MacroCode} + \end{macro*} + The fall-back for incorrect parameters is an informational message + along with setting up for \cs{rmfamily} titles. +\begin{MacroCode}{class} + }{ + \msg_info:nnnn{skrapport}{invalid-titles}{#1}{rm} + \__skrapport_setup_titles:n{rm} + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_lang:n}[1] + {Language (\texttt{sv} or \texttt{en})} + Thus far only two language options are implemented, each of them + setting the other as the \enquote{other} language. We check if + \pkg{polyglossia} has been loaded (this is done by + \cs{__skrapport_setup_xelatex:}): if it has, we use the + \pkg{polyglossia} interface for setting languages, otherwise we + load the \pkg{babel} package with appropriate options. +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_setup_lang:n#1{ + \str_case:nnn{#1}{ + {sv}{ + \bool_if:NTF\g__skrapport_has_polyglossia_bool{ + \setmainlanguage{swedish} + \setotherlanguage[variant=british]{english} + }{ + \RequirePackage[british,swedish]{babel} + } +\end{MacroCode} + \begin{macro*}{\__skrapport_and_word:} + \begin{macro*}{\__skrapport_Email_word:} + \begin{macro*}{\__skrapport_Comment_word:} + \begin{macro*}{\contentsname} + \begin{macro*}{\refname} + \begin{macro*}{\figurename} + \begin{macro*}{\tablename} + \begin{macro*}{\appendixname} + \begin{macro*}{\abstractname} + \begin{macro*}{\today} + \begin{macro*}{\__skrapport_RFC_language:} +\begin{MacroCode}{class} + \cs_gset:Nn\__skrapport_and_word:{och} + \cs_gset:Nn\__skrapport_Email_word:{E-post} + \cs_gset:Nn\__skrapport_Comment_word:{Kommentar} + \cs_gset:Npn\contentsname{Innehåll} + \cs_gset:Npn\refname{Referenser} + \cs_gset:Npn\figurename{Figur} + \cs_gset:Npn\tablename{Tabell} + \cs_gset:Npn\appendixname{Bilaga} + \cs_gset:Npn\abstractname{Sammanfattning} + \cs_gset:Npn\today + {\int_use:N\year--\int_use:N\month--\int_use:N\day} + \cs_gset:Nn\__skrapport_RFC_language:{swe} +\end{MacroCode} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + +\begin{MacroCode}{class} + \PassOptionsToPackage{iso,swedish}{isodate} + } + {en}{ + \bool_if:NTF\g__skrapport_has_polyglossia_bool{ + \setmainlanguage[variant=british]{english} + \setotherlanguage{swedish} + }{ + \RequirePackage[swedish,british]{babel} + } +\end{MacroCode} + \begin{macro*}{\__skrapport_and_word:} + \begin{macro*}{\__skrapport_Email_word:} + \begin{macro*}{\__skrapport_Comment_word:} + \begin{macro*}{\contentsname} + \begin{macro*}{\refname} + \begin{macro*}{\figurename} + \begin{macro*}{\tablename} + \begin{macro*}{\appendixname} + \begin{macro*}{\abstractname} + \begin{macro*}{\today} + \begin{macro*}{\__skrapport_RFC_language:} +\begin{MacroCode}{class} + \cs_gset:Nn\__skrapport_and_word:{and} + \cs_gset:Nn\__skrapport_Email_word:{Email} + \cs_gset:Nn\__skrapport_Comment_word:{Comment} + \cs_gset:Npn\contentsname{Contents} + \cs_gset:Npn\refname{References} + \cs_gset:Npn\figurename{Figurr} + \cs_gset:Npn\tablename{Table} + \cs_gset:Npn\appendixname{Appendix} + \cs_gset:Npn\abstractname{Abstract} + \cs_gset:Npn\today + {\int_use:N\year--\int_use:N\month--\int_use:N\day} + \cs_gset:Nn\__skrapport_RFC_language:{eng} +\end{MacroCode} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} + \end{macro*} +\begin{MacroCode}{class} + \PassOptionsToPackage{iso,british}{isodate} + } + }{ +\end{MacroCode} + Fallback prints an informational message and leaves both \pkg{babel} + and \pkg{polyglossia} unloaded. +\begin{MacroCode}{class} + \msg_info:nnn{skrapport}{invalid-lang}{#1} + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_font:n}[1] + {Font (\texttt{none}, \texttt{kpfonts}, \texttt{lmodern}, + \texttt{palatino}, \texttt{minion} or \texttt{skdoc})} + \changes{0.12a}{Drop the post-\pkg{amsmath} hook entirely. + Load \pkg{fontspec} in \texttt{word} and + \texttt{none}} + We set up the somewhat involved font stack. +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_setup_font:n#1{ + \PassOptionsToPackage{intlimits}{amsmath} + \PassOptionsToPackage{full}{textcomp} + \str_case:nnn{#1}{ +\end{MacroCode} + The \texttt{none} font stack is special. If we're using + \hologo{XeTeX} or \hologo{LuaTeX}, we load the \pkg{fontspec} + package. Otherwise, we do nothing. +\begin{MacroCode}{class} + {none}{ + \bool_if:nT{\luatex_if_engine_p: || \xetex_if_engine_p:}{ + \RequirePackage[quiet]{fontspec} + } + } +\end{MacroCode} + The \texttt{kpfonts} font stack simply loads \pkg{kpfonts}... +\begin{MacroCode}{class} + {kpfonts}{ + \RequirePackage[easyscsl,intlimits,sumlimits]{kpfonts} + } +\end{MacroCode} + ...and the \texttt{lmodern} font stack loads \pkg{lmodern}. +\begin{MacroCode}{class} + {lmodern}{ + \RequirePackage{lmodern} + } +\end{MacroCode} + The \texttt{palatino} font stack loads \pkg{tgpagella} if available, + but falls back to \pkg{mathpazo} otherwise. +\begin{MacroCode}{class} + {palatino}{ + \file_if_exist:nTF{tgpagella.sty}{ + \RequirePackage{arev} + \RequirePackage{pxfonts} + \RequirePackage{tgpagella} + }{ + \RequirePackage[osf]{mathpazo} + } + } +\end{MacroCode} + Minion Pro, provided by the \texttt{minion} font stack, loads both + \pkg{minionpro} (the font) and \pkg{MnSymbol} (appropriate math + symbols). +\begin{MacroCode}{class} + {minion}{ + \AtEndOfClass{ + \cs_set_eq:NN\__skrapport_old_vec:\vec + \cs_undefine:N\vec + \RequirePackage{MyriadPro} + \RequirePackage{MinionPro} + \RequirePackage{MnSymbol} + \cs_set_eq:NN\vec\__skrapport_old_vec: + } + } +\end{MacroCode} + Finally, the \texttt{skdoc} font stack loads \pkg{PTSerif} and + \pkg{opensans}, inspired by the style of the \pkg{skdoc} class. +\begin{MacroCode}{class} + {skdoc}{ + \RequirePackage{PTSerif} + \RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} + } +\end{MacroCode} + The \texttt{word} font stack mimics recent versions of Microsoft + Word, using Cambria, Consolas and Calibri. This requires a modern + engine that supports \pkg{fontspec}. +\begin{MacroCode}{class} + {word}{ + \bool_if:nF{\luatex_if_engine_p: || \xetex_if_engine_p:}{ + \msg_fatal:nnn{skrapport}{font-requires-xetex}{word} + } + \RequirePackage[quiet]{fontspec} + \setmainfont[Ligatures=TeX]{Cambria} + \setsansfont[Ligatures=TeX]{Calibri} + \setmonofont[Scale=0.95]{Consolas} + \apptocmd{\__skrapport_after_ams_hook:}{ + \setmathfont{Cambria Math} + }{}{} + } + }{ +\end{MacroCode} + As a fallback, we print a waning and load no font packages. +\begin{MacroCode}{class} + \msg_warning:nnn{skrapport}{invalid-font}{#1} + } + \str_if_eq:nnF{#1}{none}{ +\end{MacroCode} + All font stacks except \texttt{none} and \texttt{kpfonts} require + additional packages. Or, rather, \texttt{none} can't load these + packages by definition, and \texttt{kpfonts} already loads them + internally \footcite[p.~1]{kpfonts}. They are always useful. + + We also load \pkg{inconsolata} as our monospace font. + But we don't load it when using the \texttt{none} font stack. +\begin{MacroCode}{class} + \str_if_eq:nnF{#1}{kpfonts}{ + \str_if_eq:nnF{#1}{word}{ + \RequirePackage[scaled=1.03]{inconsolata} + } + \AtEndOfClass{ + \RequirePackage{amsmath} +\end{MacroCode} + The \pkg{mnsymbol} package is incompatible with \pkg{amssymb}. +\begin{MacroCode}{class} + \str_if_eq:nnF{#1}{minion}{ + \RequirePackage{amssymb} + } + \RequirePackage{textcomp} + } + } + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_parskip:} + \changes{0.12a}{Fixed bug where font size reset the \cs{parindent}} + This part mixes \LaTeXe\ and \LaTeX3, which may not be a good thing. + On the other hand, it seems hard to avoid. Most of the code is + half-lifted from \pkg{parskip} and converted to \LaTeX3. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_parskip:{ + \AtEndOfClass{ + \skip_gset:Nn\parskip{0.5\baselineskip~plus~2pt} + \dim_gzero:N\parindent + \skip_gset:Nn\parfillskip{30pt~plus~1fil} +\end{MacroCode} + \begin{macro*}{\@listI} + \begin{macro*}{\@listi} +\begin{MacroCode}{class} + \cs_gset:Npn\@listI{ + \dim_set_eq:NN\leftmargin\leftmargini + \dim_set_eq:NN\parsep\parskip + \dim_zero:N\topsep + \dim_zero:N\itemsep + } + \cs_gset_eq:NN\@listi\@listI +\end{MacroCode} + \end{macro*} + \end{macro*} +\begin{MacroCode}{class} + \dim_gset_eq:NN\leftmargin\leftmargini + \dim_gset_eq:NN\parsep\parskip + \dim_gzero:N\topsep + \dim_gzero:N\itemsep +\end{MacroCode} + \begin{macro*}{\@listii} +\begin{MacroCode}{class} + \cs_gset:Npn\@listii{ + \dim_set_eq:NN\leftmargin\leftmarginii + \dim_set_eq:NN\labelwidth\leftmarginii + \dim_set_eq:NN\parsep\parskip + \dim_sub:Nn\labelwidth{-\labelsep} + \dim_zero:N\topsep + \dim_zero:N\itemsep + } +\end{MacroCode} + \end{macro*} + \begin{macro*}{\@listiii} +\begin{MacroCode}{class} + \cs_gset:Npn\@listiii{ + \dim_set_eq:NN\leftmargin\leftmarginiii + \dim_set_eq:NN\labelwidth\leftmarginiii + \dim_set_eq:NN\parsep\parskip + \dim_sub:Nn\labelwidth{-\labelsep} + \dim_zero:N\topsep + \dim_zero:N\itemsep + } +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} + \dim_gzero:N\partopsep +\end{MacroCode} + \begin{macro*}{\@starttoc}[1] + {Table of contents extension} +\begin{MacroCode}{class} + \RenewDocumentCommand\@starttoc{m}{ + \group_begin: + \dim_zero:N\parskip + \file_if_exist:nT{\c_job_name_tl.##1}{ + \file_input:n{\c_job_name_tl.##1} + } + \if@filesw + \iow_new:c{tf@##1} + \iow_open:cn{tf@##1}{\c_job_name_tl.##1} + \fi + \@nobreakfalse + \group_end: + } +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_math:} + This is the simplest option, only loading \pkg{skmath} if it exists. + Also the post-skmath hook is run. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_math:{ + \file_if_exist:nT{skmath.sty}{\RequirePackage{skmath}} +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_draft:} + Setting up the \opt{draft} mode is also fairly easy, as we only need + wider (wider than \SI{0}{\point}, that is) \cs{overfullrule}s. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_draft:{ + \bool_if:NTF\g__skrapport_draft_bool{ + \dim_gset:Nn\overfullrule{5pt} + }{ + \msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_draft:} + \prg_do_nothing: + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_color:} + Setting up colors is also fairly easy, as we only have to load the + \pkg{xcolor} package. All the other color-related code is in other + places, utilizing the \cs{g__skdoc_color_bool} boolean. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_color:{ + \bool_if:NTF\g__skrapport_color_bool{ + \RequirePackage{xcolor} + \PassOptionsToPackage{ + labelfont+={bf,color=skrapport@captioncolor} + }{caption} + }{ + \msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_color:} + \prg_do_nothing: + } +} +\end{MacroCode} + \end{macro} + \begin{macro}{\__skrapport_setup_color:n} + We may also set up a specific color theme using options. This is + easily done by first calling \cs{__skrapport_setup_color:}, then + calling \cs{colortheme} at \cs{BeginDocument}. +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_setup_color:n#1{ + \__skrapport_setup_color: + \bool_if:NTF\g__skrapport_color_bool{ + \AtBeginDocument{\colortheme{#1}} + }{ + \msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_color:n} + \prg_do_nothing: + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_xelatex:} + \changes{0.12a}{Don't load \pkg{polyglossia} for \hologo{LuaTeX}. + Don't load \pkg{fontspec} for any engine} + This macro contains special setup code for the \hologo{XeTeX} and + \hologo{LuaTeX} engines, such as providing + missing commands (which have been replaced by equivalent Unicode + characters, apparently) and loading \pkg{polyglossia}. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_xelatex:{ + \AtEndOfClass{ + \cs_undefine:N\dblcolon + \cs_undefine:N\coloneqq + \cs_undefine:N\Coloneqq + \cs_undefine:N\eqqcolon + \RequirePackage{unicode-math} + \unimathsetup { + math-style = ISO, + bold-style = ISO, + sans-style = italic, + nabla = upright, + partial = italic, + vargreek-shape = unicode + } + } +\end{MacroCode} + \begin{macro}{\nobreakspace} +\begin{MacroCode}{class} + \DeclareDocumentCommand\nobreakspace{}{\leavevmode\nobreak\space} +\end{MacroCode} + \end{macro} + Since apparently \hologo{LuaLaTeX} isn't supported by + \pkg{polyglossia}, we fall back to \pkg{babel} in that engine. + Thus, only load \pkg{polyglossia} for \hologo{XeLaTeX}. +\begin{MacroCode}{class} + \xetex_if_engine:TF{ + \RequirePackage{polyglossia} + \bool_gset_true:N\g__skrapport_has_polyglossia_bool + }{ + \bool_gset_false:N\g__skrapport_has_polyglossia_bool + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_pdftex:} + This macro contains special setup code for the \hologo{pdfTeX} + engine. Currently, it only sets the font encoding to T1. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_pdftex:{ + \RequirePackage[T1]{fontenc} + \bool_gset_false:N\g__skrapport_has_polyglossia_bool +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\__skrapport_setup_engine_specific:} + This macro detects the current engine and calls the appropriate + engine setup macro. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_engine_specific:{ + \bool_if:nTF{\luatex_if_engine_p: || \xetex_if_engine_p:}{ + \__skrapport_setup_xelatex: + }{ + \__skrapport_setup_pdftex: + } +} +\end{MacroCode} + \end{macro} + + \paragraph{Variants with expandable arguments} + Some option setup macros accept arguments, but those arguments are + not expanded. Here, we provide variants which expand the parameters + properly using the excellent \pkg{l3prg} functionality. + \begin{macro}{\__skrapport_setup_ptsize:x} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_setup_ptsize:n{ x } +\end{MacroCode} + \end{macro} + \begin{macro}{\__skrapport_setup_titles:x} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_setup_titles:n{ x } +\end{MacroCode} + \end{macro} + \begin{macro}{\__skrapport_setup_lang:x} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_setup_lang:n{ x } +\end{MacroCode} + \end{macro} + \begin{macro}{\__skrapport_setup_font:x} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_setup_font:n{ x } +\end{MacroCode} + \end{macro} + + \subsubsection{Key-value system} + Let's define some \pkg{l3keys} corresponding to the options. Note + that most of them just refer to a macro in their \texttt{.code:n} + block --- these macros were defined earlier. +\begin{MacroCode}{class} +\keys_define:nn{skrapport}{ +\end{MacroCode} + \begin{option}{paper}{a4paper, a5paper, a4, a5} + \changes{0.12}{Values \texttt{a4paper} and \texttt{a5paper} are + now deprecated} + \begin{option}{a4paper} + \changes{0.12}{Option is now deprecated} + \begin{option}{a5paper} + \changes{0.12}{Option is now deprecated} + Declare the paper size options. Note that having to handle the + deprecated \texttt{a4paper} and \texttt{a5paper} values of the + \opt{paper} option makes the code less readable. In a few + versions, when these options are removed, the code should probably + be refactored to look something like the \opt{ptsize} option below. +\begin{MacroCode}{class} + paper .choice:, + paper / a4 .code:n = + {\__skrapport_setup_paper:n{a4}}, + paper / a5 .code:n = + {\__skrapport_setup_paper:n{a5}}, + paper / a4paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {paper=a4paper}{paper=a4} + \keys_set:nn{skrapport}{paper=a4}}, + paper / a5paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {paper=a5paper}{paper=a5} + \keys_set:nn{skrapport}{paper=a4}}, + paper .value_required:, + a4paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {a4paper}{paper=a4} + \keys_set:nn{skrapport}{paper=a4}}, + a5paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {a5paper}{paper=a5} + \keys_set:nn{skrapport}{paper=a5}}, +\end{MacroCode} + \end{option} + \end{option} + \end{option} + + \begin{option}{ptsize}{10pt, 11pt, 12pt} + \begin{option}{10pt} + \begin{option}{11pt} + \begin{option}{12pt} + Declare point size options. Note that we don't deprecate the + non-\opt{ptsize} aliases as they are much easier to type. +\begin{MacroCode}{class} + ptsize .choices:nn = + { 10pt, 11pt, 12pt } + {\__skrapport_setup_ptsize:x{\tl_use:N\l_keys_choice_tl}}, + ptsize .value_required:, + 10pt .meta:n = {ptsize=10pt}, + 11pt .meta:n = {ptsize=11pt}, + 12pt .meta:n = {ptsize=12pt}, +\end{MacroCode} + \end{option} + \end{option} + \end{option} + \end{option} + + \begin{option}{twocolumn} + \changes{0.08}{Added option \opt{twocolumn}} + \changes{0.12a}{Use \cs{AtEndOfClass} instead of \cs{AtEndClass}} + Declare column options. The code here should be run through + \cs{AtEndOfClass} so that the setup code can patch everythin + properly. + \begin{option}{onecolumn} + \changes{0.12}{Option is now deprecated} + The \opt{onecolumn} option has no effect and is deprecated. +\begin{MacroCode}{class} + twocolumn .code:n = + {\AtEndOfClass{\__skrapport_setup_twocolumn:}}, + onecolumn .code:n = + {\msg_warning:nnn{skrapport}{option-no-effect}{onecolumn}}, +\end{MacroCode} + \end{option} + \end{option} + + \begin{option}{draft}{true, false} + \begin{option}{final} + Declare \opt{draft} and \opt{final} options. Note that even if the + \opt{final} option does absolutely nothing, users may expect it to + be there and as such it is not deprecated. +\begin{MacroCode}{class} + draft .choice:, + draft / true .code:n = + {\bool_gset_true:N\g__skrapport_draft_bool + \__skrapport_setup_draft:}, + draft / false .code:n = + {\bool_gset_false:N\g__skrapport_draft_bool}, + draft .default:n = true, + final .code:n = {\prg_do_nothing:}, +\end{MacroCode} + \end{option} + \end{option} + + Declare the \opt{fleqn} and \opt{leqno} options, mainly for + compatibility with the \pkg{article} class. + \begin{option}{leqno} +\begin{MacroCode}{class} + leqno .code:n = + {\__skrapport_setup_leqno:}, +\end{MacroCode} + \end{option} + \begin{option}{fleqn} +\begin{MacroCode}{class} + fleqn .code:n = + {\__skrapport_setup_fleqn:}, +\end{MacroCode} + \end{option} + + \begin{option}{titles}{rm, bf, sf} + Declare options for section titles. The old \opt*{??titles} aliases + are deprecated and will be removed in a future version. + \begin{option}{rmtitles} + \changes{0.12}{Option is now deprecated} + \begin{option}{bftitles} + \changes{0.12}{Option is now deprecated} + \begin{option}{sftitles} + \changes{0.09}{Added \opt{sftitles} option} + \changes{0.12}{Option is now deprecated} +\begin{MacroCode}{class} + titles .choices:nn = + { rm, bf, sf } + {\__skrapport_setup_titles:x{\tl_use:N\l_keys_choice_tl}}, + titles .value_required:, + rmtitles .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {rmtitles}{titles=rm} + \keys_set:nn{skrapport}{titles=rm}}, + bftitles .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {bftitles}{titles=bf} + \keys_set:nn{skrapport}{titles=bf}}, + sftitles .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {sftitles}{titles=sf} + \keys_set:nn{skrapport}{titles=sf}}, +\end{MacroCode} + \end{option} + \end{option} + \end{option} + \end{option} + + \begin{option}{lang}{sv, en} + \changes{0.12}{Incompatible change: values \texttt{swe} and + \texttt{eng} are now \texttt{sv} and \texttt{en}, + respectively} + \begin{option}{swe} + \changes{0.12}{Option is now deprecated} + \begin{option}{eng} + \changes{0.12}{Option is now deprecated} + Declare options for swedish/english \pkg{babel} or + \pkg{polyglossia} support. Again, the old \opt{swe} and \opt{eng} + aliases are deprecated and will be removed. +\begin{MacroCode}{class} + lang .choices:nn = + { sv, en } + {\__skrapport_setup_lang:x{\tl_use:N\l_keys_choice_tl}}, + lang .value_required:, + swe .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {swe}{lang=sv} + \keys_set:nn{skrapport}{lang=sv}}, + eng .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {eng}{lang=en} + \keys_set:nn{skrapport}{lang=en}}, +\end{MacroCode} + \end{option} + \end{option} + \end{option} + + \begin{option}{font}{none, kpfonts, lmodern, palatino, minion, skdoc} + Declare font options. Again, aliases are deprecated. + \begin{option}{kpfonts} + \changes{0.07}{Added option \opt{kpfonts}, set as default + option for fonts} + \changes{0.12}{Option is now deprecated} + \begin{option}{lmodern} + \changes{0.12}{Option is now deprecated} + \begin{option}{palatino} + \changes{0.12}{Option is now deprecated} + \begin{option}{minion} + \changes{0.11}{Added option \opt{minion}} + \changes{0.12}{Option is now deprecated} + \begin{option}{skdoc} + \changes{0.11a}{Added option \opt{skdoc}} + \changes{0.12}{Option is now deprecated} + \begin{option}{nofont} + \changes{0.12}{Option is now deprecated} +\begin{MacroCode}{class} + font .choices:nn = + { none, kpfonts, lmodern, palatino, minion, skdoc, word } + {\__skrapport_setup_font:x{\tl_use:N\l_keys_choice_tl}}, + font .value_required:, + nofont .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {nofont}{font=none} + \keys_set:nn{skrapport}{font=none}}, + kpfonts .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {kpfonts}{font=kpfonts} + \keys_set:nn{skrapport}{font=kpfonts}}, + lmodern .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {lmodern}{font=lmodern} + \keys_set:nn{skrapport}{font=lmodern}}, + palatino .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {palatino}{font=palatino} + \keys_set:nn{skrapport}{font=palatino}}, + minion .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {minion}{font=minion} + \keys_set:nn{skrapport}{font=minion}}, + skdoc .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {skdoc}{font=skdoc} + \keys_set:nn{skrapport}{font=skdoc}}, +\end{MacroCode} + \end{option} + \end{option} + \end{option} + \end{option} + \end{option} + \end{option} + \end{option} + + \begin{option}{indent}{true, false} + \changes{0.02}{Added option of indented paragraphs} + \begin{option}{noindent} + \changes{0.12}{Option is now deprecated} + Declare indentation options. Since the \opt{noindent} option + technically has no effect and is an alias of \opt{indent=false}, + it has been deprecated. +\begin{MacroCode}{class} + indent .choice:, + indent / true .code:n = {\prg_do_nothing:}, + indent / false .code:n = {\__skrapport_setup_parskip:}, + indent .default:n = true, + noindent .code:n = + {\msg_warning:nnn{skrapport}{option-no-effect}{noindent}}, +\end{MacroCode} + \end{option} + \end{option} + + \begin{option}{color}{true, false} + \changes{0.09}{Added \opt{color} option} + \changes{0.12}{Converted to a key-value option which will load + the specified color theme.} + \begin{option}{nocolor} + Declare color options. Note that we explicitly set the boolean + \cs{g__skrapport_color_bool} as well as setting up the colors + through \cs{__skrapport_setup_color:n}, so that we can keep track + of the color usage even after the options have been set up. +\begin{MacroCode}{class} + color .code:n = + {\str_if_eq:nnTF{#1}{false} + {\bool_gset_false:N\g__skrapport_color_bool} + {\bool_gset_true:N\g__skrapport_color_bool + \str_if_eq:nnTF{#1}{true} + {\__skrapport_setup_color:n{default}} + {\__skrapport_setup_color:n{#1}}}}, + color .default:n = true, + nocolor .meta:n = {color=false}, +\end{MacroCode} + \end{option} + \end{option} + + \begin{option}{nomath}{true, false} + \begin{option}{math} + \changes{0.12}{Option is now deprecated} + Declare math options. As with the \opt{noindent} option, \opt{math} + has been deprecated since it is an alias and has no effect. +\begin{MacroCode}{class} + nomath .choice:, + nomath / false .code:n = {\__skrapport_setup_math:}, + nomath / true .code:n = {\prg_do_nothing:}, + nomath .default:n = true, + math .code:n = + {\msg_warning:nnn{skrapport}{option-no-effect}{math}}, +\end{MacroCode} + \end{option} + \end{option} + + That's it, we're done setting up the \pkg{l3keys} for the options. +\begin{MacroCode}{class} +} +\end{MacroCode} + + We will now define a \enquote{defaults} key-value system because + \texttt{.initial:n} doesn't work they way we want it to. This + key-value system will be used to set flags with which we will + determine wether to set certain default options. + \begin{macro}{\__skrapport_setup_defaults:} + \changes{0.12a}{\texttt{word} font stack is now the default font stack when using \hologo{XeLaTeX}} +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_setup_defaults:{ + \bool_new:N\l__skrapport_has_option_indent_bool + \bool_new:N\l__skrapport_has_option_nomath_bool + \bool_new:N\l__skrapport_has_option_color_bool + \bool_new:N\l__skrapport_has_option_font_bool + \bool_new:N\l__skrapport_has_option_lang_bool + \bool_new:N\l__skrapport_has_option_titles_bool + \bool_new:N\l__skrapport_has_option_draft_bool + \bool_new:N\l__skrapport_has_option_ptsize_bool + \bool_new:N\l__skrapport_has_option_paper_bool + \keys_define:nn{skrapport-default}{ + indent .code:n = + {\bool_set_true:N\l__skrapport_has_option_indent_bool}, + nomath .code:n = + {\bool_set_true:N\l__skrapport_has_option_nomath_bool}, + color .code:n = + {\bool_set_true:N\l__skrapport_has_option_color_bool}, + font .code:n = + {\bool_set_true:N\l__skrapport_has_option_font_bool}, + lang .code:n = + {\bool_set_true:N\l__skrapport_has_option_lang_bool}, + titles .code:n = + {\bool_set_true:N\l__skrapport_has_option_titles_bool}, + draft .code:n = + {\bool_set_true:N\l__skrapport_has_option_draft_bool}, + ptsize .code:n = + {\bool_set_true:N\l__skrapport_has_option_ptsize_bool}, + paper .code:n = + {\bool_set_true:N\l__skrapport_has_option_paper_bool}, +\end{MacroCode} + The following keys correspond to deprecated options. They should + be removed when the corresponding options are removed. +\begin{MacroCode}{class} + nofont .code:n = {\keys_set:nn{skrapport-default}{font}}, + kpfonts .code:n = {\keys_set:nn{skrapport-default}{font}}, + lmodern .code:n = {\keys_set:nn{skrapport-default}{font}}, + palatino .code:n = {\keys_set:nn{skrapport-default}{font}}, + minion .code:n = {\keys_set:nn{skrapport-default}{font}}, + skdoc .code:n = {\keys_set:nn{skrapport-default}{font}}, + swe .code:n = {\keys_set:nn{skrapport-default}{lang}}, + eng .code:n = {\keys_set:nn{skrapport-default}{lang}}, + rmtitles .code:n = {\keys_set:nn{skrapport-default}{titles}}, + bftitles .code:n = {\keys_set:nn{skrapport-default}{titles}}, + sftitles .code:n = {\keys_set:nn{skrapport-default}{titles}}, + 10pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}}, + 11pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}}, + 12pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}}, + a4paper .code:n = {\keys_set:nn{skrapport-default}{paper}}, + a5paper .code:n = {\keys_set:nn{skrapport-default}{paper}}, +\end{MacroCode} +\begin{MacroCode}{class} + } + \ProcessKeysOptions{skrapport-default} + \bool_if:NF\l__skrapport_has_option_indent_bool{ + \keys_set:nn{skrapport}{indent=false} + } + \bool_if:NF\l__skrapport_has_option_nomath_bool{ + \keys_set:nn{skrapport}{nomath=false} + } + \bool_if:NF\l__skrapport_has_option_color_bool{ + \keys_set:nn{skrapport}{color=true} + } + \bool_if:NF\l__skrapport_has_option_font_bool{ + \xetex_if_engine:TF{ + \keys_set:nn{skrapport}{font=word} + }{ + \keys_set:nn{skrapport}{font=kpfonts} + } + } + \bool_if:NF\l__skrapport_has_option_lang_bool{ + \keys_set:nn{skrapport}{lang=sv} + } + \bool_if:NF\l__skrapport_has_option_titles_bool{ + \keys_set:nn{skrapport}{titles=bf} + } + \bool_if:NF\l__skrapport_has_option_draft_bool{ + \keys_set:nn{skrapport}{draft=false} + } + \bool_if:NF\l__skrapport_has_option_ptsize_bool{ + \keys_set:nn{skrapport}{ptsize=11pt} + } + \bool_if:NF\l__skrapport_has_option_paper_bool{ + \keys_set:nn{skrapport}{paper=a4} + } +} +\end{MacroCode} + \end{macro} + + Finally, we process the class options using the keys defined earlier. + We also run the engine-specific code implemented above, and the fake + key system used to define defaults. + + Note that we save and restore \cs{@classoptionslist} around the + engine-specific setup. This is because we might load \pkg{xkeyval}, + which apparently removes all key-value options from the list when + loaded (and this is really bad for us). +\begin{MacroCode}{class} +\cs_set_eq:NN\__skrapport_tmpa_cs:\@classoptionslist +\RequirePackage{xkeyval} +\cs_set_eq:NN\__skrapport_tmpb_cs:\@classoptionslist +\cs_set_eq:NN\@classoptionslist\__skrapport_tmpa_cs: +\__skrapport_setup_engine_specific: +\ProcessKeysOptions{skrapport} +\__skrapport_setup_defaults: +\cs_set_eq:NN\@classoptionslist\__skrapport_tmpb_cs: +\cs_undefine:N\__skrapport_tmpa_cs: +\cs_undefine:N\__skrapport_tmpb_cs: +\end{MacroCode} + + \subsection{Required packages} + We also include some essential packages per default. The + \pkg{calc} package, for instance, is essential in later + definitions. +\begin{MacroCode}{class} +\RequirePackage{calc,isodate,multicol} +\end{MacroCode} + + At the end of the class definition we load a couple of very + useful packages that improve typesetting. These are + \pkg{microtype}, \pkg{icomma}. +\begin{MacroCode}{class} +\AtEndOfClass{ + \RequirePackage{microtype} + \RequirePackage{icomma} +} +\end{MacroCode} + + When the document starts, we set the URL style if the user has + loaded the \pkg{url} package. +\begin{MacroCode}{class} +\AtBeginDocument{ + \cs_if_exist:NT\urlstyle{\urlstyle{same}} +} +\end{MacroCode} + + \subsection{Utilities} + We define useful \LaTeX3 replacements of \LaTeXe\ stuff that + hasn't made its way into \pkg{interface3}. This includes + a \cs{settowidth} clone and possibly more stuff later. + \begin{macro}{\dim_set_to_wd:Nn} +\begin{MacroCode}{class} +\cs_new:Npn\dim_set_to_wd:Nn#1#2{ + \hbox_set:Nn\l_tmpa_box{#2} + \dim_set:Nn#1{\box_wd:N\l_tmpa_box} + \box_clear:N\l_tmpa_box +} +\end{MacroCode} + \end{macro} + + \subsection{Hidden things} + Set some default measurements (should probably be replaced with + simply loading \pkg{typearea}). +\begin{MacroCode}{class} +\dim_add:Nn\textwidth{0.5\oddsidemargin} +\dim_add:Nn\textwidth{0.5\evensidemargin} +\dim_add:Nn\oddsidemargin{-0.5\oddsidemargin} +\dim_add:Nn\evensidemargin{-0.5\evensidemargin} +\dim_gset:Nn\lineskip{1pt} +\dim_gset:Nn\normallineskip{1pt} +\end{MacroCode} + \begin{macro}{\baselinestretch} + Note that we can't use \cs{RenewDocumentCommand} as that yields an + infinite loop before or at \env{document}. +\begin{MacroCode}{class} +\cs_set:Npn\baselinestretch{} +\end{MacroCode} + \end{macro} + + \subsubsection{Penalties} +\begin{MacroCode}{class} +\int_gset:Nn\@lowpenalty {51} +\int_gset:Nn\@medpenalty {151} +\int_gset:Nn\@highpenalty{301} +\setcounter{topnumber}{2} +\setcounter{bottomnumber}{1} +\setcounter{totalnumber}{4} +\setcounter{dbltopnumber}{2} +\end{MacroCode} + \begin{macro}{\topfraction} +\begin{MacroCode}{class} +\RenewDocumentCommand\topfraction{}{.75} +\end{MacroCode} + \end{macro} + \begin{macro}{\bottomfraction} +\begin{MacroCode}{class} +\RenewDocumentCommand\bottomfraction{}{.5} +\end{MacroCode} + \end{macro} + \begin{macro}{\textfraction} +\begin{MacroCode}{class} +\RenewDocumentCommand\textfraction{}{.25} +\end{MacroCode} + \end{macro} + \begin{macro}{\floatpagefraction} +\begin{MacroCode}{class} +\RenewDocumentCommand\floatpagefraction{}{.625} +\end{MacroCode} + \end{macro} + \begin{macro}{\dbltopfraction} +\begin{MacroCode}{class} +\RenewDocumentCommand\dbltopfraction{}{.75} +\end{MacroCode} + \end{macro} + \begin{macro}{\dblfloatpagefraction} +\begin{MacroCode}{class} +\RenewDocumentCommand\dblfloatpagefraction{}{.625} +\end{MacroCode} + \end{macro} + + \subsection{User-level commands and environments} + \subsubsection{The front page} + \begin{macro}{\title}[1] + {Title of the document} + \begin{macro*}{\g__skrapport_title_tl} +\begin{MacroCode}{class} +\tl_new:N\g__skrapport_title_tl +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\title{m}{ + \tl_gset:Nn\g__skrapport_title_tl{#1} +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\date}[1] + {Date in ISO8601 format} + The \cs{date} macro sets the current date of the document. It only + accepts dates accepted by \pkg{isodate} (or the special value + \enquote{\texttt{today}}). Dates are always printed using the + current format as specified by the \pkg{isodate} package. The default + value of the date (if \cs{date} isn't used) is \cs{today}. + \begin{macro*}{\g__skrapport_title_tl} +\begin{MacroCode}{class} +\tl_new:N\g__skrapport_date_tl +\tl_gset:Nn\g__skrapport_date_tl{\today} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\date{m}{ + \str_if_eq:nnTF{#1}{today}{ + \tl_gset:Nn\g__skrapport_date_tl{\today} + }{ + \if_meaning:w \today #1 + \tl_gset:Nn\g__skrapport_date_tl{\today} + \else: + \tl_gset:Nn\g__skrapport_date_tl{\printdate{#1}} + \fi: + } +} +\end{MacroCode} + \end{macro} + + \begin{macro}{\author}[2] + {Optional email address} + {Author name} + \changes{0.10b}{Improved \cs{author} macro} + \changes{0.12}{Use comma-separated lists instead of token list} + The \cs{author} macro is redefined to accept an optional argument + and to be used multiple times. + \begin{macro*}{\__skrapport_email:n}[1] + {Email address} + \changes{0.12a}{Store \cs{textemdash} instead of \cs{NoValue}} + The \cs{skrapport@email} helper macro typesets an email address + using \pkg{hyperref} if that package is used. This is suboptimal, + the macro behaves differently with respect to special characters + depending on wether \pkg{hyperref} is loaded or not. +\begin{MacroCode}{class} +\cs_new_nopar:Npn\__skrapport_email:n#1{ + \texttt{#1} +} +\AtBeginDocument{ + \cs_if_exist:NT\href{ + \cs_gset_nopar:Npn\__skrapport_email:n#1{ + \href{mailto:#1}{\nolinkurl{#1}} + } + } +} +\end{MacroCode}{class} + \end{macro*} + \begin{macro*}{\g__skrapport_author_clist} +\begin{MacroCode}{class} +\clist_new:N\g__skrapport_author_clist +\end{MacroCode} + \end{macro*} + \begin{macro*}{\g__skrapport_email_clist} +\begin{MacroCode}{class} +\clist_new:N\g__skrapport_email_clist +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\author{om}{% + \clist_gput_right:Nn\g__skrapport_author_clist{#2} + \clist_gput_right:Nn\g__skrapport_email_clist + {\IfNoValueTF{#1}{\textemdash}{#1}} +} +\end{MacroCode} + \begin{macro}{\__skrapport_author_list:} + \changes{0.12a}{Use \cs{clist_use:Nnnn}} + This macro lists all the authors in the comma-separated list + \cs{g__skrapport_author_clist}, separating them with a comma + or the word \enquote{and} (in the appropriate language). +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_author_list:{ + \clist_use:Nnnn\g__skrapport_author_clist + {~\__skrapport_and_word:{}~}{,~}{~\__skrapport_and_word:{}~} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\__skrapport_email_list:} + \changes{0.12a}{Use \cs{clist_use:Nnnn}} + This macro lists the email addresses in the comma-separated list + \cs{g__skrapport_email_clist} by applying \cs{__skrapport_email:} + if appropriate (or printing an em-dash if no value exists) and + separating them with commas. +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_email_list:{ + \int_compare:nT{\clist_count:N\g__skrapport_author_clist>\c_zero}{ + \clist_use:Nnnn\g__skrapport_email_clist{\\}{\\}{\\} + } +} +\end{MacroCode} + \end{macro} + \end{macro} + + \begin{macro}{\regarding}[1] + {Text snippet} + This macro defines a variable used by \cs{maketitle} to insert a + simple text into the header on the title page. + \begin{macro*}{\g__skrapport_regarding_tl} +\begin{MacroCode}{class} +\tl_new:N\g__skrapport_regarding_tl +\DeclareDocumentCommand\regarding{m}{ + \tl_gset:Nn\g__skrapport_regarding_tl{#1} +} +\end{MacroCode} + \end{macro*} + \end{macro} + + \begin{macro}{\license}[1] + {Short license description} + \changes{0.07}{Added command \cs{license}} + This macro defines a variable used by \cs{maketitle} to insert a + license into the footer on the titlepage. + \begin{macro*}{\g__skrapport_copyright_unprinted_bool} +\begin{MacroCode}{class} +\bool_new:N\g__skrapport_copyright_unprinted_bool +\AtEndDocument{ + \bool_if:NT\g__skrapport_copyright_unprinted_bool + {\msg_warning:nn{skrapport}{license-not-printed}} +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\g__skrapport_copyright_tl} +\begin{MacroCode}{class} +\tl_new:N\g__skrapport_copyright_tl +\DeclareDocumentCommand\license{m}{ + \tl_gset:Nn\g__skrapport_copyright_tl{#1} + \bool_gset_true:N\g__skrapport_copyright_unprinted_bool +} +\end{MacroCode} + \end{macro*} + \end{macro} + + \begin{macro}{\maketitle}[1] + {Optional key-value list} + \changes{0.12a}{Added optional key-value argument and PDFinfo} + The standard \cs{maketitle} command as taken from the \pkg{article} + class but with some basic restyling. +\begin{MacroCode}{class} +\keys_define:nn{skrapport/maketitle}{ + hide .clist_set:N = \l__skrapport_maketitle_hide_clist, + hide .value_required:, + nopdfinfo .bool_set_inverse:N = \l__skrapport_maketitle_pdfinfo_bool, + nopdfinfo .default:n = true +} +\end{MacroCode} + \begin{macro*}{\__skrapport_smallprint_style:} +\begin{MacroCode}{class} +\cs_new_protected:Nn\__skrapport_smallprint_style:{} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\__skrapport_abstract_style:} +\begin{MacroCode}{class} +\cs_new_protected:Nn\__skrapport_abstract_style: + {\__skrapport_title_style:} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\maketitle{o}{ + \clist_clear:N\l__skrapport_maketitle_hide_clist + \bool_new:N\l__skrapport_maketitle_pdfinfo_bool + \bool_set_true:N\l__skrapport_maketitle_pdfinfo_bool + \IfNoValueF{#1}{\keys_set:nn{skrapport/maketitle}{#1}} + \bool_if:NT\l__skrapport_maketitle_pdfinfo_bool{ + \exp_args:NNx\cs_if_exist_use:NT\hypersetup{{ + pdfinfo={ + Title={\tl_use:N\g__skrapport_title_tl}, + Subject={\tl_use:N\g__skrapport_regarding_tl}, + Author={ + \clist_use:Nnnn\g__skrapport_author_clist{,~}{,~}{,~} + }, + Lang={\__skrapport_RFC_language:} + } + }} + } + \par + \group_begin: + \RenewDocumentCommand\thefootnote{}{ + \fnsymbol{footnote} + } + \RenewDocumentCommand\@makefnmark{}{ + \hbox_overlap_right:n{ + \@textsuperscript{\normalfont\@thefnmark} + } + } + \RenewDocumentCommand\@makefntext{m+}{ + \dim_set:Nn\parindent{1em}\noindent + \hbox_to_wd:nn{1.8em}{ + \hss\@textsuperscript{\normalfont\@thefnmark} + } + ##1 + } + \newpage + \int_gzero:N\@topnum + \__skrapport_maketitle: + \thispagestyle{plain} + \group_end: + \setcounter{footnote}{0} +} +\end{MacroCode} + \end{macro} + \begin{macro*}{\__skrapport_maketitle:} +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_maketitle:{ + \newpage + \hbox:n{} + \begin{flushleft} + \vspace{-\headsep} + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \small\__skrapport_smallprint_style: + \tl_use:N\g__skrapport_regarding_tl + \tl_if_empty:NF\g__skrapport_regarding_tl{,~} + \tl_use:N\g__skrapport_date_tl\par + } + \vspace{1.5cm} + { + \Huge\__skrapport_title_style: + \tl_use:N\g__skrapport_title_tl + \par + } + \vspace{.125cm} + { + \Large\__skrapport_title_style: + \__skrapport_author_list: + } + \vspace{.75cm} + \end{flushleft} + \par + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{email}{ + \dim_set_to_abstract_or_email_wd:N\l_tmpa_dim + \bool_gset_false:N\g__skrapport_abstract_used + \dim_set:Nn\l_tmpb_dim + {\textwidth-\l_tmpa_dim-\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpa_dim} + \begin{flushright} + \leavevmode\__skrapport_abstract_style: + \__skrapport_Email_word: + \end{flushright} + \end{minipage} + \hspace{\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpb_dim} + \__skrapport_email_list: + \end{minipage} + \par + } +} +\end{MacroCode} + \end{macro*} + + \begin{macro*}{\g__skrapport_abstract_used} + This boolean keeps track of wether the \env{abstract} environment has + been used, and is set accordingly in the main auxillary file. +\begin{MacroCode}{class} +\bool_new:N\g__skrapport_abstract_used +\AtEndDocument{ + \iow_shipout:Nx\@mainaux{ % !!! + \exp_not:N\ExplSyntaxOn + \bool_if:NTF\g__skrapport_abstract_used + {\exp_not:n{\bool_gset_true:N\g__skrapport_abstract_used}} + {\exp_not:n{\bool_gset_false:N\g__skrapport_abstract_used}} + \exp_not:N\ExplSyntaxOff + } +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\dim_set_to_abstract_or_email_wd:N}[1] + {Dimension register} + \changes{0.12a}{Set abstract style before word to fix incorrect width} + This macro sets a dimension to either the width of the email word + or the width of the abstract word depending on the state of + \cs{g__skrapport_abstract_used}. +\begin{MacroCode}{class} +\cs_new:Npn\dim_set_to_abstract_or_email_wd:N#1{ + \dim_set_to_wd:Nn\l_tmpa_dim + {\__skrapport_abstract_style:\abstractname} + \dim_set_to_wd:Nn\l_tmpb_dim + {\__skrapport_abstract_style:\__skrapport_Email_word:} + \bool_if:NTF\g__skrapport_abstract_used + {\dim_set:Nn#1{\dim_max:nn{\l_tmpa_dim}{\l_tmpb_dim}}} + {\dim_set_eq:NN#1\l_tmpb_dim} +} +\end{MacroCode} + \end{macro*} + + \begin{environment}{abstract} + Standard restyled \env{abstract} environment from the + \pkg{article} class. +\begin{MacroCode}{class} +\dim_const:Nn\c__skrapport_abstract_separator_dim{1em} +\DeclareDocumentEnvironment{abstract}{}{ + \bool_gset_true:N\g__skrapport_abstract_used + \dim_set_to_abstract_or_email_wd:N\l_tmpa_dim + \dim_set:Nn\l_tmpb_dim + {\textwidth-\l_tmpa_dim-\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpa_dim} + \begin{flushright} + \leavevmode\__skrapport_abstract_style: + \abstractname + \end{flushright} + \end{minipage} + \hspace{\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpb_dim} +}{ + \end{minipage} +} +\end{MacroCode} + \end{environment} + + \begin{environment}{titlepage} + Titlepage environment. + \begin{macro}{\ps@skrapport@titlepage} +\begin{MacroCode}{class} +\cs_new:Npn\ps@skrapport@titlepage{ + \cs_set:Npn\@oddhead{} + \cs_set:Npn\@evenhead{} + \cs_set:Npn\@oddfoot{ + \begin{minipage}{\textwidth} + \raggedleft\small\par + \__skrapport_smallprint_style: + \tl_use:N\g__skrapport_copyright_tl + \end{minipage} + } + \cs_set_eq:NN\@evenfoot\@oddfoot +} +\end{MacroCode} + \end{macro} +\begin{MacroCode}{class} +\DeclareDocumentEnvironment{titlepage}{}{ + \cleardoublepage\setcounter{page}{1} +}{ + \bool_gset_false:N\g__skrapport_copyright_unprinted_bool + \thispagestyle{skrapport@titlepage} + \cleardoublepage\setcounter{page}{1} +} +\end{MacroCode} + \end{environment} + + \subsubsection{Sectioning} + Sectioning macros. This is kind of messy. We start with creaiting + some counters using our homemade \LaTeX3 counter macros. +\begin{MacroCode}{class} +\setcounter{secnumdepth}{3} +\newcounter{section} +\newcounter{subsection}[section] +\newcounter{subsubsection}[subsection] +\newcounter{paragraph}[subsubsection] +\newcounter{subparagraph}[paragraph] +\end{MacroCode} + Next up, we have macros to display the section numberings. + \begin{macro*}{\thesection} +\begin{MacroCode}{class} +\cs_gset:Npn\thesection{ + \arabic{section} +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\thesubsection} +\begin{MacroCode}{class} +\cs_gset:Npn\thesubsection{ + \thesection.\arabic{subsection} +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\thesubsubsection} +\begin{MacroCode}{class} +\cs_gset:Npn\thesubsubsection{ + \thesubsection.\arabic{subsubsection} +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\theparagraph} +\begin{MacroCode}{class} +\cs_gset:Npn\theparagraph{ + \thesubsubsection.\arabic{paragraph} +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\thesubparagraph} +\begin{MacroCode}{class} +\cs_gset:Npn\thesubparagraph{ + \theparagraph.\arabic{subparagraph} +} +\end{MacroCode} + \end{macro*} + + \paragraph{Pre- and post-section spacing} + Here comes the tricky part. We define two generic macros that add + spacing before and after the section title, to condense the code + a bit. Note that many of the following macros constitute a + reimplementation of \cs{@startsection}, \cs{@ssect}, \cs{@sect} and + friends. + \begin{macro}{\__skrapport_pre_section:n}[1] + {Skip before the section title} +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_pre_section:n#1{ + \leavevmode\par + \skip_set:Nn\l_tmpa_skip{#1} + \@afterindenttrue % !!! + \dim_compare:nT{\l_tmpa_skip<\c_zero_skip}{ + \skip_set:Nn\l_tmpa_skip{-\l_tmpa_skip} + \@afterindentfalse % !!! + } + \if@nobreak \everypar{} \else + \addpenalty\@secpenalty % !!! + \skip_vertical:N\l_tmpa_skip + \fi +} +\end{MacroCode} + \end{macro} + \begin{macro}{\__skrapport_post_section:n}[1] + {Space after the section title} +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_post_section:n#1{ + \skip_set:Nn\l_tmpa_skip{#1} + \dim_compare:nTF{\l_tmpa_skip>\c_zero_skip}{ + \par\nobreak + \skip_vertical:N\l_tmpa_skip + \@afterheading % !!! + }{ + \@nobreakfalse + \global\@noskipsectrue + \skip_horizontal:n{-\l_tmpa_skip} + } + \ignorespaces +} +\end{MacroCode} + \end{macro} + + \paragraph{Starred sections} + These two macros (the first only being an alias for the second with + its last argument empty) correspond to unnumbered sections. Or, + rather, they do all the typesetting and none of the TOC/counter + stuff. This means that starred sections only call this macro, while + unstarred ones call other macros in addition to this macro. + \begin{macro*}{\__skrapport_section_star:nnn} + \begin{macro}{\__skrapport_section_star:nnnn}[4] + {Indentation of section title} + {Styling of the section title} + {Actual section title} + {Optional code to run in the indentation (\emph{i.e.} section number)} +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_section_star:nnn#1#2#3{ + \__skrapport_section_star:nnnn{#1}{#2}{#3}{} +} +\cs_new:Npn\__skrapport_section_star:nnnn#1#2#3#4{ + \group_begin: + #2 + \hbox_set:Nn\l_tmpa_box{{\skip_horizontal:n{#1}#4}} + \dim_set:Nn\hangindent{#1+\box_wd:N\l_tmpa_box} + \noindent\box_use_clear:N\l_tmpa_box + \interlinepenalty\@M % !!! + #3 + \group_end: +} +\end{MacroCode} + \end{macro} + \end{macro*} + + \paragraph{Unstarred sections} + This macro typesets an unstarred section, \emph{i.e.} a numbered + one. It defines a temporary macro containing the section number + (maybe, depends on the \cs{c@secnumdepth} counter) which it passes + on to \cs{__skrapport_section_star:nnnn}, and then writes some things + to the TOC. + \begin{macro}{\__skrapport_section_nostar:nnnnnn}[6] + {Section counter name} + {Section level} + {Indentation of section title} + {Styling of the section title} + {Actual section title} + {Section title for TOC} +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_section_nostar:nnnnnn#1#2#3#4#5#6{ + \cs_set:Nn\__skrapport_saved_section:{} + \int_compare:nF{#2>\value{secnumdepth}}{ + \refstepcounter{#1} + \cs_set:Nn\__skrapport_saved_section:{\use:c{the#1}~} + } + \__skrapport_section_star:nnnn + {#3}{#4}{#5}{\__skrapport_saved_section:} + \use:c{#1mark}{#6} + \addcontentsline{toc}{#1}{ + \int_compare:nF{#2>\value{secnumdepth}}{ + \protect\numberline{\use:c{the#1}} + } + #6 + } +} +\end{MacroCode} + \end{macro} + + \paragraph{Generic sectioning macros} + We will now set up a generic sectioning macro. First, we need + version of the above macros that expand their arguments. + \begin{macro*}{\__skrapport_pre_section:c} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_pre_section:n{c} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\__skrapport_post_section:c} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_post_section:n{c} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\__skrapport_section_star:ccn} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_section_star:nnn{ccn} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\__skrapport_section_nostar:nnccnn} +\begin{MacroCode}{class} +\cs_generate_variant:Nn\__skrapport_section_nostar:nnnnnn{nnccnn} +\end{MacroCode} + \end{macro*} + + Now, the generic sectioning macro basically takes the sectioning + macro arguments straight up (arguments 3--5), additionally + requiring a section counter name and a section level. It expects + that constant dimensions (see definition of \cs{section} below) + and a formatting macro are available, and passes these as arguments + to the underlying sectioning macros as appropriate. + \begin{macro}{\__skrapport_generic_section:nnnnn}[5] + {Section counter name} + {Section level} + {Star (tested with \cs{IfBooleanTF})} + {Optional argument (or \cs{NoValue})} + {Section title text} +\begin{MacroCode}{class} +\cs_set:Nn\__skrapport_generic_section:nnnnn{ + \__skrapport_pre_section:c{c__skrapport_#1_pre_skip} + \IfBooleanTF#3{ + \__skrapport_section_star:ccn + {c__skrapport_#1_indent_dim} + {__skrapport_#1_style:} + {#5} + }{ + \IfNoValueTF{#4}{ + \__skrapport_section_nostar:nnccnn + {#1}{#2} + {c__skrapport_#1_indent_dim} + {__skrapport_#1_style:} + {#5} + {#5} + }{ + \__skrapport_section_nostar:nnccnn + {#1}{#2} + {c__skrapport_#1_indent_dim} + {__skrapport_#1_style:} + {#5} + {#4} + } + } + \__skrapport_post_section:c{c__skrapport_#1_post_skip} +} +\end{MacroCode} + \end{macro} + + \paragraph{Public sectioning API} + It's time to define the public sectioning macros. They all follow + the same format: first, two skips and one dimension (used by + \cs{__skrapport_generic_section:nnnnn}) are defined, as well as + a macro defining the text style of the section. Then, the actual + macro is provided. + \begin{macro}{\section}[3] + {Star (tested with \cs{IfBooleanTF})} + {Optional short title (or \cs{NoValue})} + {Sectioning title} + \begin{macro*}{\c__skrapport_section_pre_skip} + This is the skip \emph{before} a section title. +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_section_pre_skip{-4ex~plus~1ex~minus~-1ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_section_post_skip} + This is the skip \emph{after} a section title. +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_section_post_skip{.5ex~plus~.5ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_section_indent_dim} + This is the \emph{indentation} of a section title. +\begin{MacroCode}{class} +\dim_const:Nn \c__skrapport_section_indent_dim{\c_zero_dim} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_section_style:} + This is the text style of a section title. +\begin{MacroCode}{class} +\cs_set_protected:Nn\__skrapport_section_style: + {\normalfont\LARGE\__skrapport_title_style:} +\end{MacroCode} + \end{macro*} + Finally, the public macro is provided. +\begin{MacroCode}{class} +\DeclareDocumentCommand\section{som}{ + \__skrapport_generic_section:nnnnn{section}{1}{#1}{#2}{#3} +} +\end{MacroCode} + \end{macro} + + The other sectioning macros (macros from section to subparagraph are + available) are defined in an analogous manner. + \begin{macro}{\subsection}[3] + {Star (tested with \cs{IfBooleanTF})} + {Optional short title (or \cs{NoValue})} + {Sectioning title} + \begin{macro*}{\c__skrapport_subsection_pre_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_subsection_pre_skip{-3ex~plus~1ex~minus~-1ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subsection_post_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_subsection_post_skip{.25ex~plus~.25ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subsection_indent_dim} +\begin{MacroCode}{class} +\dim_const:Nn \c__skrapport_subsection_indent_dim{\c_zero_dim} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subsection_style:} +\begin{MacroCode}{class} +\cs_set_protected:Nn\__skrapport_subsection_style: + {\normalfont\Large\__skrapport_title_style:} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\subsection{som}{ + \__skrapport_generic_section:nnnnn{subsection}{2}{#1}{#2}{#3} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\subsubsection}[3] + {Star (tested with \cs{IfBooleanTF})} + {Optional short title (or \cs{NoValue})} + {Sectioning title} + \begin{macro*}{\c__skrapport_subsubsection_pre_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_subsubsection_pre_skip{-2ex~plus~.5ex~minus~-.5ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subsubsection_post_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_subsubsection_post_skip{.125ex~plus~.125ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subsubsection_indent_dim} +\begin{MacroCode}{class} +\dim_const:Nn \c__skrapport_subsubsection_indent_dim{\c_zero_dim} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subsubsection_style:} +\begin{MacroCode}{class} +\cs_set_protected:Nn\__skrapport_subsubsection_style: + {\normalfont\large\__skrapport_title_style:} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\subsubsection{som}{ + \__skrapport_generic_section:nnnnn{subsubsection}{3}{#1}{#2}{#3} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\paragraph}[3] + {Star (tested with \cs{IfBooleanTF})} + {Optional short title (or \cs{NoValue})} + {Sectioning title} + \begin{macro*}{\c__skrapport_paragraph_pre_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_paragraph_pre_skip{1ex~plus~.25ex~minus~-.25ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_paragraph_post_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_paragraph_post_skip{-1em} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_paragraph_indent_dim} +\begin{MacroCode}{class} +\dim_const:Nn \c__skrapport_paragraph_indent_dim{\c_zero_dim} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_paragraph_style:} +\begin{MacroCode}{class} +\cs_set_protected:Nn\__skrapport_paragraph_style: + {\normalfont\normalsize\__skrapport_title_style:} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\paragraph{som}{ + \__skrapport_generic_section:nnnnn{paragraph}{4}{#1}{#2}{#3} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\subparagraph}[3] + {Star (tested with \cs{IfBooleanTF})} + {Optional short title (or \cs{NoValue})} + {Sectioning title} + \begin{macro*}{\c__skrapport_subparagraph_pre_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_subparagraph_pre_skip{1ex~plus~.25ex~minus~-.25ex} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subparagraph_post_skip} +\begin{MacroCode}{class} +\skip_const:Nn\c__skrapport_subparagraph_post_skip{-1em} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subparagraph_indent_dim} +\begin{MacroCode}{class} +\dim_const:Nn \c__skrapport_subparagraph_indent_dim{\parindent} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\c__skrapport_subparagraph_style:} +\begin{MacroCode}{class} +\cs_set_protected:Nn\__skrapport_subparagraph_style: + {\normalfont\normalsize\__skrapport_title_style:\itshape} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\subparagraph{som}{ + \__skrapport_generic_section:nnnnn{subparagraph}{5}{#1}{#2}{#3} +} +\end{MacroCode} + \end{macro} + + \subsubsection{Macros and environments from \pkg{article}} + \paragraph{List environments} + First, several dimensions are provided and three penalties defined. +\begin{MacroCode}{class} +\dim_gset:Nn\leftmargini{2em} +\dim_gset_eq:NN\leftmargin\leftmargini +\dim_gset:Nn\leftmarginii{2em} +\dim_gset:Nn\leftmarginiii{1.5em} +\dim_gset:Nn\leftmarginiv{1.5em} +\dim_gset:Nn\leftmarginv{1em} +\dim_gset:Nn\leftmarginvi{1em} +\dim_gset:Nn\labelsep{.5em} +\dim_gset_eq:NN\labelwidth\leftmargini +\dim_gsub:Nn\labelwidth{-\labelsep} +\int_gset:Nn\@beginparpenalty{-\@lowpenalty} +\int_gset:Nn\@endparpenalty {-\@lowpenalty} +\int_gset:Nn\@itempenalty {-\@lowpenalty} +\end{MacroCode} + + Then, we define the appearance of the item numbers. + \begin{macro*}{\theenumi} + The first level consists of arabic numbers (\(1,2,3,\dotsc\)). +\begin{MacroCode}{class} +\cs_set:Npn\theenumi {\arabic{enumi}} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\theenumii} + The second level consists of lower-case alphabetic characters + (\(\text{a},\text{b},\text{c},\dotsc\)). +\begin{MacroCode}{class} +\cs_set:Npn\theenumii {\alph{enumii}} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\theenumiii} + The third level consists of lower-case roman numerals + (\(\text{i},\text{ii},\text{iii},\dotsc\)). +\begin{MacroCode}{class} +\cs_set:Npn\theenumiii{\roman{enumiii}} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\theenumiv} + The fourth level consists of upper-case alphabetic characters + (\(\text{A},\text{B},\text{C},\dotsc\)). +\begin{MacroCode}{class} +\cs_set:Npn\theenumiv {\Alph{enumiv}} +\end{MacroCode} + \end{macro*} + We also need macros that typeset the actual labels. Here, different + levels have a different postfix: all levels except the second are + postfixed by a period, while the second level is postfixed by a + closing bracket. + \begin{macro*}{\labelenumi} +\begin{MacroCode}{class} +\cs_new:Npn\labelenumi{\theenumi.} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\labelenumii} +\begin{MacroCode}{class} +\cs_new:Npn\labelenumii{\theenumii)} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\labelenumiii} +\begin{MacroCode}{class} +\cs_new:Npn\labelenumiii{\theenumiii.} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\labelenumiv} +\begin{MacroCode}{class} +\cs_new:Npn\labelenumiv{\theenumiv.} +\end{MacroCode} + \end{macro*} + We also fix the referencing of lower-level items so that one can + refer to them properly (\emph{i.e.} as 1b(iii) and so on). + \begin{macro*}{\p@enumii} +\begin{MacroCode}{class} +\cs_set:Npn\p@enumii{\theenumi} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\p@enumiii} +\begin{MacroCode}{class} +\cs_set:Npn\p@enumiii{\theenumi(\theenumii)} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\p@enumiiv} +\begin{MacroCode}{class} +\cs_set:Npn\p@enumiv{\p@enumiii\theenumiii} +\end{MacroCode} + \end{macro*} + + All that was for numbered lists (\env{enumerate}). Now, we define + the \enquote{labels} of \env{itemize} items. Alternately, they + are a bullet (\textbullet) and a boldfaced dash + ({\normalfont\bfseries\textendash}). + \begin{macro*}{\labelitemi} +\begin{MacroCode}{class} +\cs_set:Npn\labelitemi{\textbullet} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\labelitemii} +\begin{MacroCode}{class} +\cs_set:Npn\labelitemii{\normalfont\bfseries\textendash} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\labelitemiii} +\begin{MacroCode}{class} +\cs_set:Npn\labelitemiii{\textbullet} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\labelitemiv} +\begin{MacroCode}{class} +\cs_set:Npn\labelitemiv{\normalfont\bfseries\textendash} +\end{MacroCode} + \end{macro*} + + The last of the commonly used list environments is \env{description}. + Defining it is fairly simple --- we define a list with empty item + labels and a bit of hackery for the \cs{makelabel} macro inside. + \begin{environment}{description} +\begin{MacroCode}{class} +\DeclareDocumentEnvironment{description}{}{ + \begin{list}{}{ + \dim_zero:N\labelwidth + \dim_set:Nn\itemindent{-\leftmargin} + \cs_set_eq:NN\makelabel\descriptionlabel + } +}{ + \end{list} +} +\end{MacroCode} + \begin{macro}{\descriptionlabel} + Additionally, the \cs{descriptionlabel} macro is defined. +\begin{MacroCode}{class} +\NewDocumentCommand\descriptionlabel{m}{ + \hspace{\labelsep}\normalfont\bfseries #1 +} +\end{MacroCode} + \end{macro} + \end{environment} + + \paragraph{Quotation environments} + The quotation environments are also fairly simple --- \env{quote} + is just a list with a single item, and \env{quotation} is a + \env{quote} with extra skips around it. + \begin{environment}{quote} +\begin{MacroCode}{class} +\NewDocumentEnvironment{quote}{}{ + \begin{list}{}{ + \dim_set_eq:NN\rightmargin\leftmargin + } + \item\itshape +}{ + \end{list} +} +\end{MacroCode} + \end{environment} + \begin{environment}{quotation} +\begin{MacroCode}{class} +\NewDocumentEnvironment{quotation}{}{ + \bigskip + \begin{quote} +}{ + \end{quote} + \bigskip +} +\end{MacroCode} + \end{environment} + There's a \env{verse} environment, too, but it's just \env{quote}. + \begin{environment}{verse} +\begin{MacroCode}{class} +\NewDocumentEnvironment{verse}{}{ + \begin{quote} +}{ + \end{quote} +} +\end{MacroCode} + \end{environment} + + \paragraph{Front- and backmatter} + We only define one front/backmatter macro; \cs{appendix}. + \begin{macro}{\appendix} +\begin{MacroCode}{class} +\NewDocumentCommand\appendix{}{ + \par + \setcounter{section}{0} + \setcounter{subsection}{0} + \cs_gset:Npn\thesection{\Alph{section}} +} +\end{MacroCode} + \end{macro} + + \paragraph{Old font macros} + The old font macros have been deprecated. Do not use! + \begin{macro}{\rm} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\rm{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\rm}{\textrm}} +\end{MacroCode} + \end{macro} + \begin{macro}{\sf} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\sf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sf}{\textsf}} +\end{MacroCode} + \end{macro} + \begin{macro}{\tt} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\tt{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\tt}{\texttt}} +\end{MacroCode} + \end{macro} + \begin{macro}{\bf} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\bf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\bf}{\textbf}} +\end{MacroCode} + \end{macro} + \begin{macro}{\it} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\it{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\it}{\textit}} +\end{MacroCode} + \end{macro} + \begin{macro}{\sl} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\sl{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sl}{\textsl}} +\end{MacroCode} + \end{macro} + \begin{macro}{\sc} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\sc{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sc}{\textsc}} +\end{MacroCode} + \end{macro} + + \paragraph{The emphasis macro} + \begin{macro}{\emph} + \changes{0.12}{Changed definition, may have introduced spacing issues} + Redefining the \cs{emph} style to be bold when nested. + \begin{macro*}{\em} + \changes{0.12}{Deprecated command} +\begin{MacroCode}{class} +\DeclareDocumentCommand\em{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\em}{\emph}} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\__skrapport_emphstyle:} +\begin{MacroCode}{class} +\cs_new:Nn\__skrapport_emphstyle:{ + \itshape + \dim_compare:nF{\fontdimen\c_one\font>\c_zero_dim}{\bfseries} +} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\DeclareDocumentCommand\emph{m+}{ + \ifmmode + \text{\__skrapport_emphstyle: #1} + \else + {\__skrapport_emphstyle: #1} + \fi +} +\end{MacroCode} + \end{macro} + + \paragraph{The footnote rule} + \begin{macro*}{\footnoterule} + \changes{0.12}{Removed footnote rule entirely} +\begin{MacroCode}{class} +\DeclareDocumentCommand\footnoterule{}{} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\@makefntext} +\begin{MacroCode}{class} +\DeclareDocumentCommand\@makefntext{m+}{ + \dim_set:Nn\parindent{1em}\noindent + \hbox_to_wd:nn{1.8em}{\hss\@makefnmark} + #1 +} +\end{MacroCode} + \end{macro*} + + \subsubsection{Floats} + \paragraph{Table- and box-related lengths} +\begin{MacroCode}{class} +\dim_gset:Nn\arraycolsep {5pt} +\dim_gset:Nn\tabcolsep {6pt} +\dim_gset:Nn\arrayrulewidth{.4pt} +\dim_gset:Nn\doublerulesep {2pt} +\dim_gset_eq:NN\tabbingsep\labelsep +\skip_gset_eq:NN{\skip\@mpfootins}{\skip\footins} +\dim_gset:Nn\fboxsep {3pt} +\dim_gset:Nn\fboxrule {.4pt} +\end{MacroCode} + + \paragraph{Counters} +\begin{MacroCode}{class} +\newcounter{figure} +\newcounter{table} +\end{MacroCode} + \begin{macro*}{\theequation} +\begin{MacroCode}{class} +\cs_set:Npn\theequation{\arabic{equation}} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\thefigure} +\begin{MacroCode}{class} +\cs_set:Npn\thefigure{\arabic{figure}} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\thetable} +\begin{MacroCode}{class} +\cs_set:Npn\thetable{\arabic{table}} +\end{MacroCode} + \end{macro*} + + \paragraph{Defaults} + The default placement, list extension and caption text of all floats. +\begin{MacroCode}{class} +\cs_new:Npn \fps@figure{tb} +\cs_new:Npn\ftype@figure{1} +\cs_new:Npn \ext@figure{lof} +\cs_new:Npn \fnum@figure{\figurename\ \thefigure} +\cs_new:Npn \fps@table {tb} +\cs_new:Npn\ftype@table {2} +\cs_new:Npn \ext@table {lot} +\cs_new:Npn \fnum@table {\tablename\ \thetable} +\end{MacroCode} + + \paragraph{Environments} + \begin{macro}{\__skrapport_xfloat:nn} + \begin{macro*}{\__skrapport_xfloat:nx} + This is a helper macro basically replacing the \cs{@float} macro + used by \LaTeXe. +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_xfloat:nn#1#2{\@xfloat{#1}[#2]} +\cs_generate_variant:Nn\__skrapport_xfloat:nn{nx} +\end{MacroCode} + \end{macro*} + \end{macro} + \begin{environment}{figure} + \changes{0.12a}{Figures are now \cs{centering}ed by default} + \begin{environment*}{figure*} +\begin{MacroCode}{class} +\DeclareDocumentEnvironment{figure}{o}{ + \__skrapport_xfloat:nx{figure} + {\IfNoValueTF{#1}{\fps@figure}{#1}} + \centering +}{ + \end@float +} +\DeclareDocumentEnvironment{figure*}{o}{ + \__skrapport_xfloat:nx{figure} + {\IfNoValueTF{#1}{tp}{#1}} + \centering +}{ + \end@float +} +\end{MacroCode} + \end{environment*} + \end{environment} + \begin{environment}{table} + \changes{0.12a}{Tables are now \cs{centering}ed by default} + \begin{environment*}{table*} +\begin{MacroCode}{class} +\DeclareDocumentEnvironment{table}{o}{ + \__skrapport_xfloat:nx{table} + {\IfNoValueTF{#1}{\fps@table}{#1}} + \centering +}{ + \end@float +} +\DeclareDocumentEnvironment{table*}{o}{ + \__skrapport_xfloat:nx{table} + {\IfNoValueTF{#1}{tp}{#1}} + \centering +}{ + \end@float +} +\end{MacroCode} + \end{environment*} + \end{environment} + + In addition to the \env{figure} and \env{table} environments, we + also provide a \env{figcenter} environment that enables centering + of figures or tables that are too wide for the page. + \begin{environment}{figcenter} +\begin{MacroCode}{class} +\DeclareDocumentEnvironment{figcenter}{}{ + \coffin_clear:N\l_tmpa_coffin + \hcoffin_set:Nw\l_tmpa_coffin +}{ + \hcoffin_set_end: + \dim_set:Nn\l_tmpa_dim{(\textwidth - \coffin_wd:N\l_tmpa_coffin)/2} + \skip_horizontal:n{-\l_tmpa_dim} + \coffin_typeset:Nnnnn\l_tmpa_coffin{H}{l}{0pt}{0pt} +} +\end{MacroCode} + \end{environment} + + \paragraph{Captions} + Before we begin, we pass options to \pkg{caption}, in case the user + is loading it or another package based upon it. This fixes an issue + where the custom caption style was overwritten with the ugly default + \pkg{article} caption style. +\begin{MacroCode}{class} +\PassOptionsToPackage{font=small,labelfont+=bf,textfont+=it}{caption} +\end{MacroCode} + \begin{macro*}{\__skrapport_caption_name_style:} +\begin{MacroCode}{class} +\cs_new_protected:Nn\__skrapport_caption_name_style:{\small\bfseries} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\__skrapport_caption_text_style:} +\begin{MacroCode}{class} +\cs_new_protected:Nn\__skrapport_caption_text_style:{\small\itshape} +\end{MacroCode} + \end{macro*} +\begin{MacroCode}{class} +\skip_new:N\abovecaptionskip +\skip_set:Nn\abovecaptionskip{10pt} +\skip_new:N\belowcaptionskip +\skip_set:Nn\belowcaptionskip{10pt} +\end{MacroCode} + \begin{macro*}{\@makecaption} + \changes{0.10c}{Fix missing coloring command for some captions} + \changes{0.12}{Split \cs{@captionstyle} into two macros} + \changes{0.12a}{Fix a bug which applied caption name styling to the + caption text} + This should possibly be redefined already at the \cs{caption} level. +\begin{MacroCode}{class} +\cs_new:Npn\@makecaption#1#2{ + \skip_vertical:N\abovecaptionskip + \hbox_set:Nn\l_tmpa_box{ + \color@setgroup % !!! + {\__skrapport_caption_name_style:#1:~} + {\__skrapport_caption_text_style:#2} + \color@endgroup % !!! + } + \dim_compare:nTF{\box_wd:N\l_tmpa_box>\hsize}{ + {\__skrapport_caption_name_style:#1:~} + {\__skrapport_caption_text_style:#2} + \par + }{ + \global\@minipagefalse % !!! + \hbox_to_wd:nn{\hsize}{ + \hfil + \box_use_clear:N\l_tmpa_box + \hfil + } + } + \skip_vertical:N\belowcaptionskip +} +\end{MacroCode} + \end{macro*} + + \subsubsection{Table of contents} +\begin{MacroCode}{class} +\cs_new:Npn\@pnumwidth{1.55em} +\cs_new:Npn\@tocrmarg{2em} +\cs_new:Npn\@dotsep{1.7} +\setcounter{tocdepth}{3} +\end{MacroCode} + \begin{macro}{\tableofcontents} + \changes{0.12}{Removed spacing and \cs{@mkboth} call} +\begin{MacroCode}{class} +\DeclareDocumentCommand\tableofcontents{}{ + \section*{\contentsname} + \makeatletter + \@starttoc{toc} + \makeatother +} +\end{MacroCode} + \end{macro} + + The following macros conspire to replace \cs{@dottedtocline}. + \begin{macro*}{\__skrapport_toc_line:nnnnnn}[6] + {TOC line character} + {Table of contents level of the line} + {Indentation at the start of the line} + {Width of the section number} + {Section title} + {Page number} +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_toc_line:nnnnnn#1#2#3#4#5#6{ + \int_compare:nF{#2>\value{tocdepth}}{ + \skip_vertical:n{0pt~plus~.2pt} + \group_begin: + \skip_set:Nn\leftskip{#3} + \skip_set_eq:NN\rightskip\@tocrmarg + \skip_set:Nn\parfillskip{-\rightskip} + \dim_set:Nn\parindent{#3} + \@afterindenttrue % !!! + \interlinepenalty\@M % !!! + \leavevmode +\end{MacroCode} + This here is pretty dumb. We can't use a \LaTeX3\ temporary skip + register (or skip the temporary), because \texttt{\#5} further down + will contain a \cs{hbox} based on \cs{@tempdima}. The proper thing + to do here would be to rewrite \cs{addcontentsline}, I guess. Bah. +\begin{MacroCode}{class} + \skip_set:Nn\@tempdima{#4} % !!! (dumb) + \skip_add:Nn\leftskip{\@tempdima} + \null\nobreak + \skip_horizontal:n{-\leftskip} + {#5}\nobreak + \str_if_eq:nnTF{#1}{}{ + \hfill + }{ + \leaders\hbox:n{ + \(\mkern\@dotsep mu\hbox{#1}\mkern\@dotsep mu\) % !!! + } + } + \hfill\nobreak + \hbox_to_wd:nn{\@pnumwidth}{ % !!! + \hfil\normalfont\normalcolor #6 + } + \par + \group_end: + } +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\__skrapport_toc_line:nnnnnn}[5] + {Table of contents level of the line} + {Indentation at the start of the line} + {Width of the section number} + {Section title} + {Page number} + This is a variant of \cs{__skrapport_toc_line:nnnnnn} which + implicitly sets empty space as its TOC line. +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_toc_line:nnnnn#1#2#3#4#5{ + \__skrapport_toc_line:nnnnnn{}{#1}{#2}{#3}{#4}{#5} +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\l@section} + \changes{0.12}{Now uses \cs{__skrapport_toc_line:nnnnn}} +\begin{MacroCode}{class} +\DeclareDocumentCommand\l@section{mm}{ + \group_begin: + \skip_vertical:n{.75ex} + \bfseries + \__skrapport_toc_line:nnnnn{1}{0em}{1.3em}{#1}{#2} + \group_end: +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\l@subsection} + \changes{0.12}{Now uses \cs{__skrapport_toc_line:nnnnnn}} +\begin{MacroCode}{class} +\DeclareDocumentCommand\l@subsection{mm}{ + \group_begin: + \skip_vertical:n{.35ex} + \penalty\@secpenalty % !!! + \__skrapport_toc_line:nnnnnn{.}{2}{1.3em}{2em}{#1}{#2} + \group_end: +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\l@subsubsection} + \changes{0.12}{Changed style to match \pkg{skdoc}} +\begin{MacroCode}{class} +\DeclareDocumentCommand\l@subsubsection{mm}{ + \skip_set:Nn\leftskip{3.3em} + \dim_set_eq:NN\parindent\c_zero_dim + \group_begin: + \cs_set_eq:NN\numberline\use_none:n + \small #1~[#2] + \group_end: +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\l@paragraph} +\begin{MacroCode}{class} +\DeclareDocumentCommand\l@paragraph{mm}{ + \int_compare:nF{4>\value{tocdepth}}{ + \msg_warning:nnnn{skrapport}{tocdepth-too-deep} + {4}{\l@paragraph} + } +} +\end{MacroCode} + \end{macro*} + \begin{macro*}{\l@subparagraph} +\begin{MacroCode}{class} +\DeclareDocumentCommand\l@subparagraph{mm}{ + \int_compare:nF{5>\value{tocdepth}}{ + \msg_warning:nnnn{skrapport}{tocdepth-too-deep} + {5}{\l@subparagraph} + } +} +\end{MacroCode} + \end{macro*} + + Fix for \emph{e.g.}~\pkg{tocloft} package. +\begin{MacroCode}{class} +\cs_set:Npn\l@figure{} +\cs_set:Npn\l@table{} +\end{MacroCode} + + \subsubsection{Basic bibliography support} +\begin{MacroCode}{class} +\dim_new:N\bibindent +\dim_set:Nn\bibindent{2em} +\end{MacroCode} + \begin{environment}{thebibliography} + \changes{0.12}{Removed \cs{@mkboth}, \cs{@openbib@code} and + \cs{@noitemerr}} +\begin{MacroCode}{class} +\DeclareDocumentEnvironment{thebibliography}{m}{ + \section*{\refname} + \list{\@biblabel{\arabic{enumiv}}}{ + \dim_set_to_wd:Nn\labelwidth{\@biblabel{#1}} + \dim_set_eq:NN\leftmargin\labelwidth + \dim_add:Nn\leftmargin{\labelsep} + \usecounter{enumiv} % !!! + \cs_set:Nn\p@enumiv{} + \RenewDocumentCommand\theenumiv{}{\arabic{enumiv}} + } + \sloppy + \int_set:Nn\clubpenalty{4000} + \int_set_eq:NN\@clubpenalty\clubpenalty + \int_set:Nn\widowpenalty{4000} +}{ + \cs_set:Nn\@noitemerr{} + \endlist +} +\end{MacroCode} + \end{environment} + \begin{macro*}{\newblock} +\begin{MacroCode}{class} +\DeclareDocumentCommand\newblock{}{ + \skip_horizontal:n{.11em~plus~.33em~minus~.07em} +} +\end{MacroCode} + \end{macro*} + \begin{environment}{theindex} + \changes{0.12}{Use \pkg{multicol} instead of \cs{twocolumn} mode, + removed \cs{@mkboth} call} +\begin{MacroCode}{class} +\DeclareDocumentEnvironment{theindex}{}{ + \begin{multicols}{2}[\section*{\indexname}] + \thispagestyle{plain} + \dim_zero:N\parindent + \skip_set:N\parskip{\c_zero_skip~plus~.3pt} + \dim_zero:N\columnseprule + \dim_set:Nn\columnsep{35pt} + \cs_set_eq:NN\item\@idxitem +}{ + \end{multicols} +} +\end{MacroCode} + \end{environment} + \begin{macro*}{\@idxitem} +\begin{MacroCode}{class} +\DeclareDocumentCommand\@idxitem{}{ + \par + \dim_set:Nn\hangindent{40pt} +} +\end{MacroCode} + \end{macro*} + \begin{macro}{\subitem} +\begin{MacroCode}{class} +\DeclareDocumentCommand\subitem{}{ + \@idxitem + \hspace*{20pt} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\subsubitem} +\begin{MacroCode}{class} +\DeclareDocumentCommand\subsubitem{}{ + \@idxitem + \hspace*{30pt} +} +\end{MacroCode} + \end{macro} + \begin{macro*}{\indexspace} +\begin{MacroCode}{class} +\DeclareDocumentCommand\indexspace{}{ + \par + \skip_vertical:n{10pt~plus~5pt~minus~3pt} +} +\end{MacroCode} + \end{macro*} + + \subsubsection{Miscellaneous} + A macro \cs{comment} (alias \cs{com}/\cs{note}) is defined to let + the user add comments and notes to the document. + \begin{macro}{\__skrapport_comment:n} +\begin{MacroCode}{class} +\cs_new:Npn\__skrapport_comment:n#1{ + {\textbf{\__skrapport_Comment_word: :}~#1} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\comment} + \changes{0.10}{Added macro for comments} +\begin{MacroCode}{class} +\DeclareDocumentCommand\comment{sm}{ + \IfBooleanTF{#1} + {\colorbox{red!50}{\__skrapport_comment:n{#2}}} + {\marginpar{\__skrapport_comment:n{#2}}} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\com} + \begin{macro}{\note} + \changes{0.10b}{Fixed a silly error in \cs{com} and \cs{note}} +\begin{MacroCode}{class} +\ProvideDocumentCommand\com{sm} + {\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}} +\ProvideDocumentCommand\note{sm} + {\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}} +\end{MacroCode} + \end{macro} + \end{macro} + + \subsubsection{Color theme support} + Color theme setup. Start by patching commands and declaring + default colors. Not implemented: background colors for e.g. + quote environments and sections headings, different colors + for the different sectioning levels. +\begin{MacroCode}{class} +\bool_if:NT\g__skrapport_color_bool{ + \apptocmd{\bfseries} + {\color{skrapport@boldcolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\bfseries}} + \apptocmd{\itshape} + {\color{skrapport@italiccolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\itshape}} + \apptocmd{\__skrapport_title_style:} + {\color{skrapport@titlecolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_title_style:}} + \apptocmd{\__skrapport_smallprint_style:} + {\color{skrapport@smallprintcolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_smallprint_style:}} + \apptocmd{\__skrapport_abstract_style:} + {\color{skrapport@titlecolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_abstract_style:}} + \apptocmd{\quote} + {\color{skrapport@quotecolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\quote}} + \apptocmd{\__skrapport_caption_name_style:} + {\color{skrapport@captioncolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_caption_name_style:}} + \apptocmd{\__skrapport_emphstyle:} + {\color{skrapport@emphcolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_emphstyle:}} +\end{MacroCode} +% I have no idea why this was here or what difference it makes. These +% things should be using \__skrapport_title_style:. +% \ifskrapport@twocolumn\AtBeginDocument{% +% \renewcommand\section{\@startsection {section}{1}{\z@}% +% {-.999\baselineskip}{0.001\baselineskip}{\bfseries\mathversi%on{bold}\color{skrapport@titlecolor}}} +% \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% +% {\baselineskip}{-.35\baselineskip}{\bfseries\color{skrapport@titlecolor}\unskip}} +% \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% +% {\baselineskip}{-.35\baselineskip}{\itshape\color{skrapport@titlecolor}\unskip}} +% }\fi +% \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% +% {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\bfseries\color{skrapport@titlecolor}}} +% \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% +% {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\itshape\color{skrapport@titlecolor}}} +\begin{MacroCode}{class} + \AtBeginDocument{\@ifpackageloaded{hyperref}{% + \hypersetup{% + citebordercolor=skrapport@citecolor,citecolor=skrapport@citecolor,% + filebordercolor=skrapport@filecolor,filecolor=skrapport@filecolor,% + linkbordercolor=skrapport@linkcolor,linkcolor=skrapport@linkcolor,% + menubordercolor=skrapport@menucolor,menucolor=skrapport@menucolor,% + urlbordercolor=skrapport@urlcolor,urlcolor=skrapport@urlcolor,% + runbordercolor=skrapport@runcolor,runcolor=skrapport@runcolor% + } + }{}} + \AtBeginDocument{\color{skrapport@defaultcolor}} +\end{MacroCode} + \begin{macro}{\colortheme} + The \cs{colortheme} macro allows the end-user to load color themes + (described later) to customize the colors of the document when the + class is loaded with the \opt{color} option. +\begin{MacroCode}{class} + \DeclareDocumentCommand\colortheme{m}{ + \usepackage{skrapport-colortheme-#1} + } +\end{MacroCode} + \end{macro} +\begin{MacroCode}{class} + \colortheme{default} +} +\end{MacroCode} + + \subsection{Final class setup} + We end the document class by setting a few lengths along with the + page style and page numbering. Also, activate \cs{raggedbottom} and + \cs{onexolumn} (since we always do all the two-column stuff + ourselves anyway). +\begin{MacroCode}{class} +\dim_set:Nn\columnsep{10pt} +\dim_zero:N\columnseprule +\pagestyle{plain} +\pagenumbering{arabic} +\raggedbottom +\onecolumn +\endinput +\end{MacroCode} + + \subsection{Color themes} + As described earlier, the user can load color themes to customize + the appearance of the document if the class was loaded with the + \opt{color} option. Four themes are available by default. + + \subsubsection{Default color theme} + \begin{theme}{Default} + \changes{0.09}{Added default color theme} +\begin{MacroCode}{theme-default} +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-default} + {2012/06/07}{1.0}{skrapport color theme default} +\definecolor{skrapport@citecolor}{named}{green} +\definecolor{skrapport@filecolor}{named}{teal} +\definecolor{skrapport@linkcolor}{named}{red} +\definecolor{skrapport@menucolor}{named}{red} +\definecolor{skrapport@urlcolor}{named}{cyan} +\definecolor{skrapport@runcolor}{named}{teal} +\definecolor{skrapport@boldcolor}{named}{black} +\definecolor{skrapport@titlecolor}{named}{black} +\definecolor{skrapport@italiccolor}{named}{black} +\definecolor{skrapport@smallprintcolor}{named}{black} +\definecolor{skrapport@quotecolor}{named}{black} +\definecolor{skrapport@captioncolor}{named}{black} +\definecolor{skrapport@emphcolor}{named}{black} +\definecolor{skrapport@defaultcolor}{named}{black} +\endinput +\end{MacroCode} + \end{theme} + + \subsubsection{Unscathed color theme} + \begin{theme}{Unscathed} + \changes{0.09}{Added \enquote{Unschathed} color theme} +\begin{MacroCode}{theme-unscathed} +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-unscathed} + {2012/06/07}{1.0}{skrapport color theme unscathed} +\definecolor{skrapport@citecolor}{named}{skrapport@defaultcolor} +\definecolor{skrapport@filecolor}{named}{skrapport@defaultcolor} +\definecolor{skrapport@menucolor}{named}{skrapport@defaultcolor} +\definecolor{skrapport@runcolor}{named}{skrapport@defaultcolor} +\definecolor{skrapport@emphcolor}{HTML}{463335} +\definecolor{skrapport@linkcolor}{HTML}{CF5D3B} +\definecolor{skrapport@urlcolor}{named}{skrapport@linkcolor} +\definecolor{skrapport@titlecolor}{HTML}{B34430} +\definecolor{skrapport@captioncolor}{named}{skrapport@titlecolor} +\definecolor{skrapport@quotecolor}{HTML}{70524A} +\definecolor{skrapport@smallprintcolor}{named}{skrapport@quotecolor} +\endinput +\end{MacroCode} + \end{theme} + + \subsubsection{Cruelwater color theme} + \begin{theme}{Cruelwater} + \changes{0.09}{Added \enquote{Cruelwater} color theme} +\begin{MacroCode}{theme-cruelwater} +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-cruelwater} + {2012/06/07}{1.0}{skrapport color theme cruelwater} +\definecolor{skrapport@citecolor}{named}{black} +\definecolor{skrapport@filecolor}{named}{black} +\definecolor{skrapport@linkcolor}{named}{black} +\definecolor{skrapport@menucolor}{named}{black} +\definecolor{skrapport@urlcolor}{named}{black} +\definecolor{skrapport@runcolor}{named}{black} +\definecolor{skrapport@boldcolor}{HTML}{030C22} +\definecolor{skrapport@titlecolor}{HTML}{20293F} +\definecolor{skrapport@italiccolor}{named}{black} +\definecolor{skrapport@smallprintcolor}{HTML}{A9B0B3} +\definecolor{skrapport@quotecolor}{HTML}{404749} +\definecolor{skrapport@captioncolor}{HTML}{030C22} +\definecolor{skrapport@emphcolor}{HTML}{20293F} +\definecolor{skrapport@defaultcolor}{named}{black} +\endinput +\end{MacroCode} + \end{theme} + + \subsubsection{Violet color theme} + \begin{theme}{Violet} +\changes{0.09}{Added \enquote{Violet} color theme} +\begin{MacroCode}{theme-violet} +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-violet} + {2012/06/07}{1.0}{skrapport color theme violet} +\definecolor{skrapport@citecolor}{HTML}{932444} +\definecolor{skrapport@filecolor}{HTML}{932444} +\definecolor{skrapport@linkcolor}{HTML}{932444} +\definecolor{skrapport@menucolor}{HTML}{932444} +\definecolor{skrapport@urlcolor}{HTML}{932444} +\definecolor{skrapport@runcolor}{HTML}{932444} +\definecolor{skrapport@boldcolor}{HTML}{311A2A} +\definecolor{skrapport@titlecolor}{HTML}{311A2A} +\definecolor{skrapport@italiccolor}{named}{black} +\definecolor{skrapport@smallprintcolor}{HTML}{D6CBCF} +\definecolor{skrapport@quotecolor}{HTML}{463335} +\definecolor{skrapport@captioncolor}{HTML}{311A2A} +\definecolor{skrapport@emphcolor}{HTML}{98758D} +\definecolor{skrapport@defaultcolor}{named}{black} +\endinput +\end{MacroCode} + \end{theme} + + \subsubsection{skdoc color theme} + \begin{theme}{skdoc} +\changes{0.11a}{Added \enquote{skdoc} color theme} +\begin{MacroCode}{theme-skdoc} +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-skdoc} + {2013/04/10}{1.0}{skrapport color theme skdoc} +\definecolor{skrapport@citecolor}{RGB}{140,35,24} +\definecolor{skrapport@filecolor}{RGB}{73,10,61} +\definecolor{skrapport@linkcolor}{RGB}{140,35,24} +\definecolor{skrapport@menucolor}{RGB}{140,35,24} +\definecolor{skrapport@urlcolor}{RGB}{73,10,61} +\definecolor{skrapport@runcolor}{RGB}{73,10,61} +\definecolor{skrapport@boldcolor}{RGB}{73,10,61} +\definecolor{skrapport@titlecolor}{RGB}{11,72,107} +\definecolor{skrapport@italiccolor}{named}{black} +\definecolor{skrapport@smallprintcolor}{RGB}{11,72,107} +\definecolor{skrapport@quotecolor}{RGB}{140,35,24} +\definecolor{skrapport@captioncolor}{RGB}{11,72,107} +\definecolor{skrapport@emphcolor}{RGB}{73,10,61} +\definecolor{skrapport@defaultcolor}{named}{black} +\endinput +\end{MacroCode} + \end{theme} + + \section{Point sizes} + The point size options are pretty much \LaTeX3 translations of the + standard \pkg{article} class option files. There's a lot of duplicate + code here which may be worth to consolidate a bit. + + \subsubsection{Common macros} + We first set up a package providing replacements for \LaTeXe\ macros, + common to all the point size files. +\begin{MacroCode}{size-common} +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-size-common} + {2013/04/29}{1.0}{skrapport point size option common macros} +\end{MacroCode} + \begin{macro}{\__skrapport_set_font_size:nn}[2] + {Font size} + {Baseline skip?} % !!! +\begin{MacroCode}{size-common} +\cs_new:Npn\__skrapport_set_font_size:nn#1#2{ + \fontsize{#1}{#2} % !!! + \selectfont +} +\end{MacroCode} + \end{macro} +\begin{MacroCode}{size-common} +\endinput +\end{MacroCode} + + \subsubsection{Actual point size files} +\begin{MacroCode}{size-10,size-11,size-12} +\RequirePackage{expl3} +\end{MacroCode} +\begin{MacroCode}{size-10} +\ProvidesExplFile{skrapport-size10pt.clo} + {2013/04/29}{1.0}{skrapport point size option 10pt} +\end{MacroCode} +\begin{MacroCode}{size-11} +\ProvidesExplFile{skrapport-size11pt.clo} + {2013/04/29}{1.0}{skrapport point size option 11pt} +\end{MacroCode} +\begin{MacroCode}{size-12} +\ProvidesExplFile{skrapport-size12pt.clo} + {2013/04/29}{1.0}{skrapport point size option 12pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +\RequirePackage{skrapport-size-common} +\end{MacroCode} + \begin{macro}{\normalsize} +\begin{MacroCode}{size-10,size-11,size-12} +\RenewDocumentCommand\normalsize{}{ +\end{MacroCode} +\begin{MacroCode}{size-10} + \__skrapport_set_font_size:nn{10}{12} + \skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6pt ~plus~3pt~minus~3pt} +\end{MacroCode} +\begin{MacroCode}{size-11} + \__skrapport_set_font_size:nn{11}{13.2} + \skip_gset:Nn \abovedisplayskip {11pt ~plus~3pt ~minus~6pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{12}{14.5} + \skip_gset:Nn \abovedisplayskip {12pt ~plus~3pt ~minus~7pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset_eq:NN\@listi\@listI +} +\end{MacroCode} + \end{macro} +\begin{MacroCode}{size-10,size-11,size-12} +\normalsize +\end{MacroCode} + \begin{macro}{\small} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\small{}{ +\end{MacroCode} +\begin{MacroCode}{size-10} + \__skrapport_set_font_size:nn{9}{11} + \skip_gset:Nn \abovedisplayskip {8.5pt~plus~3pt~minus~4pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~2pt} + \skip_gset:Nn \belowdisplayshortskip {4pt ~plus~2pt~minus~2pt} +\end{MacroCode} +\begin{MacroCode}{size-11} + \__skrapport_set_font_size:nn{10}{12} + \skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~2pt} + \skip_gset:Nn \belowdisplayshortskip {6pt ~plus~3pt~minus~3pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{11}{13.6} + \skip_gset:Nn \abovedisplayskip {11pt ~plus~3pt ~minus~6pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini +\end{MacroCode} +\begin{MacroCode}{size-10} + \skip_gset:Nn\topsep{4pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-11} + \skip_gset:Nn\topsep{6pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{3pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \skip_gset:Nn\topsep{ 9pt~plus~3pt~minus~5pt} + \skip_gset:Nn\parsep{4.5pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} + \skip_gset_eq:NN\itemsep\parsep + } +} +\end{MacroCode} + \end{macro} + \begin{macro}{\footnotesize} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\footnotesize{}{ +\end{MacroCode} +\begin{MacroCode}{size-10} + \__skrapport_set_font_size:nn{8}{9.5} + \skip_gset:Nn \abovedisplayskip {6pt~plus~2pt~minus~4pt} + \skip_gset:Nn \abovedisplayshortskip {0pt~plus~1pt} + \skip_gset:Nn \belowdisplayshortskip {3pt~plus~1pt~minus~2pt} +\end{MacroCode} +\begin{MacroCode}{size-11} + \__skrapport_set_font_size:nn{9}{11} + \skip_gset:Nn \abovedisplayskip {8pt~plus~2pt~minus~4pt} + \skip_gset:Nn \abovedisplayshortskip {0pt~plus~1pt} + \skip_gset:Nn \belowdisplayshortskip {4pt~plus~2pt~minus~2pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{10}{12} + \skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt} + \skip_gset:Nn \abovedisplayshortskip { 0pt~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip { 6pt~plus~3pt~minus~3pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini +\end{MacroCode} +\begin{MacroCode}{size-10} + \skip_gset:Nn\topsep{3pt~plus~1pt~minus~1pt} + \skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-11} + \skip_gset:Nn\topsep{4pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \skip_gset:Nn\topsep{6pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{3pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} + \skip_gset_eq:NN\itemsep\parsep + } +} +\end{MacroCode} + \end{macro} + \begin{macro}{\scriptsize} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\scriptsize{}{ +\end{MacroCode} +\begin{MacroCode}{size-10} + \__skrapport_set_font_size:nn{7}{8} +\end{MacroCode} +\begin{MacroCode}{size-11,size-12} + \__skrapport_set_font_size:nn{8}{9.5} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\tiny} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\tiny{}{ +\end{MacroCode} +\begin{MacroCode}{size-10} + \__skrapport_set_font_size:nn{5}{6} +\end{MacroCode} +\begin{MacroCode}{size-11,size-12} + \__skrapport_set_font_size:nn{6}{7} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\large} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\large{}{ +\end{MacroCode} +\begin{MacroCode}{size-10,size-11} + \__skrapport_set_font_size:nn{12}{14} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{14}{18} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\Large} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\Large{}{ +\end{MacroCode} +\begin{MacroCode}{size-10,size-11} + \__skrapport_set_font_size:nn{14}{18} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{17}{22} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\LARGE} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\LARGE{}{ +\end{MacroCode} +\begin{MacroCode}{size-10,size-11} + \__skrapport_set_font_size:nn{17}{22} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{20}{25} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\huge} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\huge{}{ +\end{MacroCode} +\begin{MacroCode}{size-10,size-11} + \__skrapport_set_font_size:nn{20}{25} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{25}{30} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\end{MacroCode} + \end{macro} + \begin{macro}{\Huge} +\begin{MacroCode}{size-10,size-11,size-12} +\NewDocumentCommand\Huge{}{ +\end{MacroCode} +\begin{MacroCode}{size-10,size-11} + \__skrapport_set_font_size:nn{25}{30} +\end{MacroCode} +\begin{MacroCode}{size-12} + \__skrapport_set_font_size:nn{30}{36} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\end{MacroCode} + \end{macro} +\begin{MacroCode}{size-10} +\dim_set:Nn\parindent {15pt} +\end{MacroCode} +\begin{MacroCode}{size-11} +\dim_set:Nn\parindent {17pt} +\end{MacroCode} +\begin{MacroCode}{size-12} +\dim_set:Nn\parindent {1.5em} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +\skip_set:Nn\smallskipamount{ 3pt~plus~1pt~minus~1pt} +\skip_set:Nn\medskipamount { 6pt~plus~2pt~minus~2pt} +\skip_set:Nn\bigskipamount {12pt~plus~4pt~minus~4pt} +\dim_set:Nn\headheight{12pt} +\dim_set:Nn\headsep {25pt} +\dim_set:Nn\topskip {10pt} +\dim_set:Nn\footskip {30pt} +\dim_set:Nn\maxdepth { 5pt} +\end{MacroCode} + These (\emph{i.e.} text width and height) are hopefully overwritten + by \pkg{typearea} later, so we don't bother much with them. +\begin{MacroCode}{size-10,size-11,size-12} +\dim_set:Nn\textwidth {\paperwidth-2cm} +\dim_set:Nn\textheight{\paperheight-2cm} +\dim_set:Nn\oddsidemargin {.2cm} +\dim_set:Nn\evensidemargin {1cm} +\dim_set:Nn\marginparsep {11pt} +\dim_set:Nn\marginparpush {5pt} +\dim_set:Nn\marginparwidth {.8cm-\marginparsep} +\dim_set:Nn\topmargin{\paperheight-1cm + -\headheight-\headsep + -\textheight-\footskip + -.5\topmargin} +\end{MacroCode} +\begin{MacroCode}{size-10} +\dim_set:Nn\footnotesep{6.65pt} +\skip_set:Nn{\skip\footins} { 9pt~plus~4pt~minus~2pt} +\skip_set:Nn\floatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\textfloatsep {20pt~plus~2pt~minus~4pt} +\skip_set:Nn\intextsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dblfloatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dbltextfloatsep{20pt~plus~2pt~minus~4pt} +\end{MacroCode} +\begin{MacroCode}{size-11} +\dim_set:Nn\footnotesep{7.7pt} +\skip_set:Nn{\skip\footins} {10pt~plus~4pt~minus~2pt} +\skip_set:Nn\floatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\textfloatsep {20pt~plus~2pt~minus~4pt} +\skip_set:Nn\intextsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dblfloatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dbltextfloatsep{20pt~plus~2pt~minus~4pt} +\end{MacroCode} +\begin{MacroCode}{size-12} +\dim_set:Nn\footnotesep{8.4pt} +\skip_set:Nn{\skip\footins} {10.8pt~plus~4pt~minus~2pt} +\skip_set:Nn\floatsep {12pt ~plus~2pt~minus~4pt} +\skip_set:Nn\textfloatsep {20pt ~plus~2pt~minus~4pt} +\skip_set:Nn\intextsep {14pt ~plus~4pt~minus~4pt} +\skip_set:Nn\dblfloatsep {14pt ~plus~2pt~minus~4pt} +\skip_set:Nn\dbltextfloatsep{20pt ~plus~2pt~minus~4pt} +\end{MacroCode} + These six have been changed slightly compared to \LaTeXe. +\begin{MacroCode}{size-10,size-11,size-12} +\skip_set:Nn\@fptop{ 5pt} +\end{MacroCode} +\begin{MacroCode}{size-10} +\skip_set:Nn\@fpsep{10pt~plus~2fil} +\end{MacroCode} +\begin{MacroCode}{size-11} +\skip_set:Nn\@fpsep{11pt~plus~2fil} +\end{MacroCode} +\begin{MacroCode}{size-12} +\skip_set:Nn\@fpsep{12pt~plus~2fil} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +\skip_set:Nn\@fpbot{ 5pt} +\skip_set:Nn\@dblfptop{ 5pt} +\end{MacroCode} +\begin{MacroCode}{size-10} +\skip_set:Nn\@dblfpsep{10pt~plus~2fil} +\end{MacroCode} +\begin{MacroCode}{size-11} +\skip_set:Nn\@dblfpsep{11pt~plus~2fil} +\end{MacroCode} +\begin{MacroCode}{size-12} +\skip_set:Nn\@dblfpsep{12pt~plus~2fil} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +\skip_set:Nn\@dblfpbot{ 5pt} +\end{MacroCode} +\begin{MacroCode}{size-10} +\skip_set:Nn\partopsep{2pt~plus~1pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-11} +\skip_set:Nn\partopsep{3pt~plus~1pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-12} +\skip_set:Nn\partopsep{3pt~plus~2pt~minus~2pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +\cs_set:Npn\@listi{ + \dim_set_eq:NN\leftmargin\leftmargini +\end{MacroCode} +\begin{MacroCode}{size-10} + \skip_set:Nn\parsep {4pt~plus~2pt~minus~1pt} + \skip_set:Nn\topsep {8pt~plus~2pt~minus~4pt} + \skip_set:Nn\itemsep{4pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-11} + \skip_set:Nn\parsep {4.5pt~plus~2pt~minus~1pt} + \skip_set:Nn\topsep { 9pt~plus~3pt~minus~5pt} + \skip_set:Nn\itemsep{4.5pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \skip_set:Nn\parsep { 5pt~plus~2.5pt~minus~1pt} + \skip_set:Nn\topsep {10pt~plus~4pt ~minus~6pt} + \skip_set:Nn\itemsep{ 5pt~plus~2.5pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +} +\cs_set_eq:NN\@listI\@listi +\dim_gset_eq:NN\leftmargin\leftmargini +\end{MacroCode} +\begin{MacroCode}{size-10} +\skip_gset:Nn\parsep {4pt~plus~2pt~minus~1pt} +\skip_gset:Nn\topsep {8pt~plus~2pt~minus~4pt} +\skip_gset:Nn\itemsep{4pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-11} +\skip_gset:Nn\parsep {4.5pt~plus~2pt~minus~1pt} +\skip_gset:Nn\topsep { 9pt~plus~3pt~minus~5pt} +\skip_gset:Nn\itemsep{4.5pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-12} +\skip_gset:Nn\parsep { 5pt~plus~2.5pt~minus~1pt} +\skip_gset:Nn\topsep {10pt~plus~4pt ~minus~6pt} +\skip_gset:Nn\itemsep{ 5pt~plus~2.5pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} +\cs_set:Npn\@listii{ + \dim_set_eq:NN\leftmargin\leftmarginii + \dim_set:Nn\labelwidth{\leftmarginii-\labelsep} +\end{MacroCode} +\begin{MacroCode}{size-10} + \skip_set:Nn\parsep {2pt~plus~1pt~minus~1pt} + \skip_set:Nn\topsep {4pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-11} + \skip_set:Nn\parsep { 2pt~plus~1pt~minus~1pt} + \skip_set:Nn\topsep {4.5pt~plus~2pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \skip_set:Nn\parsep {2.5pt~plus~1pt ~minus~1pt} + \skip_set:Nn\topsep { 5pt~plus~2.5pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} + \skip_set_eq:NN\itemsep\parsep +} +\cs_set:Npn\@listiii{ + \dim_set_eq:NN\leftmargin\leftmarginiii + \dim_set:Nn\labelwidth{\leftmarginiii-\labelsep} + \skip_set_eq:NN\parsep\c_zero_skip +\end{MacroCode} +\begin{MacroCode}{size-10,size-11} + \skip_set:Nn\topsep {2pt~plus~1pt~minus~1pt} + \skip_set:Nn\partopsep{1pt~plus~0pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-12} + \skip_set:Nn\topsep {2.5pt~plus~1pt~minus~1pt} + \skip_set:Nn\partopsep{ 1pt~plus~0pt~minus~1pt} +\end{MacroCode} +\begin{MacroCode}{size-10,size-11,size-12} + \skip_set_eq:NN\itemsep\topsep +} +\cs_set:Npn\@listiv{ + \dim_set_eq:NN\leftmargin\leftmarginiv + \dim_set:Nn\labelwidth{\leftmarginiv-\labelsep} +} +\cs_set:Npn\@listv{ + \dim_set_eq:NN\leftmargin\leftmarginv + \dim_set:Nn\labelwidth{\leftmarginv-\labelsep} +} +\cs_set:Npn\@listvi{ + \dim_set_eq:NN\leftmargin\leftmarginvi + \dim_set:Nn\labelwidth{\leftmarginvi-\labelsep} +} +\endinput +\end{MacroCode} + + \Finale + \section{Installation} + The easiest way to install this package is using the package + manager provided by your \LaTeX\ installation if such a program + is available. Failing that, provided you have obtained the package + source (\file{skrapport.tex} and \file{Makefile}) from either CTAN + or Github, running \texttt{make install} inside the source directory + works well. This will extract the documentation and code from + \file{skrapport.tex}, install all files into the TDS tree at + \texttt{TEXMFHOME} and run \texttt{mktexlsr}. + + If you want to extract code and documentation without installing + the package, run \texttt{make all} instead. If you insist on not + using \texttt{make}, remember that packages distributed using + \pkg{skdoc} must be extracted using \texttt{pdflatex}, \emph{not} + \texttt{tex} or \texttt{latex}. + + \PrintChanges + \PrintIndex + \printbibliography +\end{document} diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-cruelwater.sty b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-cruelwater.sty index f3edff7c65f..1d3b2387227 100644 --- a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-cruelwater.sty +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-cruelwater.sty @@ -1,7 +1,7 @@ %% This is file `skrapport-colortheme-cruelwater.sty', generated from `skrapport.tex' (key `theme-cruelwater'). -%% chscite Skånings rapportklass +%% skrapport Skånings rapportklass %% -%% Copyright (C) 2012 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -15,14 +15,21 @@ %% %% The Current Maintainer of this work is Simon Sigurdhsson. %% -%% This work consists of the file skrapport.tex and the -%% derived files skrapport.cls, skrapport-colortheme-default.sty, -%% skrapport-colortheme-unscathed.sty, skrapport-colortheme-violet.sty -%% and skrapport-colortheme-cruelwater.sty. +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-cruelwater}% - [2012/06/07 v1.0 skrapport color theme cruelwater] +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-cruelwater} + {2012/06/07}{1.0}{skrapport color theme cruelwater} \definecolor{skrapport@citecolor}{named}{black} \definecolor{skrapport@filecolor}{named}{black} \definecolor{skrapport@linkcolor}{named}{black} diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-default.sty b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-default.sty index 70c040269fe..ec25eaa46ee 100644 --- a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-default.sty +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-default.sty @@ -1,7 +1,7 @@ %% This is file `skrapport-colortheme-default.sty', generated from `skrapport.tex' (key `theme-default'). -%% chscite Skånings rapportklass +%% skrapport Skånings rapportklass %% -%% Copyright (C) 2012 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -15,14 +15,21 @@ %% %% The Current Maintainer of this work is Simon Sigurdhsson. %% -%% This work consists of the file skrapport.tex and the -%% derived files skrapport.cls, skrapport-colortheme-default.sty, -%% skrapport-colortheme-unscathed.sty, skrapport-colortheme-violet.sty -%% and skrapport-colortheme-cruelwater.sty. +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-default}% - [2012/06/07 v1.0 skrapport color theme default] +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-default} + {2012/06/07}{1.0}{skrapport color theme default} \definecolor{skrapport@citecolor}{named}{green} \definecolor{skrapport@filecolor}{named}{teal} \definecolor{skrapport@linkcolor}{named}{red} diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-skdoc.sty b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-skdoc.sty new file mode 100644 index 00000000000..f21bf49beb1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-skdoc.sty @@ -0,0 +1,48 @@ +%% This is file `skrapport-colortheme-skdoc.sty', generated from `skrapport.tex' (key `theme-skdoc'). +%% skrapport Skånings rapportklass +%% +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Simon Sigurdhsson. +%% +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo + +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-skdoc} + {2013/04/10}{1.0}{skrapport color theme skdoc} +\definecolor{skrapport@citecolor}{RGB}{140,35,24} +\definecolor{skrapport@filecolor}{RGB}{73,10,61} +\definecolor{skrapport@linkcolor}{RGB}{140,35,24} +\definecolor{skrapport@menucolor}{RGB}{140,35,24} +\definecolor{skrapport@urlcolor}{RGB}{73,10,61} +\definecolor{skrapport@runcolor}{RGB}{73,10,61} +\definecolor{skrapport@boldcolor}{RGB}{73,10,61} +\definecolor{skrapport@titlecolor}{RGB}{11,72,107} +\definecolor{skrapport@italiccolor}{named}{black} +\definecolor{skrapport@smallprintcolor}{RGB}{11,72,107} +\definecolor{skrapport@quotecolor}{RGB}{140,35,24} +\definecolor{skrapport@captioncolor}{RGB}{11,72,107} +\definecolor{skrapport@emphcolor}{RGB}{73,10,61} +\definecolor{skrapport@defaultcolor}{named}{black} +\endinput + diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-unscathed.sty b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-unscathed.sty index acd0b251d3b..9d06a6ea193 100644 --- a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-unscathed.sty +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-unscathed.sty @@ -1,7 +1,7 @@ %% This is file `skrapport-colortheme-unscathed.sty', generated from `skrapport.tex' (key `theme-unscathed'). -%% chscite Skånings rapportklass +%% skrapport Skånings rapportklass %% -%% Copyright (C) 2012 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -15,14 +15,21 @@ %% %% The Current Maintainer of this work is Simon Sigurdhsson. %% -%% This work consists of the file skrapport.tex and the -%% derived files skrapport.cls, skrapport-colortheme-default.sty, -%% skrapport-colortheme-unscathed.sty, skrapport-colortheme-violet.sty -%% and skrapport-colortheme-cruelwater.sty. +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-unscathed}% - [2012/06/07 v1.0 skrapport color theme unscathed] +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-unscathed} + {2012/06/07}{1.0}{skrapport color theme unscathed} \definecolor{skrapport@citecolor}{named}{skrapport@defaultcolor} \definecolor{skrapport@filecolor}{named}{skrapport@defaultcolor} \definecolor{skrapport@menucolor}{named}{skrapport@defaultcolor} diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-violet.sty b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-violet.sty index 753b8f6a2fe..e13cdf09de1 100644 --- a/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-violet.sty +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-colortheme-violet.sty @@ -1,7 +1,7 @@ %% This is file `skrapport-colortheme-violet.sty', generated from `skrapport.tex' (key `theme-violet'). -%% chscite Skånings rapportklass +%% skrapport Skånings rapportklass %% -%% Copyright (C) 2012 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -15,14 +15,21 @@ %% %% The Current Maintainer of this work is Simon Sigurdhsson. %% -%% This work consists of the file skrapport.tex and the -%% derived files skrapport.cls, skrapport-colortheme-default.sty, -%% skrapport-colortheme-unscathed.sty, skrapport-colortheme-violet.sty -%% and skrapport-colortheme-cruelwater.sty. +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{skrapport-colortheme-violet}% - [2012/06/07 v1.0 skrapport color theme violet] +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-colortheme-violet} + {2012/06/07}{1.0}{skrapport color theme violet} \definecolor{skrapport@citecolor}{HTML}{932444} \definecolor{skrapport@filecolor}{HTML}{932444} \definecolor{skrapport@linkcolor}{HTML}{932444} diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-size-common.sty b/Master/texmf-dist/tex/latex/skrapport/skrapport-size-common.sty new file mode 100644 index 00000000000..d6e4f00985b --- /dev/null +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-size-common.sty @@ -0,0 +1,38 @@ +%% This is file `skrapport-size-common.sty', generated from `skrapport.tex' (key `size-common'). +%% skrapport Skånings rapportklass +%% +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Simon Sigurdhsson. +%% +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo + +\RequirePackage{expl3} +\ProvidesExplPackage{skrapport-size-common} + {2013/04/29}{1.0}{skrapport point size option common macros} +\cs_new:Npn\__skrapport_set_font_size:nn#1#2{ + \fontsize{#1}{#2} % !!! + \selectfont +} +\endinput + diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-size10pt.clo b/Master/texmf-dist/tex/latex/skrapport/skrapport-size10pt.clo new file mode 100644 index 00000000000..c0a2c84bf70 --- /dev/null +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-size10pt.clo @@ -0,0 +1,163 @@ +%% This is file `skrapport-size10pt.clo', generated from `skrapport.tex' (key `size-10'). +%% skrapport Skånings rapportklass +%% +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Simon Sigurdhsson. +%% +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo + +\RequirePackage{expl3} +\ProvidesExplFile{skrapport-size10pt.clo} + {2013/04/29}{1.0}{skrapport point size option 10pt} +\RequirePackage{skrapport-size-common} +\RenewDocumentCommand\normalsize{}{ + \__skrapport_set_font_size:nn{10}{12} + \skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6pt ~plus~3pt~minus~3pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset_eq:NN\@listi\@listI +} +\normalsize +\NewDocumentCommand\small{}{ + \__skrapport_set_font_size:nn{9}{11} + \skip_gset:Nn \abovedisplayskip {8.5pt~plus~3pt~minus~4pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~2pt} + \skip_gset:Nn \belowdisplayshortskip {4pt ~plus~2pt~minus~2pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini + \skip_gset:Nn\topsep{4pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt} + \skip_gset_eq:NN\itemsep\parsep + } +} +\NewDocumentCommand\footnotesize{}{ + \__skrapport_set_font_size:nn{8}{9.5} + \skip_gset:Nn \abovedisplayskip {6pt~plus~2pt~minus~4pt} + \skip_gset:Nn \abovedisplayshortskip {0pt~plus~1pt} + \skip_gset:Nn \belowdisplayshortskip {3pt~plus~1pt~minus~2pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini + \skip_gset:Nn\topsep{3pt~plus~1pt~minus~1pt} + \skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt} + \skip_gset_eq:NN\itemsep\parsep + } +} +\NewDocumentCommand\scriptsize{}{ + \__skrapport_set_font_size:nn{7}{8} +} +\NewDocumentCommand\tiny{}{ + \__skrapport_set_font_size:nn{5}{6} +} +\NewDocumentCommand\large{}{ + \__skrapport_set_font_size:nn{12}{14} +} +\NewDocumentCommand\Large{}{ + \__skrapport_set_font_size:nn{14}{18} +} +\NewDocumentCommand\LARGE{}{ + \__skrapport_set_font_size:nn{17}{22} +} +\NewDocumentCommand\huge{}{ + \__skrapport_set_font_size:nn{20}{25} +} +\NewDocumentCommand\Huge{}{ + \__skrapport_set_font_size:nn{25}{30} +} +\dim_set:Nn\parindent {15pt} +\skip_set:Nn\smallskipamount{ 3pt~plus~1pt~minus~1pt} +\skip_set:Nn\medskipamount { 6pt~plus~2pt~minus~2pt} +\skip_set:Nn\bigskipamount {12pt~plus~4pt~minus~4pt} +\dim_set:Nn\headheight{12pt} +\dim_set:Nn\headsep {25pt} +\dim_set:Nn\topskip {10pt} +\dim_set:Nn\footskip {30pt} +\dim_set:Nn\maxdepth { 5pt} +\dim_set:Nn\textwidth {\paperwidth-2cm} +\dim_set:Nn\textheight{\paperheight-2cm} +\dim_set:Nn\oddsidemargin {.2cm} +\dim_set:Nn\evensidemargin {1cm} +\dim_set:Nn\marginparsep {11pt} +\dim_set:Nn\marginparpush {5pt} +\dim_set:Nn\marginparwidth {.8cm-\marginparsep} +\dim_set:Nn\topmargin{\paperheight-1cm + -\headheight-\headsep + -\textheight-\footskip + -.5\topmargin} +\dim_set:Nn\footnotesep{6.65pt} +\skip_set:Nn{\skip\footins} { 9pt~plus~4pt~minus~2pt} +\skip_set:Nn\floatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\textfloatsep {20pt~plus~2pt~minus~4pt} +\skip_set:Nn\intextsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dblfloatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dbltextfloatsep{20pt~plus~2pt~minus~4pt} +\skip_set:Nn\@fptop{ 5pt} +\skip_set:Nn\@fpsep{10pt~plus~2fil} +\skip_set:Nn\@fpbot{ 5pt} +\skip_set:Nn\@dblfptop{ 5pt} +\skip_set:Nn\@dblfpsep{10pt~plus~2fil} +\skip_set:Nn\@dblfpbot{ 5pt} +\skip_set:Nn\partopsep{2pt~plus~1pt~minus~1pt} +\cs_set:Npn\@listi{ + \dim_set_eq:NN\leftmargin\leftmargini + \skip_set:Nn\parsep {4pt~plus~2pt~minus~1pt} + \skip_set:Nn\topsep {8pt~plus~2pt~minus~4pt} + \skip_set:Nn\itemsep{4pt~plus~2pt~minus~1pt} +} +\cs_set_eq:NN\@listI\@listi +\dim_gset_eq:NN\leftmargin\leftmargini +\skip_gset:Nn\parsep {4pt~plus~2pt~minus~1pt} +\skip_gset:Nn\topsep {8pt~plus~2pt~minus~4pt} +\skip_gset:Nn\itemsep{4pt~plus~2pt~minus~1pt} +\cs_set:Npn\@listii{ + \dim_set_eq:NN\leftmargin\leftmarginii + \dim_set:Nn\labelwidth{\leftmarginii-\labelsep} + \skip_set:Nn\parsep {2pt~plus~1pt~minus~1pt} + \skip_set:Nn\topsep {4pt~plus~2pt~minus~1pt} + \skip_set_eq:NN\itemsep\parsep +} +\cs_set:Npn\@listiii{ + \dim_set_eq:NN\leftmargin\leftmarginiii + \dim_set:Nn\labelwidth{\leftmarginiii-\labelsep} + \skip_set_eq:NN\parsep\c_zero_skip + \skip_set:Nn\topsep {2pt~plus~1pt~minus~1pt} + \skip_set:Nn\partopsep{1pt~plus~0pt~minus~1pt} + \skip_set_eq:NN\itemsep\topsep +} +\cs_set:Npn\@listiv{ + \dim_set_eq:NN\leftmargin\leftmarginiv + \dim_set:Nn\labelwidth{\leftmarginiv-\labelsep} +} +\cs_set:Npn\@listv{ + \dim_set_eq:NN\leftmargin\leftmarginv + \dim_set:Nn\labelwidth{\leftmarginv-\labelsep} +} +\cs_set:Npn\@listvi{ + \dim_set_eq:NN\leftmargin\leftmarginvi + \dim_set:Nn\labelwidth{\leftmarginvi-\labelsep} +} +\endinput + diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-size11pt.clo b/Master/texmf-dist/tex/latex/skrapport/skrapport-size11pt.clo new file mode 100644 index 00000000000..b3cf8108074 --- /dev/null +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-size11pt.clo @@ -0,0 +1,163 @@ +%% This is file `skrapport-size11pt.clo', generated from `skrapport.tex' (key `size-11'). +%% skrapport Skånings rapportklass +%% +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Simon Sigurdhsson. +%% +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo + +\RequirePackage{expl3} +\ProvidesExplFile{skrapport-size11pt.clo} + {2013/04/29}{1.0}{skrapport point size option 11pt} +\RequirePackage{skrapport-size-common} +\RenewDocumentCommand\normalsize{}{ + \__skrapport_set_font_size:nn{11}{13.2} + \skip_gset:Nn \abovedisplayskip {11pt ~plus~3pt ~minus~6pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset_eq:NN\@listi\@listI +} +\normalsize +\NewDocumentCommand\small{}{ + \__skrapport_set_font_size:nn{10}{12} + \skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~2pt} + \skip_gset:Nn \belowdisplayshortskip {6pt ~plus~3pt~minus~3pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini + \skip_gset:Nn\topsep{6pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{3pt~plus~2pt~minus~1pt} + \skip_gset_eq:NN\itemsep\parsep + } +} +\NewDocumentCommand\footnotesize{}{ + \__skrapport_set_font_size:nn{9}{11} + \skip_gset:Nn \abovedisplayskip {8pt~plus~2pt~minus~4pt} + \skip_gset:Nn \abovedisplayshortskip {0pt~plus~1pt} + \skip_gset:Nn \belowdisplayshortskip {4pt~plus~2pt~minus~2pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini + \skip_gset:Nn\topsep{4pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{2pt~plus~1pt~minus~1pt} + \skip_gset_eq:NN\itemsep\parsep + } +} +\NewDocumentCommand\scriptsize{}{ + \__skrapport_set_font_size:nn{8}{9.5} +} +\NewDocumentCommand\tiny{}{ + \__skrapport_set_font_size:nn{6}{7} +} +\NewDocumentCommand\large{}{ + \__skrapport_set_font_size:nn{12}{14} +} +\NewDocumentCommand\Large{}{ + \__skrapport_set_font_size:nn{14}{18} +} +\NewDocumentCommand\LARGE{}{ + \__skrapport_set_font_size:nn{17}{22} +} +\NewDocumentCommand\huge{}{ + \__skrapport_set_font_size:nn{20}{25} +} +\NewDocumentCommand\Huge{}{ + \__skrapport_set_font_size:nn{25}{30} +} +\dim_set:Nn\parindent {17pt} +\skip_set:Nn\smallskipamount{ 3pt~plus~1pt~minus~1pt} +\skip_set:Nn\medskipamount { 6pt~plus~2pt~minus~2pt} +\skip_set:Nn\bigskipamount {12pt~plus~4pt~minus~4pt} +\dim_set:Nn\headheight{12pt} +\dim_set:Nn\headsep {25pt} +\dim_set:Nn\topskip {10pt} +\dim_set:Nn\footskip {30pt} +\dim_set:Nn\maxdepth { 5pt} +\dim_set:Nn\textwidth {\paperwidth-2cm} +\dim_set:Nn\textheight{\paperheight-2cm} +\dim_set:Nn\oddsidemargin {.2cm} +\dim_set:Nn\evensidemargin {1cm} +\dim_set:Nn\marginparsep {11pt} +\dim_set:Nn\marginparpush {5pt} +\dim_set:Nn\marginparwidth {.8cm-\marginparsep} +\dim_set:Nn\topmargin{\paperheight-1cm + -\headheight-\headsep + -\textheight-\footskip + -.5\topmargin} +\dim_set:Nn\footnotesep{7.7pt} +\skip_set:Nn{\skip\footins} {10pt~plus~4pt~minus~2pt} +\skip_set:Nn\floatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\textfloatsep {20pt~plus~2pt~minus~4pt} +\skip_set:Nn\intextsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dblfloatsep {12pt~plus~2pt~minus~2pt} +\skip_set:Nn\dbltextfloatsep{20pt~plus~2pt~minus~4pt} +\skip_set:Nn\@fptop{ 5pt} +\skip_set:Nn\@fpsep{11pt~plus~2fil} +\skip_set:Nn\@fpbot{ 5pt} +\skip_set:Nn\@dblfptop{ 5pt} +\skip_set:Nn\@dblfpsep{11pt~plus~2fil} +\skip_set:Nn\@dblfpbot{ 5pt} +\skip_set:Nn\partopsep{3pt~plus~1pt~minus~1pt} +\cs_set:Npn\@listi{ + \dim_set_eq:NN\leftmargin\leftmargini + \skip_set:Nn\parsep {4.5pt~plus~2pt~minus~1pt} + \skip_set:Nn\topsep { 9pt~plus~3pt~minus~5pt} + \skip_set:Nn\itemsep{4.5pt~plus~2pt~minus~1pt} +} +\cs_set_eq:NN\@listI\@listi +\dim_gset_eq:NN\leftmargin\leftmargini +\skip_gset:Nn\parsep {4.5pt~plus~2pt~minus~1pt} +\skip_gset:Nn\topsep { 9pt~plus~3pt~minus~5pt} +\skip_gset:Nn\itemsep{4.5pt~plus~2pt~minus~1pt} +\cs_set:Npn\@listii{ + \dim_set_eq:NN\leftmargin\leftmarginii + \dim_set:Nn\labelwidth{\leftmarginii-\labelsep} + \skip_set:Nn\parsep { 2pt~plus~1pt~minus~1pt} + \skip_set:Nn\topsep {4.5pt~plus~2pt~minus~1pt} + \skip_set_eq:NN\itemsep\parsep +} +\cs_set:Npn\@listiii{ + \dim_set_eq:NN\leftmargin\leftmarginiii + \dim_set:Nn\labelwidth{\leftmarginiii-\labelsep} + \skip_set_eq:NN\parsep\c_zero_skip + \skip_set:Nn\topsep {2pt~plus~1pt~minus~1pt} + \skip_set:Nn\partopsep{1pt~plus~0pt~minus~1pt} + \skip_set_eq:NN\itemsep\topsep +} +\cs_set:Npn\@listiv{ + \dim_set_eq:NN\leftmargin\leftmarginiv + \dim_set:Nn\labelwidth{\leftmarginiv-\labelsep} +} +\cs_set:Npn\@listv{ + \dim_set_eq:NN\leftmargin\leftmarginv + \dim_set:Nn\labelwidth{\leftmarginv-\labelsep} +} +\cs_set:Npn\@listvi{ + \dim_set_eq:NN\leftmargin\leftmarginvi + \dim_set:Nn\labelwidth{\leftmarginvi-\labelsep} +} +\endinput + diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport-size12pt.clo b/Master/texmf-dist/tex/latex/skrapport/skrapport-size12pt.clo new file mode 100644 index 00000000000..d1763532115 --- /dev/null +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport-size12pt.clo @@ -0,0 +1,163 @@ +%% This is file `skrapport-size12pt.clo', generated from `skrapport.tex' (key `size-12'). +%% skrapport Skånings rapportklass +%% +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Simon Sigurdhsson. +%% +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo + +\RequirePackage{expl3} +\ProvidesExplFile{skrapport-size12pt.clo} + {2013/04/29}{1.0}{skrapport point size option 12pt} +\RequirePackage{skrapport-size-common} +\RenewDocumentCommand\normalsize{}{ + \__skrapport_set_font_size:nn{12}{14.5} + \skip_gset:Nn \abovedisplayskip {12pt ~plus~3pt ~minus~7pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset_eq:NN\@listi\@listI +} +\normalsize +\NewDocumentCommand\small{}{ + \__skrapport_set_font_size:nn{11}{13.6} + \skip_gset:Nn \abovedisplayskip {11pt ~plus~3pt ~minus~6pt} + \skip_gset:Nn \abovedisplayshortskip {0pt ~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip {6.5pt~plus~3.5pt~minus~3pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini + \skip_gset:Nn\topsep{ 9pt~plus~3pt~minus~5pt} + \skip_gset:Nn\parsep{4.5pt~plus~2pt~minus~1pt} + \skip_gset_eq:NN\itemsep\parsep + } +} +\NewDocumentCommand\footnotesize{}{ + \__skrapport_set_font_size:nn{10}{12} + \skip_gset:Nn \abovedisplayskip {10pt~plus~2pt~minus~5pt} + \skip_gset:Nn \abovedisplayshortskip { 0pt~plus~3pt} + \skip_gset:Nn \belowdisplayshortskip { 6pt~plus~3pt~minus~3pt} + \skip_gset_eq:NN\belowdisplayskip \abovedisplayskip + \cs_gset:Npn\@listi{ + \dim_gset_eq:NN\leftmargin\leftmargini + \skip_gset:Nn\topsep{6pt~plus~2pt~minus~2pt} + \skip_gset:Nn\parsep{3pt~plus~2pt~minus~1pt} + \skip_gset_eq:NN\itemsep\parsep + } +} +\NewDocumentCommand\scriptsize{}{ + \__skrapport_set_font_size:nn{8}{9.5} +} +\NewDocumentCommand\tiny{}{ + \__skrapport_set_font_size:nn{6}{7} +} +\NewDocumentCommand\large{}{ + \__skrapport_set_font_size:nn{14}{18} +} +\NewDocumentCommand\Large{}{ + \__skrapport_set_font_size:nn{17}{22} +} +\NewDocumentCommand\LARGE{}{ + \__skrapport_set_font_size:nn{20}{25} +} +\NewDocumentCommand\huge{}{ + \__skrapport_set_font_size:nn{25}{30} +} +\NewDocumentCommand\Huge{}{ + \__skrapport_set_font_size:nn{30}{36} +} +\dim_set:Nn\parindent {1.5em} +\skip_set:Nn\smallskipamount{ 3pt~plus~1pt~minus~1pt} +\skip_set:Nn\medskipamount { 6pt~plus~2pt~minus~2pt} +\skip_set:Nn\bigskipamount {12pt~plus~4pt~minus~4pt} +\dim_set:Nn\headheight{12pt} +\dim_set:Nn\headsep {25pt} +\dim_set:Nn\topskip {10pt} +\dim_set:Nn\footskip {30pt} +\dim_set:Nn\maxdepth { 5pt} +\dim_set:Nn\textwidth {\paperwidth-2cm} +\dim_set:Nn\textheight{\paperheight-2cm} +\dim_set:Nn\oddsidemargin {.2cm} +\dim_set:Nn\evensidemargin {1cm} +\dim_set:Nn\marginparsep {11pt} +\dim_set:Nn\marginparpush {5pt} +\dim_set:Nn\marginparwidth {.8cm-\marginparsep} +\dim_set:Nn\topmargin{\paperheight-1cm + -\headheight-\headsep + -\textheight-\footskip + -.5\topmargin} +\dim_set:Nn\footnotesep{8.4pt} +\skip_set:Nn{\skip\footins} {10.8pt~plus~4pt~minus~2pt} +\skip_set:Nn\floatsep {12pt ~plus~2pt~minus~4pt} +\skip_set:Nn\textfloatsep {20pt ~plus~2pt~minus~4pt} +\skip_set:Nn\intextsep {14pt ~plus~4pt~minus~4pt} +\skip_set:Nn\dblfloatsep {14pt ~plus~2pt~minus~4pt} +\skip_set:Nn\dbltextfloatsep{20pt ~plus~2pt~minus~4pt} +\skip_set:Nn\@fptop{ 5pt} +\skip_set:Nn\@fpsep{12pt~plus~2fil} +\skip_set:Nn\@fpbot{ 5pt} +\skip_set:Nn\@dblfptop{ 5pt} +\skip_set:Nn\@dblfpsep{12pt~plus~2fil} +\skip_set:Nn\@dblfpbot{ 5pt} +\skip_set:Nn\partopsep{3pt~plus~2pt~minus~2pt} +\cs_set:Npn\@listi{ + \dim_set_eq:NN\leftmargin\leftmargini + \skip_set:Nn\parsep { 5pt~plus~2.5pt~minus~1pt} + \skip_set:Nn\topsep {10pt~plus~4pt ~minus~6pt} + \skip_set:Nn\itemsep{ 5pt~plus~2.5pt~minus~1pt} +} +\cs_set_eq:NN\@listI\@listi +\dim_gset_eq:NN\leftmargin\leftmargini +\skip_gset:Nn\parsep { 5pt~plus~2.5pt~minus~1pt} +\skip_gset:Nn\topsep {10pt~plus~4pt ~minus~6pt} +\skip_gset:Nn\itemsep{ 5pt~plus~2.5pt~minus~1pt} +\cs_set:Npn\@listii{ + \dim_set_eq:NN\leftmargin\leftmarginii + \dim_set:Nn\labelwidth{\leftmarginii-\labelsep} + \skip_set:Nn\parsep {2.5pt~plus~1pt ~minus~1pt} + \skip_set:Nn\topsep { 5pt~plus~2.5pt~minus~1pt} + \skip_set_eq:NN\itemsep\parsep +} +\cs_set:Npn\@listiii{ + \dim_set_eq:NN\leftmargin\leftmarginiii + \dim_set:Nn\labelwidth{\leftmarginiii-\labelsep} + \skip_set_eq:NN\parsep\c_zero_skip + \skip_set:Nn\topsep {2.5pt~plus~1pt~minus~1pt} + \skip_set:Nn\partopsep{ 1pt~plus~0pt~minus~1pt} + \skip_set_eq:NN\itemsep\topsep +} +\cs_set:Npn\@listiv{ + \dim_set_eq:NN\leftmargin\leftmarginiv + \dim_set:Nn\labelwidth{\leftmarginiv-\labelsep} +} +\cs_set:Npn\@listv{ + \dim_set_eq:NN\leftmargin\leftmarginv + \dim_set:Nn\labelwidth{\leftmarginv-\labelsep} +} +\cs_set:Npn\@listvi{ + \dim_set_eq:NN\leftmargin\leftmarginvi + \dim_set:Nn\labelwidth{\leftmarginvi-\labelsep} +} +\endinput + diff --git a/Master/texmf-dist/tex/latex/skrapport/skrapport.cls b/Master/texmf-dist/tex/latex/skrapport/skrapport.cls index 56af56cdc66..e67a17fdb2d 100644 --- a/Master/texmf-dist/tex/latex/skrapport/skrapport.cls +++ b/Master/texmf-dist/tex/latex/skrapport/skrapport.cls @@ -1,7 +1,7 @@ %% This is file `skrapport.cls', generated from `skrapport.tex' (key `class'). -%% chscite Skånings rapportklass +%% skrapport Skånings rapportklass %% -%% Copyright (C) 2012 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% Copyright (C) 2012-2013 by Simon Sigurdhsson <sigurdhsson@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -15,643 +15,1411 @@ %% %% The Current Maintainer of this work is Simon Sigurdhsson. %% -%% This work consists of the file skrapport.tex and the -%% derived files skrapport.cls, skrapport-colortheme-default.sty, -%% skrapport-colortheme-unscathed.sty, skrapport-colortheme-violet.sty -%% and skrapport-colortheme-cruelwater.sty. +%% This work consists of the file skrapport.tex and the derived files: +%% * skrapport.cls +%% * skrapport-colortheme-default.sty +%% * skrapport-colortheme-unscathed.sty +%% * skrapport-colortheme-violet.sty +%% * skrapport-colortheme-cruelwater.sty +%% * skrapport-colortheme-skdoc.sty +%% * skrapport-size-common.sty +%% * skrapport-size10pt.clo +%% * skrapport-size11pt.clo +%% * skrapport-size12pt.clo -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesClass{skrapport}% - [2013/01/09 v0.10a Skånings rapportklass] -\RequirePackage{xparse,xstring} -\RequirePackage{kvoptions} -\SetupKeyvalOptions{family=skrapport,prefix=skrapport@} -\newcommand\@ptsize{} -\IfFileExists{ifxetex.sty}{% - \RequirePackage{ifxetex}% -}{% - \newif\ifxetex\xetexfalse% -} -\DeclareStringOption[a4paper]{paper} -\DeclareVoidOption{a4paper}{\skrapport@SetupPaper} -\DeclareVoidOption{a5paper}{\skrapport@SetupPaper} -\newcommand*{\skrapport@SetupPaper}{\expandafter\@skrapport@SetupPaper\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupPaper}[1]{\setkeys{skrapport}{paper={#1}}} -\DeclareStringOption[11pt]{ptsize} -\DeclareVoidOption{10pt}{\skrapport@SetupPtsize} -\DeclareVoidOption{11pt}{\skrapport@SetupPtsize} -\DeclareVoidOption{12pt}{\skrapport@SetupPtsize} -\newcommand*{\skrapport@SetupPtsize}{\expandafter\@skrapport@SetupPtsize\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupPtsize}[1]{\setkeys{skrapport}{ptsize={#1}}} -\DeclareBoolOption[false]{twocolumn} -\DeclareComplementaryOption{onecolumn}{twocolumn} -\DeclareBoolOption[false]{draft} -\DeclareComplementaryOption{final}{draft} -\DeclareBoolOption[false]{leqno} -\DeclareBoolOption[false]{fleqn} -\DeclareStringOption[rm]{titles} -\DeclareVoidOption{rmtitles}{\skrapport@SetupTitles} -\DeclareVoidOption{bftitles}{\skrapport@SetupTitles} -\DeclareVoidOption{sftitles}{\skrapport@SetupTitles} -\newcommand*{\skrapport@SetupTitles}{\expandafter\@skrapport@SetupTitles\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupTitles}[1]{% - \IfStrEq{#1}{bftitles}{% - \setkeys{skrapport}{titles={bf}}% - }{\IfStrEq{#1}{sftitles}{% - \setkeys{skrapport}{titles={sf}}% +\RequirePackage{expl3,l3keys2e,xparse,xstring,etoolbox} +\ProvidesExplClass{skrapport}% + {2013/06/24}{0.12a}{stylish report document class} +\msg_new:nnnn{skrapport}{option-deprecated}{Option~`#1'~deprecated!} + {Please~use~`#2'~instead.} +\msg_new:nnnn{skrapport}{option-no-effect}{Option~`#1'~deprecated!} + {It~has~no~effect;~simply~use~nothing~instead.} +\msg_new:nnnn{skrapport}{invalid-paper-size}{Invalid~paper~size~`#1'!} + {\token_to_str:N\__skrapport_setup_paper:n~was~invoked~with~an~ + invalid~argument;~paper~size~will~remain~unchanged.} +\msg_new:nnnn{skrapport}{invalid-point-size}{Invalid~point~size~`#1'!} + {\token_to_str:N\__skrapport_setup_ptsize:n~was~invoked~with~an~ + invalid~argument;~cannot~continue~without~setting~a~valid~point~ + size.~Please~fix~the~issue~before~typesetting~again.} +\msg_new:nnnn{skrapport}{invalid-titles}{Invalid~title~type~`#1'!} + {\token_to_str:N\__skrapport_setup_titles:n~was~invoked~with~an~ + invalid~argument;~falling~back~to~`#2'.} +\msg_new:nnnn{skrapport}{invalid-lang}{Invalid~language~`#1'!} + {\token_to_str:N\__skrapport_setup_lang:n~was~invoked~with~an~ + invalid~argument;~`babel'~and/or~`polyglossia'~will~remain~ + unloaded.} +\msg_new:nnnn{skrapport}{invalid-font}{Invalid~font~`#1'!} + {\token_to_str:N\__skrapport_setup_font:n~was~invoked~with~an~ + invalid~argument;~no~font~package~has~been~loaded.~This~may~result~ + in~bad~rendering~due~to~old~Computer~Modern~fonts.} +\msg_new:nnnn{skrapport}{noop-call}{No-op~invokation~of~macro!} + {\token_to_str:N#1~was~invoked,~but~circumstances~dictate~that~the~ + macro~should~do~nothing.~Will~do~\token_to_str:N\prg_do_nothing:~ + instead.} +\msg_new:nnnn{skrapport}{old-font-deprecated}{Deprecated~macro~\token_to_str:N#1!} + {The~old~font~macro~\token_to_str:N#1~is~deprecated!~Use~ + \token_to_str:N#2~instead.} +\msg_new:nnnn{skrapport}{color-patch-failed}{Could~not~patch~macro~\token_to_str:N#1!} + {The~macro~\token_to_str:N#1~could~not~be~patched!~Color~theme~ + support~may~be~incomplete.} +\msg_new:nnnn{skrapport}{license-not-printed}{Detected~\token_to_str:N\license~but~no~`titlepage'!} + {The~text~provided~by~\token_to_str:N\license~is~only~printed~when~ + the~`titlepage'~environment~is~used,~but~it~seems~to~be~missing.} +\msg_new:nnnn{skrapport}{font-requires-xetex}{The~`font=#1'~option~requires~XeTeX~or~luaTeX!} + {Please~choose~another~font~setup~or~compile~the~document~with~ + either~xelatex~or~lualatex.} +\msg_new:nnnn{skrapport}{tocdepth-too-deep}{TOC~depth~is~too~deep!} + {The~current~tocdepth,~#1,~is~not~supported.~Please~redefine~the~ + \token_to_str:N#2~macro~to~enable~support.} +\msg_new:nnn{skrapport}{not-implemented} + {Unimplemented~macro~\token_to_str:N#1!} +\bool_new:N\g__skrapport_draft_bool +\bool_new:N\g__skrapport_color_bool +\bool_new:N\g__skrapport_has_polyglossia_bool +\int_new:N\g__skrapport_grid_lines_int +\cs_new:Npn\__skrapport_setup_paper:n#1{ + \str_case:nnn{#1}{ + {a4}{ + \PassOptionsToPackage{paper=A4}{typearea} + \int_gset:Nn\g__skrapport_grid_lines_int{40} + } + {a5}{ + \PassOptionsToPackage{paper=A5}{typearea} + \int_gset:Nn\g__skrapport_grid_lines_int{28} + } }{ - \setkeys{skrapport}{titles={rm}}% - }}} -\DeclareBoolOption[false]{eng} -\DeclareComplementaryOption{swe}{eng} -\DeclareStringOption[kpfonts]{font} -\DeclareVoidOption{kpfonts}{\skrapport@SetupFont} -\DeclareVoidOption{lmodern}{\skrapport@SetupFont} -\DeclareVoidOption{palatino}{\skrapport@SetupFont} -\DeclareVoidOption{nofont}{\skrapport@SetupFont} -\newcommand*{\skrapport@SetupFont}{\expandafter\@skrapport@SetupFont\expandafter{\CurrentOption}} -\newcommand*{\@skrapport@SetupFont}[1]{\setkeys{skrapport}{font={#1}}} -\DeclareBoolOption[false]{indent} -\DeclareComplementaryOption{noindent}{indent} -\DeclareBoolOption[true]{color} -\DeclareComplementaryOption{nocolor}{color} -\DeclareBoolOption[true]{math} -\DeclareComplementaryOption{nomath}{math} -\ProcessKeyvalOptions* -\IfStrEq{\skrapport@paper}{a4paper}{% - \RequirePackage[a4paper]{geometry} - \setlength\paperheight {297mm} - \setlength\paperwidth {210mm} -}{\IfStrEq{\skrapport@paper}{a5paper}{% - \RequirePackage[a5paper]{geometry} - \setlength\paperheight {210mm} - \setlength\paperwidth {148mm} -}{% - \ClassError{skrapport}{% - Option `paper' has unknown value `\skrapport@paper'! - }{} -}} -\IfStrEq{\skrapport@ptsize}{10pt}{% - \renewcommand\@ptsize{0} -}{% - \IfStrEq{\skrapport@ptsize}{11pt}{% - \renewcommand\@ptsize{1} - }{% - \IfStrEq{\skrapport@ptsize}{12pt}{% - \renewcommand\@ptsize{2} - }{% - \ClassError{skrapport}{% - Option `ptsize' has unknown value `\skrapport@ptsize'! - }{} - } - } -} -\ifskrapport@draft - \setlength\overfullrule{5pt} -\else - \setlength\overfullrule{0pt} -\fi -\ifskrapport@leqno\input{leqno.clo}\fi -\ifskrapport@fleqn\input{fleqn.clo}\fi -\IfStrEq{\skrapport@titles}{bf}{% - \let\@titstyle\bfseries% -}{\IfStrEq{\skrapport@titles}{sf}{% - \let\@titstyle\sffamily\bfseries% -}{% - \let\@titstyle\relax% -}} -\ifxetex - \RequirePackage[quiet]{fontspec} - \DeclareRobustCommand\nobreakspace{\leavevmode\nobreak\space} -\else - \RequirePackage[T1]{fontenc} -\fi -\ifskrapport@color + \msg_warning:nnn{skrapport}{invalid-paper-size}{#1} + } + \AtEndOfClass{\RequirePackage[DIV=calc]{typearea}} + \AtBeginDocument{\recalctypearea} +} +\cs_new:Npn\__skrapport_setup_ptsize:n#1{ + \str_case:nnn{#1}{ + {10pt}{\token_new:Nn\c__skrapport_ptsize_token{0}} + {11pt}{\token_new:Nn\c__skrapport_ptsize_token{1}} + {12pt}{\token_new:Nn\c__skrapport_ptsize_token{2}} + }{ + \msg_critical:nnn{skrapport}{invalid-point-size}{#1} + } + \file_input:n{skrapport-size#1.clo} +} +\cs_new:Nn\__skrapport_setup_twocolumn:{ \RequirePackage{etoolbox} - \RequirePackage{xcolor} -\fi -\IfStrEq{\skrapport@font}{nofont}{}{% - \IfStrEq{\skrapport@font}{kpfonts}{% - \RequirePackage[easyscsl,intlimits,sumlimits]{kpfonts} - }{% - \IfStrEq{\skrapport@font}{palatino}{% - \IfFileExists{tgpagella.sty}{% + \AtBeginDocument{ + \KOMAoptions{twocolumn=true} + } + \int_set:Nn\l_tmpa_int{1\c__skrapport_ptsize_token} + \int_set:Nn\l_tmpb_int{1.2*\l_tmpa_int} + \RequirePackage[fontsize=\l_tmpa_int pt, + baseline=\l_tmpb_int pt, + lines=\g__skrapport_grid_lines_int]{grid} + \RenewDocumentEnvironment{abstract}{}{\section*{\abstractname}}{} + \AfterEndPreamble{\begin{multicols}{2}} + \AtEndDocument{\end{multicols}} + \pretocmd{\maketitle}{\end{multicols}}{}{} + \apptocmd{\maketitle}{\begin{multicols}{2}}{}{} + \BeforeBeginEnvironment{equation}{\begin{gridenv}} + \AfterEndEnvironment{equation}{\end{gridenv}} + \BeforeBeginEnvironment{equation*}{\begin{gridenv}} + \AfterEndEnvironment{equation*}{\end{gridenv}} + \BeforeBeginEnvironment{multline}{\begin{gridenv}} + \AfterEndEnvironment{multline}{\end{gridenv}} + \BeforeBeginEnvironment{multline*}{\begin{gridenv}} + \AfterEndEnvironment{multline*}{\end{gridenv}} + \BeforeBeginEnvironment{gather}{\begin{gridenv}} + \AfterEndEnvironment{gather}{\end{gridenv}} + \BeforeBeginEnvironment{gather*}{\begin{gridenv}} + \AfterEndEnvironment{gather*}{\end{gridenv}} + \BeforeBeginEnvironment{align}{\begin{gridenv}} + \AfterEndEnvironment{align}{\end{gridenv}} + \BeforeBeginEnvironment{align*}{\begin{gridenv}} + \AfterEndEnvironment{align*}{\end{gridenv}} + \BeforeBeginEnvironment{flalign}{\begin{gridenv}} + \AfterEndEnvironment{flalign}{\end{gridenv}} + \BeforeBeginEnvironment{flalign*}{\begin{gridenv}} + \AfterEndEnvironment{flalign*}{\end{gridenv}} + \BeforeBeginEnvironment{alignat}{\begin{gridenv}} + \AfterEndEnvironment{alignat}{\end{gridenv}} + \BeforeBeginEnvironment{alignat*}{\begin{gridenv}} + \AfterEndEnvironment{alignat*}{\end{gridenv}} + \cs_set_eq:Nc\__skrapport_old_figurest:{figure*} + \cs_set_eq:Nc\__skrapport_old_endfigurest:{endfigure*} + \RenewDocumentEnvironment{figure}{o}{ + \begin{gridenv} + \vspace{\intextsep} + \begin{minipage}{\linewidth} + \cs_set:Nn\@captype{figure} + }{ + \end{minipage} + \vspace{\intextsep} + \end{gridenv} + } + \RenewDocumentEnvironment{figure*}{o}{ + \begin{onecol} + \__skrapport_old_figurest: + }{ + \__skrapport_old_endfigurest: + \end{onecol} + } + \cs_set_eq:Nc\__skrapport_old_tablest:{table*} + \cs_set_eq:Nc\__skrapport_old_endtablest:{endtable*} + \RenewDocumentEnvironment{table}{o}{% + \begin{gridenv} + \vspace{\intextsep} + \begin{minipage}{\linewidth} + \cs_set:Nn\@captype{table} + \cs_set_eq:NN\__skrapport_old_caption:\caption + \RenewDocumentCommand{\caption}{om}{% + \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip + \skip_set_eq:NN\abovecaptionskip\belowcaptionskip + \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip + \vspace{\abovecaptionskip} + \__skrapport_old_caption:[##1]{##2} + \vspace{\belowcaptionskip} + } + }{ + \end{minipage} + \vspace{\intextsep} + \end{gridenv} + } + \cs_set_eq:NN\__skrapport_old_tablest:\__skrapport_old_old_tablest: + \cs_set:Nn\__skrapport_old_tablest:{ + \__skrapport_old_old_tablest: + \cs_set_eq:NN\__skrapport_old_caption:\caption + \RenewDocumentCommand{\caption}{om}{% + \skip_set_eq:NN\l_tmpa_skip\abovecaptionskip + \skip_set_eq:NN\abovecaptionskip\belowcaptionskip + \skip_set_eq:NN\belowcaptionskip\l_tmpa_skip + \vspace{\abovecaptionskip} + \__skrapport_old_caption:[##1]{##2} + \vspace{\belowcaptionskip} + } + } + \RenewDocumentEnvironment{table*}{o}{ + \begin{onecol} + \__skrapport_old_tablest: + }{ + \__skrapport_old_endtablest: + \end{onecol} + } + \DeclareDocumentEnvironment{onecol}{ + \end{onecol} + \end{multicols} + \group_begin: + \cs_set:Nn\endonecol{ + \group_end: + \begin{multicols}{2} + \cs_set_eq:NN\__skrapport_old_onecol:\onecol + \cs_set:Nn\onecol{ + \cs_set_eq:NN\onecol\__skrapport_old_onecol: + } + \begin{onecol} + } + \cs_set:Nn\onecol{} + \begin{onecol} + }{} +} +\cs_new:Nn\__skrapport_setup_leqno:{ + \RenewDocumentCommand\@eqnnum{}{ + \hbox_to_wd:nn{.01pt}{} + \hbox_overlap_right:n{ + \normalfont\normalcolor + \skip_horizontal:n{-\displaywidth} + (\theequation) + } + } +} +\cs_new:Nn\__skrapport_setup_fleqn:{ + \file_input:n{fleqn.clo} +} +\cs_new:Npn\__skrapport_setup_titles:n#1{ + \str_case:nnn{#1}{ + {rm}{\cs_new_protected:Nn\__skrapport_title_style:{\rmfamily}} + {bf}{\cs_new_protected:Nn\__skrapport_title_style:{\bfseries}} + {sf}{\cs_new_protected:Nn\__skrapport_title_style:{\sffamily}} + }{ + \msg_info:nnnn{skrapport}{invalid-titles}{#1}{rm} + \__skrapport_setup_titles:n{rm} + } +} +\cs_new:Npn\__skrapport_setup_lang:n#1{ + \str_case:nnn{#1}{ + {sv}{ + \bool_if:NTF\g__skrapport_has_polyglossia_bool{ + \setmainlanguage{swedish} + \setotherlanguage[variant=british]{english} + }{ + \RequirePackage[british,swedish]{babel} + } + \cs_gset:Nn\__skrapport_and_word:{och} + \cs_gset:Nn\__skrapport_Email_word:{E-post} + \cs_gset:Nn\__skrapport_Comment_word:{Kommentar} + \cs_gset:Npn\contentsname{Innehåll} + \cs_gset:Npn\refname{Referenser} + \cs_gset:Npn\figurename{Figur} + \cs_gset:Npn\tablename{Tabell} + \cs_gset:Npn\appendixname{Bilaga} + \cs_gset:Npn\abstractname{Sammanfattning} + \cs_gset:Npn\today + {\int_use:N\year--\int_use:N\month--\int_use:N\day} + \cs_gset:Nn\__skrapport_RFC_language:{swe} + \PassOptionsToPackage{iso,swedish}{isodate} + } + {en}{ + \bool_if:NTF\g__skrapport_has_polyglossia_bool{ + \setmainlanguage[variant=british]{english} + \setotherlanguage{swedish} + }{ + \RequirePackage[swedish,british]{babel} + } + \cs_gset:Nn\__skrapport_and_word:{and} + \cs_gset:Nn\__skrapport_Email_word:{Email} + \cs_gset:Nn\__skrapport_Comment_word:{Comment} + \cs_gset:Npn\contentsname{Contents} + \cs_gset:Npn\refname{References} + \cs_gset:Npn\figurename{Figurr} + \cs_gset:Npn\tablename{Table} + \cs_gset:Npn\appendixname{Appendix} + \cs_gset:Npn\abstractname{Abstract} + \cs_gset:Npn\today + {\int_use:N\year--\int_use:N\month--\int_use:N\day} + \cs_gset:Nn\__skrapport_RFC_language:{eng} + \PassOptionsToPackage{iso,british}{isodate} + } + }{ + \msg_info:nnn{skrapport}{invalid-lang}{#1} + } +} +\cs_new:Npn\__skrapport_setup_font:n#1{ + \PassOptionsToPackage{intlimits}{amsmath} + \PassOptionsToPackage{full}{textcomp} + \str_case:nnn{#1}{ + {none}{ + \bool_if:nT{\luatex_if_engine_p: || \xetex_if_engine_p:}{ + \RequirePackage[quiet]{fontspec} + } + } + {kpfonts}{ + \RequirePackage[easyscsl,intlimits,sumlimits]{kpfonts} + } + {lmodern}{ + \RequirePackage{lmodern} + } + {palatino}{ + \file_if_exist:nTF{tgpagella.sty}{ + \RequirePackage{arev} + \RequirePackage{pxfonts} \RequirePackage{tgpagella} - }{% - \RequirePackage[sc]{mathpazo} + }{ + \RequirePackage[osf]{mathpazo} } - }{% - \IfStrEq{\skrapport@font}{lmodern}{% - \RequirePackage{lmodern} - }{% - \ClassError{skrapport}{% - Option `font' has unknown value `\skrapport@font'! - }{} + } + {minion}{ + \AtEndOfClass{ + \cs_set_eq:NN\__skrapport_old_vec:\vec + \cs_undefine:N\vec + \RequirePackage{MyriadPro} + \RequirePackage{MinionPro} + \RequirePackage{MnSymbol} + \cs_set_eq:NN\vec\__skrapport_old_vec: + } + } + {skdoc}{ + \RequirePackage{PTSerif} + \RequirePackage[defaultsans,osfigures,scale=0.95]{opensans} + } + {word}{ + \bool_if:nF{\luatex_if_engine_p: || \xetex_if_engine_p:}{ + \msg_fatal:nnn{skrapport}{font-requires-xetex}{word} + } + \RequirePackage[quiet]{fontspec} + \setmainfont[Ligatures=TeX]{Cambria} + \setsansfont[Ligatures=TeX]{Calibri} + \setmonofont[Scale=0.95]{Consolas} + \apptocmd{\__skrapport_after_ams_hook:}{ + \setmathfont{Cambria Math} + }{}{} + } + }{ + \msg_warning:nnn{skrapport}{invalid-font}{#1} + } + \str_if_eq:nnF{#1}{none}{ + \str_if_eq:nnF{#1}{kpfonts}{ + \str_if_eq:nnF{#1}{word}{ + \RequirePackage[scaled=1.03]{inconsolata} + } + \AtEndOfClass{ + \RequirePackage{amsmath} + \str_if_eq:nnF{#1}{minion}{ + \RequirePackage{amssymb} + } + \RequirePackage{textcomp} } } } } -\ifxetex - \RequirePackage{xkeyval} - \RequirePackage{polyglossia} - \ifskrapport@eng - \setmainlanguage[variant=british]{english} - \setotherlanguage{swedish} - \else - \setmainlanguage{swedish} - \setotherlanguage[variant=british]{english} - \fi -\else - \ifskrapport@eng - \RequirePackage[swedish,british]{babel} - \else - \RequirePackage[british,swedish]{babel} - \fi -\fi -\ifskrapport@twocolumn - \RequirePackage{etoolbox} - \RequirePackage{multicol} -\fi -\RequirePackage{calc} +\cs_new:Nn\__skrapport_setup_parskip:{ + \AtEndOfClass{ + \skip_gset:Nn\parskip{0.5\baselineskip~plus~2pt} + \dim_gzero:N\parindent + \skip_gset:Nn\parfillskip{30pt~plus~1fil} + \cs_gset:Npn\@listI{ + \dim_set_eq:NN\leftmargin\leftmargini + \dim_set_eq:NN\parsep\parskip + \dim_zero:N\topsep + \dim_zero:N\itemsep + } + \cs_gset_eq:NN\@listi\@listI + \dim_gset_eq:NN\leftmargin\leftmargini + \dim_gset_eq:NN\parsep\parskip + \dim_gzero:N\topsep + \dim_gzero:N\itemsep + \cs_gset:Npn\@listii{ + \dim_set_eq:NN\leftmargin\leftmarginii + \dim_set_eq:NN\labelwidth\leftmarginii + \dim_set_eq:NN\parsep\parskip + \dim_sub:Nn\labelwidth{-\labelsep} + \dim_zero:N\topsep + \dim_zero:N\itemsep + } + \cs_gset:Npn\@listiii{ + \dim_set_eq:NN\leftmargin\leftmarginiii + \dim_set_eq:NN\labelwidth\leftmarginiii + \dim_set_eq:NN\parsep\parskip + \dim_sub:Nn\labelwidth{-\labelsep} + \dim_zero:N\topsep + \dim_zero:N\itemsep + } + \dim_gzero:N\partopsep + \RenewDocumentCommand\@starttoc{m}{ + \group_begin: + \dim_zero:N\parskip + \file_if_exist:nT{\c_job_name_tl.##1}{ + \file_input:n{\c_job_name_tl.##1} + } + \if@filesw + \iow_new:c{tf@##1} + \iow_open:cn{tf@##1}{\c_job_name_tl.##1} + \fi + \@nobreakfalse + \group_end: + } + } +} +\cs_new:Nn\__skrapport_setup_math:{ + \file_if_exist:nT{skmath.sty}{\RequirePackage{skmath}} +} +\cs_new:Nn\__skrapport_setup_draft:{ + \bool_if:NTF\g__skrapport_draft_bool{ + \dim_gset:Nn\overfullrule{5pt} + }{ + \msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_draft:} + \prg_do_nothing: + } +} +\cs_new:Nn\__skrapport_setup_color:{ + \bool_if:NTF\g__skrapport_color_bool{ + \RequirePackage{xcolor} + \PassOptionsToPackage{ + labelfont+={bf,color=skrapport@captioncolor} + }{caption} + }{ + \msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_color:} + \prg_do_nothing: + } +} +\cs_new:Npn\__skrapport_setup_color:n#1{ + \__skrapport_setup_color: + \bool_if:NTF\g__skrapport_color_bool{ + \AtBeginDocument{\colortheme{#1}} + }{ + \msg_log:nnn{skrapport}{noop-call}{\__skrapport_setup_color:n} + \prg_do_nothing: + } +} +\cs_new:Nn\__skrapport_setup_xelatex:{ + \AtEndOfClass{ + \cs_undefine:N\dblcolon + \cs_undefine:N\coloneqq + \cs_undefine:N\Coloneqq + \cs_undefine:N\eqqcolon + \RequirePackage{unicode-math} + \unimathsetup { + math-style = ISO, + bold-style = ISO, + sans-style = italic, + nabla = upright, + partial = italic, + vargreek-shape = unicode + } + } + \DeclareDocumentCommand\nobreakspace{}{\leavevmode\nobreak\space} + \xetex_if_engine:TF{ + \RequirePackage{polyglossia} + \bool_gset_true:N\g__skrapport_has_polyglossia_bool + }{ + \bool_gset_false:N\g__skrapport_has_polyglossia_bool + } +} +\cs_new:Nn\__skrapport_setup_pdftex:{ + \RequirePackage[T1]{fontenc} + \bool_gset_false:N\g__skrapport_has_polyglossia_bool +} +\cs_new:Nn\__skrapport_setup_engine_specific:{ + \bool_if:nTF{\luatex_if_engine_p: || \xetex_if_engine_p:}{ + \__skrapport_setup_xelatex: + }{ + \__skrapport_setup_pdftex: + } +} +\cs_generate_variant:Nn\__skrapport_setup_ptsize:n{ x } +\cs_generate_variant:Nn\__skrapport_setup_titles:n{ x } +\cs_generate_variant:Nn\__skrapport_setup_lang:n{ x } +\cs_generate_variant:Nn\__skrapport_setup_font:n{ x } +\keys_define:nn{skrapport}{ + paper .choice:, + paper / a4 .code:n = + {\__skrapport_setup_paper:n{a4}}, + paper / a5 .code:n = + {\__skrapport_setup_paper:n{a5}}, + paper / a4paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {paper=a4paper}{paper=a4} + \keys_set:nn{skrapport}{paper=a4}}, + paper / a5paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {paper=a5paper}{paper=a5} + \keys_set:nn{skrapport}{paper=a4}}, + paper .value_required:, + a4paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {a4paper}{paper=a4} + \keys_set:nn{skrapport}{paper=a4}}, + a5paper .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {a5paper}{paper=a5} + \keys_set:nn{skrapport}{paper=a5}}, + ptsize .choices:nn = + { 10pt, 11pt, 12pt } + {\__skrapport_setup_ptsize:x{\tl_use:N\l_keys_choice_tl}}, + ptsize .value_required:, + 10pt .meta:n = {ptsize=10pt}, + 11pt .meta:n = {ptsize=11pt}, + 12pt .meta:n = {ptsize=12pt}, + twocolumn .code:n = + {\AtEndOfClass{\__skrapport_setup_twocolumn:}}, + onecolumn .code:n = + {\msg_warning:nnn{skrapport}{option-no-effect}{onecolumn}}, + draft .choice:, + draft / true .code:n = + {\bool_gset_true:N\g__skrapport_draft_bool + \__skrapport_setup_draft:}, + draft / false .code:n = + {\bool_gset_false:N\g__skrapport_draft_bool}, + draft .default:n = true, + final .code:n = {\prg_do_nothing:}, + leqno .code:n = + {\__skrapport_setup_leqno:}, + fleqn .code:n = + {\__skrapport_setup_fleqn:}, + titles .choices:nn = + { rm, bf, sf } + {\__skrapport_setup_titles:x{\tl_use:N\l_keys_choice_tl}}, + titles .value_required:, + rmtitles .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {rmtitles}{titles=rm} + \keys_set:nn{skrapport}{titles=rm}}, + bftitles .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {bftitles}{titles=bf} + \keys_set:nn{skrapport}{titles=bf}}, + sftitles .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {sftitles}{titles=sf} + \keys_set:nn{skrapport}{titles=sf}}, + lang .choices:nn = + { sv, en } + {\__skrapport_setup_lang:x{\tl_use:N\l_keys_choice_tl}}, + lang .value_required:, + swe .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {swe}{lang=sv} + \keys_set:nn{skrapport}{lang=sv}}, + eng .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {eng}{lang=en} + \keys_set:nn{skrapport}{lang=en}}, + font .choices:nn = + { none, kpfonts, lmodern, palatino, minion, skdoc, word } + {\__skrapport_setup_font:x{\tl_use:N\l_keys_choice_tl}}, + font .value_required:, + nofont .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {nofont}{font=none} + \keys_set:nn{skrapport}{font=none}}, + kpfonts .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {kpfonts}{font=kpfonts} + \keys_set:nn{skrapport}{font=kpfonts}}, + lmodern .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {lmodern}{font=lmodern} + \keys_set:nn{skrapport}{font=lmodern}}, + palatino .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {palatino}{font=palatino} + \keys_set:nn{skrapport}{font=palatino}}, + minion .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {minion}{font=minion} + \keys_set:nn{skrapport}{font=minion}}, + skdoc .code:n = + {\msg_warning:nnnn{skrapport}{option-deprecated} + {skdoc}{font=skdoc} + \keys_set:nn{skrapport}{font=skdoc}}, + indent .choice:, + indent / true .code:n = {\prg_do_nothing:}, + indent / false .code:n = {\__skrapport_setup_parskip:}, + indent .default:n = true, + noindent .code:n = + {\msg_warning:nnn{skrapport}{option-no-effect}{noindent}}, + color .code:n = + {\str_if_eq:nnTF{#1}{false} + {\bool_gset_false:N\g__skrapport_color_bool} + {\bool_gset_true:N\g__skrapport_color_bool + \str_if_eq:nnTF{#1}{true} + {\__skrapport_setup_color:n{default}} + {\__skrapport_setup_color:n{#1}}}}, + color .default:n = true, + nocolor .meta:n = {color=false}, + nomath .choice:, + nomath / false .code:n = {\__skrapport_setup_math:}, + nomath / true .code:n = {\prg_do_nothing:}, + nomath .default:n = true, + math .code:n = + {\msg_warning:nnn{skrapport}{option-no-effect}{math}}, +} +\cs_new:Nn\__skrapport_setup_defaults:{ + \bool_new:N\l__skrapport_has_option_indent_bool + \bool_new:N\l__skrapport_has_option_nomath_bool + \bool_new:N\l__skrapport_has_option_color_bool + \bool_new:N\l__skrapport_has_option_font_bool + \bool_new:N\l__skrapport_has_option_lang_bool + \bool_new:N\l__skrapport_has_option_titles_bool + \bool_new:N\l__skrapport_has_option_draft_bool + \bool_new:N\l__skrapport_has_option_ptsize_bool + \bool_new:N\l__skrapport_has_option_paper_bool + \keys_define:nn{skrapport-default}{ + indent .code:n = + {\bool_set_true:N\l__skrapport_has_option_indent_bool}, + nomath .code:n = + {\bool_set_true:N\l__skrapport_has_option_nomath_bool}, + color .code:n = + {\bool_set_true:N\l__skrapport_has_option_color_bool}, + font .code:n = + {\bool_set_true:N\l__skrapport_has_option_font_bool}, + lang .code:n = + {\bool_set_true:N\l__skrapport_has_option_lang_bool}, + titles .code:n = + {\bool_set_true:N\l__skrapport_has_option_titles_bool}, + draft .code:n = + {\bool_set_true:N\l__skrapport_has_option_draft_bool}, + ptsize .code:n = + {\bool_set_true:N\l__skrapport_has_option_ptsize_bool}, + paper .code:n = + {\bool_set_true:N\l__skrapport_has_option_paper_bool}, + nofont .code:n = {\keys_set:nn{skrapport-default}{font}}, + kpfonts .code:n = {\keys_set:nn{skrapport-default}{font}}, + lmodern .code:n = {\keys_set:nn{skrapport-default}{font}}, + palatino .code:n = {\keys_set:nn{skrapport-default}{font}}, + minion .code:n = {\keys_set:nn{skrapport-default}{font}}, + skdoc .code:n = {\keys_set:nn{skrapport-default}{font}}, + swe .code:n = {\keys_set:nn{skrapport-default}{lang}}, + eng .code:n = {\keys_set:nn{skrapport-default}{lang}}, + rmtitles .code:n = {\keys_set:nn{skrapport-default}{titles}}, + bftitles .code:n = {\keys_set:nn{skrapport-default}{titles}}, + sftitles .code:n = {\keys_set:nn{skrapport-default}{titles}}, + 10pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}}, + 11pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}}, + 12pt .code:n = {\keys_set:nn{skrapport-default}{ptsize}}, + a4paper .code:n = {\keys_set:nn{skrapport-default}{paper}}, + a5paper .code:n = {\keys_set:nn{skrapport-default}{paper}}, + } + \ProcessKeysOptions{skrapport-default} + \bool_if:NF\l__skrapport_has_option_indent_bool{ + \keys_set:nn{skrapport}{indent=false} + } + \bool_if:NF\l__skrapport_has_option_nomath_bool{ + \keys_set:nn{skrapport}{nomath=false} + } + \bool_if:NF\l__skrapport_has_option_color_bool{ + \keys_set:nn{skrapport}{color=true} + } + \bool_if:NF\l__skrapport_has_option_font_bool{ + \xetex_if_engine:TF{ + \keys_set:nn{skrapport}{font=word} + }{ + \keys_set:nn{skrapport}{font=kpfonts} + } + } + \bool_if:NF\l__skrapport_has_option_lang_bool{ + \keys_set:nn{skrapport}{lang=sv} + } + \bool_if:NF\l__skrapport_has_option_titles_bool{ + \keys_set:nn{skrapport}{titles=bf} + } + \bool_if:NF\l__skrapport_has_option_draft_bool{ + \keys_set:nn{skrapport}{draft=false} + } + \bool_if:NF\l__skrapport_has_option_ptsize_bool{ + \keys_set:nn{skrapport}{ptsize=11pt} + } + \bool_if:NF\l__skrapport_has_option_paper_bool{ + \keys_set:nn{skrapport}{paper=a4} + } +} +\cs_set_eq:NN\__skrapport_tmpa_cs:\@classoptionslist +\RequirePackage{xkeyval} +\cs_set_eq:NN\__skrapport_tmpb_cs:\@classoptionslist +\cs_set_eq:NN\@classoptionslist\__skrapport_tmpa_cs: +\__skrapport_setup_engine_specific: +\ProcessKeysOptions{skrapport} +\__skrapport_setup_defaults: +\cs_set_eq:NN\@classoptionslist\__skrapport_tmpb_cs: +\cs_undefine:N\__skrapport_tmpa_cs: +\cs_undefine:N\__skrapport_tmpb_cs: +\RequirePackage{calc,isodate,multicol} \AtEndOfClass{ \RequirePackage{microtype} \RequirePackage{icomma} - \IfStrEq{\skrapport@font}{kpfonts}{}{\RequirePackage[intlimits]{amsmath}} - \let\Finv\relax - \let\Game\relax - \let\beth\relax - \let\gimel\relax - \let\daleth\relax - \IfStrEq{\skrapport@font}{kpfonts}{}{\RequirePackage{amssymb}} - \IfStrEq{\skrapport@font}{kpfonts}{}{\RequirePackage{textcomp}} - \ifskrapport@math\IfFileExists{skmath.sty}{\RequirePackage{skmath}}{}\fi } \AtBeginDocument{ - \@ifundefined{urlstyle}{}{\urlstyle{same}} -} -\input{size1\@ptsize.clo} -\addtolength\textwidth{0.5\oddsidemargin} -\addtolength\textwidth{0.5\evensidemargin} -\addtolength\oddsidemargin{-0.5\oddsidemargin} -\addtolength\evensidemargin{-0.5\evensidemargin} -\setlength\lineskip{1\p@} -\setlength\normallineskip{1\p@} -\renewcommand\baselinestretch{} -\ifskrapport@indent\else - \setlength\parskip{0.5\baselineskip \@plus 2pt} - \parindent=\z@ - \setlength\parfillskip{30\p@ \@plus 1fil} - \def\@listI{\leftmargin\leftmargini - \topsep\z@ \parsep\parskip \itemsep\z@} - \let\@listi\@listI - \@listi - \def\@listii{\leftmargin\leftmarginii - \labelwidth\leftmarginii\advance\labelwidth-\labelsep - \topsep\z@ \parsep\parskip \itemsep\z@} - \def\@listiii{\leftmargin\leftmarginiii - \labelwidth\leftmarginiii\advance\labelwidth-\labelsep - \topsep\z@ \parsep\parskip \itemsep\z@} - \partopsep=\z@ - \@ifundefined{CheckCommand}{}{% - \CheckCommand*{\@starttoc}[1]{% - \begingroup - \makeatletter - \@input{\jobname.#1}% - \if@filesw - \expandafter\newwrite\csname tf@#1\endcsname - \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax - \fi - \@nobreakfalse - \endgroup}} - \renewcommand*{\@starttoc}[1]{% - \begingroup - \makeatletter - \parskip\z@ - \@input{\jobname.#1}% - \if@filesw - \expandafter\newwrite\csname tf@#1\endcsname - \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax - \fi - \@nobreakfalse - \endgroup} -\fi -\frenchspacing -\@lowpenalty 51 -\@medpenalty 151 -\@highpenalty 301 + \cs_if_exist:NT\urlstyle{\urlstyle{same}} +} +\cs_new:Npn\dim_set_to_wd:Nn#1#2{ + \hbox_set:Nn\l_tmpa_box{#2} + \dim_set:Nn#1{\box_wd:N\l_tmpa_box} + \box_clear:N\l_tmpa_box +} +\dim_add:Nn\textwidth{0.5\oddsidemargin} +\dim_add:Nn\textwidth{0.5\evensidemargin} +\dim_add:Nn\oddsidemargin{-0.5\oddsidemargin} +\dim_add:Nn\evensidemargin{-0.5\evensidemargin} +\dim_gset:Nn\lineskip{1pt} +\dim_gset:Nn\normallineskip{1pt} +\cs_set:Npn\baselinestretch{} +\int_gset:Nn\@lowpenalty {51} +\int_gset:Nn\@medpenalty {151} +\int_gset:Nn\@highpenalty{301} \setcounter{topnumber}{2} \setcounter{bottomnumber}{1} \setcounter{totalnumber}{4} \setcounter{dbltopnumber}{2} -\renewcommand\topfraction{.75} -\renewcommand\bottomfraction{.5} -\renewcommand\textfraction{.25} -\renewcommand\floatpagefraction{.625} -\renewcommand\dbltopfraction{.75} -\renewcommand\dblfloatpagefraction{.625} -\ProvideDocumentCommand\skrapport@email{m}{\texttt{#1}} +\RenewDocumentCommand\topfraction{}{.75} +\RenewDocumentCommand\bottomfraction{}{.5} +\RenewDocumentCommand\textfraction{}{.25} +\RenewDocumentCommand\floatpagefraction{}{.625} +\RenewDocumentCommand\dbltopfraction{}{.75} +\RenewDocumentCommand\dblfloatpagefraction{}{.625} +\tl_new:N\g__skrapport_title_tl +\DeclareDocumentCommand\title{m}{ + \tl_gset:Nn\g__skrapport_title_tl{#1} +} +\tl_new:N\g__skrapport_date_tl +\tl_gset:Nn\g__skrapport_date_tl{\today} +\DeclareDocumentCommand\date{m}{ + \str_if_eq:nnTF{#1}{today}{ + \tl_gset:Nn\g__skrapport_date_tl{\today} + }{ + \if_meaning:w \today #1 + \tl_gset:Nn\g__skrapport_date_tl{\today} + \else: + \tl_gset:Nn\g__skrapport_date_tl{\printdate{#1}} + \fi: + } +} +\cs_new_nopar:Npn\__skrapport_email:n#1{ + \texttt{#1} +} \AtBeginDocument{ - \@ifpackageloaded{hyperref}{% - \DeclareDocumentCommand\skrapport@email{m}{% - \href{mailto:#1}{\nolinkurl{#1}}% - }% - }{}% + \cs_if_exist:NT\href{ + \cs_gset_nopar:Npn\__skrapport_email:n#1{ + \href{mailto:#1}{\nolinkurl{#1}} + } + } } -\def\@author{\relax} +\clist_new:N\g__skrapport_author_clist +\clist_new:N\g__skrapport_email_clist \DeclareDocumentCommand\author{om}{% - \def\skrapport@tempi{#2\IfNoValueTF{#1}{}{~$\langle$\skrapport@email{#1}$\rangle$}} - \if\@author\relax - \xdef\@author{\skrapport@tempi} - \else - \expandafter\gdef\expandafter\@author\expandafter{\@author\\[0.5ex]\skrapport@tempi} - \fi + \clist_gput_right:Nn\g__skrapport_author_clist{#2} + \clist_gput_right:Nn\g__skrapport_email_clist + {\IfNoValueTF{#1}{\textemdash}{#1}} +} +\cs_new:Nn\__skrapport_author_list:{ + \clist_use:Nnnn\g__skrapport_author_clist + {~\__skrapport_and_word:{}~}{,~}{~\__skrapport_and_word:{}~} +} +\cs_new:Nn\__skrapport_email_list:{ + \int_compare:nT{\clist_count:N\g__skrapport_author_clist>\c_zero}{ + \clist_use:Nnnn\g__skrapport_email_clist{\\}{\\}{\\} + } +} +\tl_new:N\g__skrapport_regarding_tl +\DeclareDocumentCommand\regarding{m}{ + \tl_gset:Nn\g__skrapport_regarding_tl{#1} +} +\bool_new:N\g__skrapport_copyright_unprinted_bool +\AtEndDocument{ + \bool_if:NT\g__skrapport_copyright_unprinted_bool + {\msg_warning:nn{skrapport}{license-not-printed}} +} +\tl_new:N\g__skrapport_copyright_tl +\DeclareDocumentCommand\license{m}{ + \tl_gset:Nn\g__skrapport_copyright_tl{#1} + \bool_gset_true:N\g__skrapport_copyright_unprinted_bool +} +\keys_define:nn{skrapport/maketitle}{ + hide .clist_set:N = \l__skrapport_maketitle_hide_clist, + hide .value_required:, + nopdfinfo .bool_set_inverse:N = \l__skrapport_maketitle_pdfinfo_bool, + nopdfinfo .default:n = true +} +\cs_new_protected:Nn\__skrapport_smallprint_style:{} +\cs_new_protected:Nn\__skrapport_abstract_style: + {\__skrapport_title_style:} +\DeclareDocumentCommand\maketitle{o}{ + \clist_clear:N\l__skrapport_maketitle_hide_clist + \bool_new:N\l__skrapport_maketitle_pdfinfo_bool + \bool_set_true:N\l__skrapport_maketitle_pdfinfo_bool + \IfNoValueF{#1}{\keys_set:nn{skrapport/maketitle}{#1}} + \bool_if:NT\l__skrapport_maketitle_pdfinfo_bool{ + \exp_args:NNx\cs_if_exist_use:NT\hypersetup{{ + pdfinfo={ + Title={\tl_use:N\g__skrapport_title_tl}, + Subject={\tl_use:N\g__skrapport_regarding_tl}, + Author={ + \clist_use:Nnnn\g__skrapport_author_clist{,~}{,~}{,~} + }, + Lang={\__skrapport_RFC_language:} + } + }} + } + \par + \group_begin: + \RenewDocumentCommand\thefootnote{}{ + \fnsymbol{footnote} + } + \RenewDocumentCommand\@makefnmark{}{ + \hbox_overlap_right:n{ + \@textsuperscript{\normalfont\@thefnmark} + } + } + \RenewDocumentCommand\@makefntext{m+}{ + \dim_set:Nn\parindent{1em}\noindent + \hbox_to_wd:nn{1.8em}{ + \hss\@textsuperscript{\normalfont\@thefnmark} + } + ##1 + } + \newpage + \int_gzero:N\@topnum + \__skrapport_maketitle: + \thispagestyle{plain} + \group_end: + \setcounter{footnote}{0} } -\def\@regarding{\relax} -\newcommand{\regarding}[1]{\gdef\@regarding{#1}} -\def\@copyright{\relax} -\newcommand{\license}[1]{\gdef\@copyright{#1}} -\let\@smallprintstyle\relax -\newcommand\maketitle{\par% - \begingroup - \renewcommand\thefootnote{\@fnsymbol\c@footnote}% - \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% - \long\def\@makefntext##1{\parindent 1em\noindent% - \hb@xt@1.8em{\hss\@textsuperscript{\normalfont\@thefnmark}}##1}% +\cs_new:Nn\__skrapport_maketitle:{ \newpage - \global\@topnum\z@ - \@maketitle - \thispagestyle{plain}\@thanks - \endgroup - \setcounter{footnote}{0}% -} -\def\@maketitle{% - \newpage - \null - \begin{flushleft}% + \hbox:n{} + \begin{flushleft} \vspace{-\headsep} - {\small% - \@smallprintstyle - \if\@regarding\relax\else\@regarding{, }\fi% - \@date\par% - }% - \vspace{1.5cm}% - {\Huge\@titstyle\@title\par}% - \vspace{.125cm}% - {\Large\@titstyle\@author}% - \vspace{.75cm}% - \end{flushleft}% - \par% -} -\newenvironment{abstract}{\newlength\skrapport@abstract@tw\newlength\skrapport@abstract@aw\settowidth{\skrapport@abstract@tw}{\bfseries\abstractname}\setlength{\skrapport@abstract@aw}{\the\textwidth-\the\skrapport@abstract@tw-1em}\begin{minipage}[t]{\skrapport@abstract@tw}\begin{flushright}\leavevmode\bfseries\abstractname\end{flushright}\end{minipage}\hspace{1em}\begin{minipage}[t]{\skrapport@abstract@aw}}{\end{minipage}} -\newcommand\ps@skrapport@titlepage{\def\@oddhead{}\def\@evenhead{}\def\@oddfoot{\begin{minipage}{\textwidth}\raggedleft\small\par\@smallprintstyle\@copyright\end{minipage}}\let\@evenfoot\@oddfoot} -\newenvironment{titlepage}{\cleardoublepage\setcounter{page}\@ne}{\thispagestyle{skrapport@titlepage}\cleardoublepage\setcounter{page}\@ne} + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{date}{ + \small\__skrapport_smallprint_style: + \tl_use:N\g__skrapport_regarding_tl + \tl_if_empty:NF\g__skrapport_regarding_tl{,~} + \tl_use:N\g__skrapport_date_tl\par + } + \vspace{1.5cm} + { + \Huge\__skrapport_title_style: + \tl_use:N\g__skrapport_title_tl + \par + } + \vspace{.125cm} + { + \Large\__skrapport_title_style: + \__skrapport_author_list: + } + \vspace{.75cm} + \end{flushleft} + \par + \clist_if_in:NnF\l__skrapport_maketitle_hide_clist{email}{ + \dim_set_to_abstract_or_email_wd:N\l_tmpa_dim + \bool_gset_false:N\g__skrapport_abstract_used + \dim_set:Nn\l_tmpb_dim + {\textwidth-\l_tmpa_dim-\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpa_dim} + \begin{flushright} + \leavevmode\__skrapport_abstract_style: + \__skrapport_Email_word: + \end{flushright} + \end{minipage} + \hspace{\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpb_dim} + \__skrapport_email_list: + \end{minipage} + \par + } +} +\bool_new:N\g__skrapport_abstract_used +\AtEndDocument{ + \iow_shipout:Nx\@mainaux{ % !!! + \exp_not:N\ExplSyntaxOn + \bool_if:NTF\g__skrapport_abstract_used + {\exp_not:n{\bool_gset_true:N\g__skrapport_abstract_used}} + {\exp_not:n{\bool_gset_false:N\g__skrapport_abstract_used}} + \exp_not:N\ExplSyntaxOff + } +} +\cs_new:Npn\dim_set_to_abstract_or_email_wd:N#1{ + \dim_set_to_wd:Nn\l_tmpa_dim + {\__skrapport_abstract_style:\abstractname} + \dim_set_to_wd:Nn\l_tmpb_dim + {\__skrapport_abstract_style:\__skrapport_Email_word:} + \bool_if:NTF\g__skrapport_abstract_used + {\dim_set:Nn#1{\dim_max:nn{\l_tmpa_dim}{\l_tmpb_dim}}} + {\dim_set_eq:NN#1\l_tmpb_dim} +} +\dim_const:Nn\c__skrapport_abstract_separator_dim{1em} +\DeclareDocumentEnvironment{abstract}{}{ + \bool_gset_true:N\g__skrapport_abstract_used + \dim_set_to_abstract_or_email_wd:N\l_tmpa_dim + \dim_set:Nn\l_tmpb_dim + {\textwidth-\l_tmpa_dim-\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpa_dim} + \begin{flushright} + \leavevmode\__skrapport_abstract_style: + \abstractname + \end{flushright} + \end{minipage} + \hspace{\c__skrapport_abstract_separator_dim} + \begin{minipage}[t]{\l_tmpb_dim} +}{ + \end{minipage} +} +\cs_new:Npn\ps@skrapport@titlepage{ + \cs_set:Npn\@oddhead{} + \cs_set:Npn\@evenhead{} + \cs_set:Npn\@oddfoot{ + \begin{minipage}{\textwidth} + \raggedleft\small\par + \__skrapport_smallprint_style: + \tl_use:N\g__skrapport_copyright_tl + \end{minipage} + } + \cs_set_eq:NN\@evenfoot\@oddfoot +} +\DeclareDocumentEnvironment{titlepage}{}{ + \cleardoublepage\setcounter{page}{1} +}{ + \bool_gset_false:N\g__skrapport_copyright_unprinted_bool + \thispagestyle{skrapport@titlepage} + \cleardoublepage\setcounter{page}{1} +} \setcounter{secnumdepth}{3} \newcounter{section} \newcounter{subsection}[section] \newcounter{subsubsection}[subsection] \newcounter{paragraph}[subsubsection] \newcounter{subparagraph}[paragraph] -\renewcommand\thesection{\@arabic\c@section} -\renewcommand\thesubsection{\thesection.\@arabic\c@subsection} -\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection} -\renewcommand\theparagraph{\thesubsubsection.\@arabic\c@paragraph} -\renewcommand\thesubparagraph{\theparagraph.\@arabic\c@subparagraph} -\newcommand\section{\@startsection{section}{1}{\z@}% - {-4ex \@plus 1ex \@minus -1ex}% - {.5ex \@plus.5ex}% - {\normalfont\LARGE\@titstyle}} -\newcommand\subsection{\@startsection{subsection}{2}{\z@}% - {-3ex \@plus 1ex \@minus -1ex}% - {.25ex \@plus.25ex}% - {\normalfont\Large\@titstyle}} -\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% - {-2ex \@plus .5ex \@minus -.5ex}% - {.125ex \@plus.125ex}% - {\normalfont\large\@titstyle}} -\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}% - {1ex \@plus .25ex \@minus -.25ex}% - {-1em}% - {\normalfont\normalsize\bfseries}} -\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% - {1ex \@plus .25ex \@minus -.25ex}% - {-1em}% - {\normalfont\normalsize\itshape}} -\setlength\leftmargini{2em} -\leftmargin\leftmargini -\setlength\leftmarginii{2em} -\setlength\leftmarginiii{1.5em} -\setlength\leftmarginiv{1.5em} -\setlength\leftmarginv{1em} -\setlength\leftmarginvi{1em} -\setlength\labelsep{.5em} -\setlength\labelwidth{\leftmargini} -\addtolength\labelwidth{-\labelsep} -\@beginparpenalty -\@lowpenalty -\@endparpenalty -\@lowpenalty -\@itempenalty -\@lowpenalty -\renewcommand\theenumi{\@arabic\c@enumi} -\renewcommand\theenumii{\@alph\c@enumii} -\renewcommand\theenumiii{\@roman\c@enumiii} -\renewcommand\theenumiv{\@Alph\c@enumiv} -\newcommand\labelenumi{\theenumi.} -\newcommand\labelenumii{\theenumii)} -\newcommand\labelenumiii{\theenumiii.} -\newcommand\labelenumiv{\theenumiv.} -\renewcommand\p@enumii{\theenumi} -\renewcommand\p@enumiii{\theenumi(\theenumii)} -\renewcommand\p@enumiv{\p@enumiii\theenumiii} -\newcommand\labelitemi{\textbullet} -\newcommand\labelitemii{\textopenbullet} -\newcommand\labelitemiii{\normalfont\bfseries\textendash} -\newcommand\labelitemiv{\textrightarrow} -\newenvironment{description} - {\list{}{\labelwidth\z@\itemindent-\leftmargin - \let\makelabel\descriptionlabel}}{\endlist} -\newcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bfseries #1} -\newenvironment{quote}{\list{}{\rightmargin\leftmargin}\item\relax\itshape}{\endlist} -\newenvironment{quotation}{\bigskip\begin{quote}}{\end{quote}\bigskip} -\newenvironment{verse}{\begin{quote}}{\end{quote}} -\newcommand\appendix{\par\setcounter{section}{0}\setcounter{subsection}{0}\gdef\thesection{\@Alph\c@section}} -\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} -\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} -\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} -\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} -\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} -\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} -\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} -\let\@emstyle\relax -\DeclareRobustCommand\em{% - \@nomath\em% - \ifdim \fontdimen\@ne\font >\z@% - \itshape\bfseries% - \else% - \itshape% - \fi% - \@emstyle% -} -\renewcommand\footnoterule{% - \kern-3\p@ - \hrule\@width.4\columnwidth - \kern2.6\p@} -\newcommand\@makefntext[1]{% - \parindent 1em% - \noindent - \hb@xt@1.8em{\hss\@makefnmark}#1} -\newcommand\contentsname{Innehåll} -\newcommand\refname{Referenser} -\newcommand\figurename{Figur} -\newcommand\tablename{Tabell} -\newcommand\appendixname{Bilaga} -\newcommand\abstractname{Sammanfattning} -\def\today{\year--\month--\day} -\setlength\arraycolsep{5\p@} -\setlength\tabcolsep{6\p@} -\setlength\arrayrulewidth{.4\p@} -\setlength\doublerulesep{2\p@} -\setlength\tabbingsep{\labelsep} -\skip\@mpfootins=\skip\footins -\setlength\fboxsep{3\p@} -\setlength\fboxrule{.4\p@} -\renewcommand\theequation{\@arabic\c@equation} -\newcounter{figure}\renewcommand\thefigure{\@arabic\c@figure} -\def\fps@figure{tb} -\def\ftype@figure{1} -\def\ext@figure{lof} -\def\fnum@figure{\figurename~\thefigure} -\newenvironment{figure}{\@float{figure}}{\end@float} -\newenvironment{figure*}{\@dblfloat{figure}}{\end@dblfloat} -\newcounter{table}\renewcommand\thetable{\@arabic\c@table} -\def\fps@table{tb} -\def\ftype@table{2} -\def\ext@table{lot} -\def\fnum@table{\tablename~\thetable} -\newenvironment{table}{\@float{table}}{\end@float} -\newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat} -\let\@captionstyle\relax -\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@} -\newlength\belowcaptionskip\setlength\belowcaptionskip{10\p@} -\long\def\@makecaption#1#2{% - \vskip\abovecaptionskip - \sbox\@tempboxa{\small{\bfseries#1:} \itshape#2}% - \ifdim \wd\@tempboxa >\hsize - \small{\bfseries\@captionstyle#1:} \itshape#2\par - \else - \global \@minipagefalse - \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% +\cs_gset:Npn\thesection{ + \arabic{section} +} +\cs_gset:Npn\thesubsection{ + \thesection.\arabic{subsection} +} +\cs_gset:Npn\thesubsubsection{ + \thesubsection.\arabic{subsubsection} +} +\cs_gset:Npn\theparagraph{ + \thesubsubsection.\arabic{paragraph} +} +\cs_gset:Npn\thesubparagraph{ + \theparagraph.\arabic{subparagraph} +} +\cs_new:Npn\__skrapport_pre_section:n#1{ + \leavevmode\par + \skip_set:Nn\l_tmpa_skip{#1} + \@afterindenttrue % !!! + \dim_compare:nT{\l_tmpa_skip<\c_zero_skip}{ + \skip_set:Nn\l_tmpa_skip{-\l_tmpa_skip} + \@afterindentfalse % !!! + } + \if@nobreak \everypar{} \else + \addpenalty\@secpenalty % !!! + \skip_vertical:N\l_tmpa_skip \fi - \vskip\belowcaptionskip} -\newcommand\@pnumwidth{1.55em} -\newcommand\@tocrmarg{2em} -\newcommand\@dotsep{1.7} -\setcounter{tocdepth}{5} -\newcommand\tableofcontents{% - \section*{\contentsname - \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname} - }% - \vskip\baselineskip% - \@starttoc{toc}% -} -\newcommand*\l@section{\@dottedtocline{1}{0em}{1.3em}} -\newcommand*\l@subsection{\@dottedtocline{2}{1.3em}{2em}} -\newcommand*\l@subsubsection{\@dottedtocline{3}{3.3em}{3.15em}} -\newcommand*\l@paragraph{\@dottedtocline{4}{6.45em}{4.15em}} -\newcommand*\l@subparagraph{\@dottedtocline{5}{10.6em}{5.15em}} -\let\l@figure\@empty -\let\l@table\@empty -\newdimen\bibindent -\setlength\bibindent{2em} -\newenvironment{thebibliography}[1] - {\section*{\refname}% - \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}% - \list{\@biblabel{\@arabic\c@enumiv}}% - {\settowidth\labelwidth{\@biblabel{#1}}% - \leftmargin\labelwidth - \advance\leftmargin\labelsep - \@openbib@code - \usecounter{enumiv}% - \let\p@enumiv\@empty - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy - \clubpenalty4000 - \@clubpenalty \clubpenalty - \widowpenalty4000}% - {\def\@noitemerr - {\@latex@warning{Empty ‘thebibliography’ environment}}% - \endlist} -\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em} -\let\@openbib@code\@empty -\newenvironment{theindex} - {\twocolumn[\section*{\indexname}]% - \@mkboth{\MakeUppercase\indexname}% - {\MakeUppercase\indexname}% - \thispagestyle{plain}\parindent\z@ - \parskip\z@ \@plus .3\p@\relax - \columnseprule \z@ - \columnsep 35\p@ - \let\item\@idxitem} - {\onecolumn} -\newcommand\@idxitem{\par\hangindent 40\p@} -\newcommand\subitem{\@idxitem \hspace*{20\p@}} -\newcommand\subsubitem{\@idxitem \hspace*{30\p@}} -\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} -\ifskrapport@twocolumn - \AtBeginDocument{ - \IfStrEq{\skrapport@paper}{a4paper} - {\def\@@@lines{40}}{\def\@@@lines{28}} - \IfStrEq{\skrapport@ptsize}{10pt}{ - \RequirePackage[fontsize=10pt,% - baseline=12pt,% - lines=\@@@lines]{grid} +} +\cs_new:Npn\__skrapport_post_section:n#1{ + \skip_set:Nn\l_tmpa_skip{#1} + \dim_compare:nTF{\l_tmpa_skip>\c_zero_skip}{ + \par\nobreak + \skip_vertical:N\l_tmpa_skip + \@afterheading % !!! + }{ + \@nobreakfalse + \global\@noskipsectrue + \skip_horizontal:n{-\l_tmpa_skip} + } + \ignorespaces +} +\cs_new:Npn\__skrapport_section_star:nnn#1#2#3{ + \__skrapport_section_star:nnnn{#1}{#2}{#3}{} +} +\cs_new:Npn\__skrapport_section_star:nnnn#1#2#3#4{ + \group_begin: + #2 + \hbox_set:Nn\l_tmpa_box{{\skip_horizontal:n{#1}#4}} + \dim_set:Nn\hangindent{#1+\box_wd:N\l_tmpa_box} + \noindent\box_use_clear:N\l_tmpa_box + \interlinepenalty\@M % !!! + #3 + \group_end: +} +\cs_new:Npn\__skrapport_section_nostar:nnnnnn#1#2#3#4#5#6{ + \cs_set:Nn\__skrapport_saved_section:{} + \int_compare:nF{#2>\value{secnumdepth}}{ + \refstepcounter{#1} + \cs_set:Nn\__skrapport_saved_section:{\use:c{the#1}~} + } + \__skrapport_section_star:nnnn + {#3}{#4}{#5}{\__skrapport_saved_section:} + \use:c{#1mark}{#6} + \addcontentsline{toc}{#1}{ + \int_compare:nF{#2>\value{secnumdepth}}{ + \protect\numberline{\use:c{the#1}} + } + #6 + } +} +\cs_generate_variant:Nn\__skrapport_pre_section:n{c} +\cs_generate_variant:Nn\__skrapport_post_section:n{c} +\cs_generate_variant:Nn\__skrapport_section_star:nnn{ccn} +\cs_generate_variant:Nn\__skrapport_section_nostar:nnnnnn{nnccnn} +\cs_set:Nn\__skrapport_generic_section:nnnnn{ + \__skrapport_pre_section:c{c__skrapport_#1_pre_skip} + \IfBooleanTF#3{ + \__skrapport_section_star:ccn + {c__skrapport_#1_indent_dim} + {__skrapport_#1_style:} + {#5} + }{ + \IfNoValueTF{#4}{ + \__skrapport_section_nostar:nnccnn + {#1}{#2} + {c__skrapport_#1_indent_dim} + {__skrapport_#1_style:} + {#5} + {#5} }{ - \IfStrEq{\skrapport@ptsize}{11pt}{ - \RequirePackage[fontsize=11pt,% - baseline=13.2pt,% - lines=\@@@lines]{grid} - }{ - \RequirePackage[fontsize=12pt,% - baseline=14.4pt,% - lines=\@@@lines]{grid} - } + \__skrapport_section_nostar:nnccnn + {#1}{#2} + {c__skrapport_#1_indent_dim} + {__skrapport_#1_style:} + {#5} + {#4} } - \renewenvironment{abstract}{\section*{\abstractname}}{} - \AfterEndPreamble{\begin{multicols}{2}} - \AtEndDocument{\end{multicols}} - \pretocmd{\maketitle}{\end{multicols}}{}{} - \apptocmd{\maketitle}{\begin{multicols}{2}}{}{} - \BeforeBeginEnvironment{equation}{\begin{gridenv}} - \AfterEndEnvironment{equation}{\end{gridenv}} - \BeforeBeginEnvironment{equation*}{\begin{gridenv}} - \AfterEndEnvironment{equation*}{\end{gridenv}} - \BeforeBeginEnvironment{multline}{\begin{gridenv}} - \AfterEndEnvironment{multline}{\end{gridenv}} - \BeforeBeginEnvironment{multline*}{\begin{gridenv}} - \AfterEndEnvironment{multline*}{\end{gridenv}} - \BeforeBeginEnvironment{gather}{\begin{gridenv}} - \AfterEndEnvironment{gather}{\end{gridenv}} - \BeforeBeginEnvironment{gather*}{\begin{gridenv}} - \AfterEndEnvironment{gather*}{\end{gridenv}} - \BeforeBeginEnvironment{align}{\begin{gridenv}} - \AfterEndEnvironment{align}{\end{gridenv}} - \BeforeBeginEnvironment{align*}{\begin{gridenv}} - \AfterEndEnvironment{align*}{\end{gridenv}} - \BeforeBeginEnvironment{flalign}{\begin{gridenv}} - \AfterEndEnvironment{flalign}{\end{gridenv}} - \BeforeBeginEnvironment{flalign*}{\begin{gridenv}} - \AfterEndEnvironment{flalign*}{\end{gridenv}} - \BeforeBeginEnvironment{alignat}{\begin{gridenv}} - \AfterEndEnvironment{alignat}{\end{gridenv}} - \BeforeBeginEnvironment{alignat*}{\begin{gridenv}} - \AfterEndEnvironment{alignat*}{\end{gridenv}} - \expandafter\let\expandafter - \old@figurest\csname figure*\endcsname - \expandafter\let\expandafter - \old@endfigurest\csname endfigure*\endcsname - \RenewDocumentEnvironment{figure}{o}{% - \begin{gridenv}% - \vspace{\intextsep}% - \begin{minipage}{\linewidth}% - \def\@captype{figure}% - }{% - \end{minipage}% - \vspace{\intextsep}% - \end{gridenv}% - } - \RenewDocumentEnvironment{figure*}{o}{\old@figurest}% - {\old@endfigurest} - \expandafter\let\expandafter - \old@tablest\csname table*\endcsname - \expandafter\let\expandafter - \old@endtablest\csname endtable*\endcsname - \RenewDocumentEnvironment{table}{o}{% - \begin{gridenv}% - \vspace{\intextsep}% - \begin{minipage}{\linewidth}% - \def\@captype{table}% - \let\@old@caption\caption% - \renewcommand{\caption}[1]{% - \setlength{\@tempdima}{\abovecaptionskip}% - \setlength{\abovecaptionskip}{\belowcaptionskip}% - \setlength{\belowcaptionskip}{\@tempdima}% - \@old@caption{##1}% - \vspace{\belowcaptionskip}% - }% - }{% - \end{minipage}% - \vspace{\intextsep}% - \end{gridenv}% - } - \let\oldoldtablest\oldtablest - \renewcommand{\oldtablest}{% - \oldoldtablest% - \let\@old@caption\caption% - \renewcommand{\caption}[1]{% - \setlength{\@tempdima}{\abovecaptionskip}% - \setlength{\abovecaptionskip}{\belowcaptionskip}% - \setlength{\belowcaptionskip}{\@tempdima}% - \@old@caption{##1}% - \vspace{\belowcaptionskip}% - }% - } - \RenewDocumentEnvironment{table*}{o}{\old@tablest}% - {\old@endtablest} - \newenvironment{onecol}{ - \end{onecol} - \end{multicols} - \begingroup - \def\endonecol{ - \endgroup - \begin{multicols}{2} - \let\old@onecol\onecol - \def\onecol{ - \let\onecol\old@onecol + } + \__skrapport_post_section:c{c__skrapport_#1_post_skip} +} +\skip_const:Nn\c__skrapport_section_pre_skip{-4ex~plus~1ex~minus~-1ex} +\skip_const:Nn\c__skrapport_section_post_skip{.5ex~plus~.5ex} +\dim_const:Nn \c__skrapport_section_indent_dim{\c_zero_dim} +\cs_set_protected:Nn\__skrapport_section_style: + {\normalfont\LARGE\__skrapport_title_style:} +\DeclareDocumentCommand\section{som}{ + \__skrapport_generic_section:nnnnn{section}{1}{#1}{#2}{#3} +} +\skip_const:Nn\c__skrapport_subsection_pre_skip{-3ex~plus~1ex~minus~-1ex} +\skip_const:Nn\c__skrapport_subsection_post_skip{.25ex~plus~.25ex} +\dim_const:Nn \c__skrapport_subsection_indent_dim{\c_zero_dim} +\cs_set_protected:Nn\__skrapport_subsection_style: + {\normalfont\Large\__skrapport_title_style:} +\DeclareDocumentCommand\subsection{som}{ + \__skrapport_generic_section:nnnnn{subsection}{2}{#1}{#2}{#3} +} +\skip_const:Nn\c__skrapport_subsubsection_pre_skip{-2ex~plus~.5ex~minus~-.5ex} +\skip_const:Nn\c__skrapport_subsubsection_post_skip{.125ex~plus~.125ex} +\dim_const:Nn \c__skrapport_subsubsection_indent_dim{\c_zero_dim} +\cs_set_protected:Nn\__skrapport_subsubsection_style: + {\normalfont\large\__skrapport_title_style:} +\DeclareDocumentCommand\subsubsection{som}{ + \__skrapport_generic_section:nnnnn{subsubsection}{3}{#1}{#2}{#3} +} +\skip_const:Nn\c__skrapport_paragraph_pre_skip{1ex~plus~.25ex~minus~-.25ex} +\skip_const:Nn\c__skrapport_paragraph_post_skip{-1em} +\dim_const:Nn \c__skrapport_paragraph_indent_dim{\c_zero_dim} +\cs_set_protected:Nn\__skrapport_paragraph_style: + {\normalfont\normalsize\__skrapport_title_style:} +\DeclareDocumentCommand\paragraph{som}{ + \__skrapport_generic_section:nnnnn{paragraph}{4}{#1}{#2}{#3} +} +\skip_const:Nn\c__skrapport_subparagraph_pre_skip{1ex~plus~.25ex~minus~-.25ex} +\skip_const:Nn\c__skrapport_subparagraph_post_skip{-1em} +\dim_const:Nn \c__skrapport_subparagraph_indent_dim{\parindent} +\cs_set_protected:Nn\__skrapport_subparagraph_style: + {\normalfont\normalsize\__skrapport_title_style:\itshape} +\DeclareDocumentCommand\subparagraph{som}{ + \__skrapport_generic_section:nnnnn{subparagraph}{5}{#1}{#2}{#3} +} +\dim_gset:Nn\leftmargini{2em} +\dim_gset_eq:NN\leftmargin\leftmargini +\dim_gset:Nn\leftmarginii{2em} +\dim_gset:Nn\leftmarginiii{1.5em} +\dim_gset:Nn\leftmarginiv{1.5em} +\dim_gset:Nn\leftmarginv{1em} +\dim_gset:Nn\leftmarginvi{1em} +\dim_gset:Nn\labelsep{.5em} +\dim_gset_eq:NN\labelwidth\leftmargini +\dim_gsub:Nn\labelwidth{-\labelsep} +\int_gset:Nn\@beginparpenalty{-\@lowpenalty} +\int_gset:Nn\@endparpenalty {-\@lowpenalty} +\int_gset:Nn\@itempenalty {-\@lowpenalty} +\cs_set:Npn\theenumi {\arabic{enumi}} +\cs_set:Npn\theenumii {\alph{enumii}} +\cs_set:Npn\theenumiii{\roman{enumiii}} +\cs_set:Npn\theenumiv {\Alph{enumiv}} +\cs_new:Npn\labelenumi{\theenumi.} +\cs_new:Npn\labelenumii{\theenumii)} +\cs_new:Npn\labelenumiii{\theenumiii.} +\cs_new:Npn\labelenumiv{\theenumiv.} +\cs_set:Npn\p@enumii{\theenumi} +\cs_set:Npn\p@enumiii{\theenumi(\theenumii)} +\cs_set:Npn\p@enumiv{\p@enumiii\theenumiii} +\cs_set:Npn\labelitemi{\textbullet} +\cs_set:Npn\labelitemii{\normalfont\bfseries\textendash} +\cs_set:Npn\labelitemiii{\textbullet} +\cs_set:Npn\labelitemiv{\normalfont\bfseries\textendash} +\DeclareDocumentEnvironment{description}{}{ + \begin{list}{}{ + \dim_zero:N\labelwidth + \dim_set:Nn\itemindent{-\leftmargin} + \cs_set_eq:NN\makelabel\descriptionlabel + } +}{ + \end{list} +} +\NewDocumentCommand\descriptionlabel{m}{ + \hspace{\labelsep}\normalfont\bfseries #1 +} +\NewDocumentEnvironment{quote}{}{ + \begin{list}{}{ + \dim_set_eq:NN\rightmargin\leftmargin + } + \item\itshape +}{ + \end{list} +} +\NewDocumentEnvironment{quotation}{}{ + \bigskip + \begin{quote} +}{ + \end{quote} + \bigskip +} +\NewDocumentEnvironment{verse}{}{ + \begin{quote} +}{ + \end{quote} +} +\NewDocumentCommand\appendix{}{ + \par + \setcounter{section}{0} + \setcounter{subsection}{0} + \cs_gset:Npn\thesection{\Alph{section}} +} +\DeclareDocumentCommand\rm{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\rm}{\textrm}} +\DeclareDocumentCommand\sf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sf}{\textsf}} +\DeclareDocumentCommand\tt{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\tt}{\texttt}} +\DeclareDocumentCommand\bf{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\bf}{\textbf}} +\DeclareDocumentCommand\it{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\it}{\textit}} +\DeclareDocumentCommand\sl{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sl}{\textsl}} +\DeclareDocumentCommand\sc{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\sc}{\textsc}} +\DeclareDocumentCommand\em{}{\msg_error:nnn{skrapport}{old-font-deprecated}{\em}{\emph}} +\cs_new:Nn\__skrapport_emphstyle:{ + \itshape + \dim_compare:nF{\fontdimen\c_one\font>\c_zero_dim}{\bfseries} +} +\DeclareDocumentCommand\emph{m+}{ + \ifmmode + \text{\__skrapport_emphstyle: #1} + \else + {\__skrapport_emphstyle: #1} + \fi +} +\DeclareDocumentCommand\footnoterule{}{} +\DeclareDocumentCommand\@makefntext{m+}{ + \dim_set:Nn\parindent{1em}\noindent + \hbox_to_wd:nn{1.8em}{\hss\@makefnmark} + #1 +} +\dim_gset:Nn\arraycolsep {5pt} +\dim_gset:Nn\tabcolsep {6pt} +\dim_gset:Nn\arrayrulewidth{.4pt} +\dim_gset:Nn\doublerulesep {2pt} +\dim_gset_eq:NN\tabbingsep\labelsep +\skip_gset_eq:NN{\skip\@mpfootins}{\skip\footins} +\dim_gset:Nn\fboxsep {3pt} +\dim_gset:Nn\fboxrule {.4pt} +\newcounter{figure} +\newcounter{table} +\cs_set:Npn\theequation{\arabic{equation}} +\cs_set:Npn\thefigure{\arabic{figure}} +\cs_set:Npn\thetable{\arabic{table}} +\cs_new:Npn \fps@figure{tb} +\cs_new:Npn\ftype@figure{1} +\cs_new:Npn \ext@figure{lof} +\cs_new:Npn \fnum@figure{\figurename\ \thefigure} +\cs_new:Npn \fps@table {tb} +\cs_new:Npn\ftype@table {2} +\cs_new:Npn \ext@table {lot} +\cs_new:Npn \fnum@table {\tablename\ \thetable} +\cs_new:Npn\__skrapport_xfloat:nn#1#2{\@xfloat{#1}[#2]} +\cs_generate_variant:Nn\__skrapport_xfloat:nn{nx} +\DeclareDocumentEnvironment{figure}{o}{ + \__skrapport_xfloat:nx{figure} + {\IfNoValueTF{#1}{\fps@figure}{#1}} + \centering +}{ + \end@float +} +\DeclareDocumentEnvironment{figure*}{o}{ + \__skrapport_xfloat:nx{figure} + {\IfNoValueTF{#1}{tp}{#1}} + \centering +}{ + \end@float +} +\DeclareDocumentEnvironment{table}{o}{ + \__skrapport_xfloat:nx{table} + {\IfNoValueTF{#1}{\fps@table}{#1}} + \centering +}{ + \end@float +} +\DeclareDocumentEnvironment{table*}{o}{ + \__skrapport_xfloat:nx{table} + {\IfNoValueTF{#1}{tp}{#1}} + \centering +}{ + \end@float +} +\DeclareDocumentEnvironment{figcenter}{}{ + \coffin_clear:N\l_tmpa_coffin + \hcoffin_set:Nw\l_tmpa_coffin +}{ + \hcoffin_set_end: + \dim_set:Nn\l_tmpa_dim{(\textwidth - \coffin_wd:N\l_tmpa_coffin)/2} + \skip_horizontal:n{-\l_tmpa_dim} + \coffin_typeset:Nnnnn\l_tmpa_coffin{H}{l}{0pt}{0pt} +} +\PassOptionsToPackage{font=small,labelfont+=bf,textfont+=it}{caption} +\cs_new_protected:Nn\__skrapport_caption_name_style:{\small\bfseries} +\cs_new_protected:Nn\__skrapport_caption_text_style:{\small\itshape} +\skip_new:N\abovecaptionskip +\skip_set:Nn\abovecaptionskip{10pt} +\skip_new:N\belowcaptionskip +\skip_set:Nn\belowcaptionskip{10pt} +\cs_new:Npn\@makecaption#1#2{ + \skip_vertical:N\abovecaptionskip + \hbox_set:Nn\l_tmpa_box{ + \color@setgroup % !!! + {\__skrapport_caption_name_style:#1:~} + {\__skrapport_caption_text_style:#2} + \color@endgroup % !!! + } + \dim_compare:nTF{\box_wd:N\l_tmpa_box>\hsize}{ + {\__skrapport_caption_name_style:#1:~} + {\__skrapport_caption_text_style:#2} + \par + }{ + \global\@minipagefalse % !!! + \hbox_to_wd:nn{\hsize}{ + \hfil + \box_use_clear:N\l_tmpa_box + \hfil + } + } + \skip_vertical:N\belowcaptionskip +} +\cs_new:Npn\@pnumwidth{1.55em} +\cs_new:Npn\@tocrmarg{2em} +\cs_new:Npn\@dotsep{1.7} +\setcounter{tocdepth}{3} +\DeclareDocumentCommand\tableofcontents{}{ + \section*{\contentsname} + \makeatletter + \@starttoc{toc} + \makeatother +} +\cs_new:Npn\__skrapport_toc_line:nnnnnn#1#2#3#4#5#6{ + \int_compare:nF{#2>\value{tocdepth}}{ + \skip_vertical:n{0pt~plus~.2pt} + \group_begin: + \skip_set:Nn\leftskip{#3} + \skip_set_eq:NN\rightskip\@tocrmarg + \skip_set:Nn\parfillskip{-\rightskip} + \dim_set:Nn\parindent{#3} + \@afterindenttrue % !!! + \interlinepenalty\@M % !!! + \leavevmode + \skip_set:Nn\@tempdima{#4} % !!! (dumb) + \skip_add:Nn\leftskip{\@tempdima} + \null\nobreak + \skip_horizontal:n{-\leftskip} + {#5}\nobreak + \str_if_eq:nnTF{#1}{}{ + \hfill + }{ + \leaders\hbox:n{ + \(\mkern\@dotsep mu\hbox{#1}\mkern\@dotsep mu\) % !!! } - \begin{onecol} } - \def\onecol{} - \begin{onecol} - }{} + \hfill\nobreak + \hbox_to_wd:nn{\@pnumwidth}{ % !!! + \hfil\normalfont\normalcolor #6 + } + \par + \group_end: + } +} +\cs_new:Npn\__skrapport_toc_line:nnnnn#1#2#3#4#5{ + \__skrapport_toc_line:nnnnnn{}{#1}{#2}{#3}{#4}{#5} +} +\DeclareDocumentCommand\l@section{mm}{ + \group_begin: + \skip_vertical:n{.75ex} + \bfseries + \__skrapport_toc_line:nnnnn{1}{0em}{1.3em}{#1}{#2} + \group_end: +} +\DeclareDocumentCommand\l@subsection{mm}{ + \group_begin: + \skip_vertical:n{.35ex} + \penalty\@secpenalty % !!! + \__skrapport_toc_line:nnnnnn{.}{2}{1.3em}{2em}{#1}{#2} + \group_end: +} +\DeclareDocumentCommand\l@subsubsection{mm}{ + \skip_set:Nn\leftskip{3.3em} + \dim_set_eq:NN\parindent\c_zero_dim + \group_begin: + \cs_set_eq:NN\numberline\use_none:n + \small #1~[#2] + \group_end: +} +\DeclareDocumentCommand\l@paragraph{mm}{ + \int_compare:nF{4>\value{tocdepth}}{ + \msg_warning:nnnn{skrapport}{tocdepth-too-deep} + {4}{\l@paragraph} } -\fi -\NewDocumentCommand\@comment{m}{% - {\textbf{Comment:} #1}% } -\NewDocumentCommand\comment{sm}{% - \IfBooleanTF{#1}% - {\colorbox{red!50}{\@comment{#2}}}% - {\marginpar{\@comment{#2}}}% +\DeclareDocumentCommand\l@subparagraph{mm}{ + \int_compare:nF{5>\value{tocdepth}}{ + \msg_warning:nnnn{skrapport}{tocdepth-too-deep} + {5}{\l@subparagraph} + } } -\ProvideDocumentCommand\com{sm}% +\cs_set:Npn\l@figure{} +\cs_set:Npn\l@table{} +\dim_new:N\bibindent +\dim_set:Nn\bibindent{2em} +\DeclareDocumentEnvironment{thebibliography}{m}{ + \section*{\refname} + \list{\@biblabel{\arabic{enumiv}}}{ + \dim_set_to_wd:Nn\labelwidth{\@biblabel{#1}} + \dim_set_eq:NN\leftmargin\labelwidth + \dim_add:Nn\leftmargin{\labelsep} + \usecounter{enumiv} % !!! + \cs_set:Nn\p@enumiv{} + \RenewDocumentCommand\theenumiv{}{\arabic{enumiv}} + } + \sloppy + \int_set:Nn\clubpenalty{4000} + \int_set_eq:NN\@clubpenalty\clubpenalty + \int_set:Nn\widowpenalty{4000} +}{ + \cs_set:Nn\@noitemerr{} + \endlist +} +\DeclareDocumentCommand\newblock{}{ + \skip_horizontal:n{.11em~plus~.33em~minus~.07em} +} +\DeclareDocumentEnvironment{theindex}{}{ + \begin{multicols}{2}[\section*{\indexname}] + \thispagestyle{plain} + \dim_zero:N\parindent + \skip_set:N\parskip{\c_zero_skip~plus~.3pt} + \dim_zero:N\columnseprule + \dim_set:Nn\columnsep{35pt} + \cs_set_eq:NN\item\@idxitem +}{ + \end{multicols} +} +\DeclareDocumentCommand\@idxitem{}{ + \par + \dim_set:Nn\hangindent{40pt} +} +\DeclareDocumentCommand\subitem{}{ + \@idxitem + \hspace*{20pt} +} +\DeclareDocumentCommand\subsubitem{}{ + \@idxitem + \hspace*{30pt} +} +\DeclareDocumentCommand\indexspace{}{ + \par + \skip_vertical:n{10pt~plus~5pt~minus~3pt} +} +\cs_new:Npn\__skrapport_comment:n#1{ + {\textbf{\__skrapport_Comment_word: :}~#1} +} +\DeclareDocumentCommand\comment{sm}{ + \IfBooleanTF{#1} + {\colorbox{red!50}{\__skrapport_comment:n{#2}}} + {\marginpar{\__skrapport_comment:n{#2}}} +} +\ProvideDocumentCommand\com{sm} {\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}} -\ProvideDocumentCommand\note{sm}% +\ProvideDocumentCommand\note{sm} {\IfBooleanTF{#1}{\comment*{#2}}{\comment{#2}}} -\ifskrapport@color - \apptocmd{\bfseries}{\color{skrapport@boldcolor}}{}{\ClassError{skrapport}{Could not patch \protect\bfseries}{}} - \apptocmd{\itshape}{\color{skrapport@italiccolor}}{}{\ClassError{skrapport}{Could not patch \protect\itshape}{}} - \if\@titstyle\relax - \def\@titstyle{\color{skrapport@titlecolor}} - \else - \apptocmd{\@titstyle}{\color{skrapport@titlecolor}}{}{\ClassError{skrapport}{Could not patch \protect\@titstyle}{}} - \fi - \def\@smallprintstyle{\color{skrapport@smallprintcolor}} - \AtBeginDocument{% - \let\@abstractname\abstractname - \def\abstractname{\color{skrapport@titlecolor}\@abstractname} - } - \apptocmd{\quote}{\color{skrapport@quotecolor}}{}{} - \def\@captionstyle{\color{skrapport@captioncolor}} - \def\@emstyle{\color{skrapport@emphcolor}} - \ifskrapport@twocolumn\AtBeginDocument{% - \renewcommand\section{\@startsection {section}{1}{\z@}% - {-.999\baselineskip}{0.001\baselineskip}{\bfseries\mathversion{bold}\color{skrapport@titlecolor}}} - \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% - {\baselineskip}{-.35\baselineskip}{\bfseries\color{skrapport@titlecolor}\unskip}} - \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% - {\baselineskip}{-.35\baselineskip}{\itshape\color{skrapport@titlecolor}\unskip}} - }\fi - \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% - {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\bfseries\color{skrapport@titlecolor}}} - \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% - {1ex \@plus .25ex \@minus -.25ex}{-1em}{\normalfont\normalsize\itshape\color{skrapport@titlecolor}}} +\bool_if:NT\g__skrapport_color_bool{ + \apptocmd{\bfseries} + {\color{skrapport@boldcolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\bfseries}} + \apptocmd{\itshape} + {\color{skrapport@italiccolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\itshape}} + \apptocmd{\__skrapport_title_style:} + {\color{skrapport@titlecolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_title_style:}} + \apptocmd{\__skrapport_smallprint_style:} + {\color{skrapport@smallprintcolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_smallprint_style:}} + \apptocmd{\__skrapport_abstract_style:} + {\color{skrapport@titlecolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_abstract_style:}} + \apptocmd{\quote} + {\color{skrapport@quotecolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\quote}} + \apptocmd{\__skrapport_caption_name_style:} + {\color{skrapport@captioncolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_caption_name_style:}} + \apptocmd{\__skrapport_emphstyle:} + {\color{skrapport@emphcolor}}{} + {\msg_warning:nnn{skrapport}{color-patch-failed}{\__skrapport_emphstyle:}} \AtBeginDocument{\@ifpackageloaded{hyperref}{% \hypersetup{% citebordercolor=skrapport@citecolor,citecolor=skrapport@citecolor,% @@ -663,11 +1431,13 @@ } }{}} \AtBeginDocument{\color{skrapport@defaultcolor}} - \newcommand\colortheme[1]{\usepackage{skrapport-colortheme-#1}} + \DeclareDocumentCommand\colortheme{m}{ + \usepackage{skrapport-colortheme-#1} + } \colortheme{default} -\fi -\setlength\columnsep{10\p@} -\setlength\columnseprule{0\p@} +} +\dim_set:Nn\columnsep{10pt} +\dim_zero:N\columnseprule \pagestyle{plain} \pagenumbering{arabic} \raggedbottom diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index b092c35e8af..d1984f9cbbb 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1104,7 +1104,6 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'pgf-blur' => '&PREHOOK_pgfblur', 'pictex' => '&PREHOOK_pictex', 'skb' => '&PREHOOK_flatten1', - 'skrapport' => '&PREHOOK_savepdf', 'suftesi' => '&PREHOOK_suftesi', 'tui' => '&PREHOOK_tui', 'vhistory' => '&PREHOOK_vhistory', @@ -1168,7 +1167,6 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'pst-geo' => '&POSTpstgeo', 'pxbase' => '&POSTpxbase', 'pxchfon' => '&POSTpxchfon', - 'skrapport' => '&POST_savepdf', 'splitindex' => '&POST_do_man', 'tipa-de' => '&POST_rmsymlink', 'xecyr' => '&POSTxecyr', |