% \iffalse meta-comment %<*internal> \begingroup \input docstrip \preamble The 'fontsize' package Copyright (C) 2020-2021 Ivan Valbusa All rights reserved. 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 consists of all files listed in README This work has the LPPL maintenance status "author-maintained". \endpreamble \keepsilent \askforoverwritefalse \Msg{*** Generating the package file ***} \generate{ \file{fontsize.sty}{\from{fontsize.dtx}{package}} \nopreamble\nopostamble \file{fontsize.bib}{\from{fontsize.dtx}{bib}}} \Msg{***********************************************************} \Msg{*} \Msg{* To finish the installation you have to move the following} \Msg{* files into a directory searched by TeX:} \Msg{*} \Msg{* \space\space fontsize.sty} \Msg{*} \Msg{*} \Msg{* To produce the documentation on fontsize's code run} \Msg{* the file ending with `.dtx' through (pdf)LaTeX. See the} \Msg{* README file for more details.} \Msg{*} \Msg{* Happy TeXing} \Msg{***********************************************************} \endgroup % % \fi % \iffalse %<*driver> \ProvidesFile{fontsize.dtx} % %\NeedsTeXFormat{LaTeX2e}[2005/12/01] %\ProvidesPackage{fontsize} %<*package> [2021/01/25 v0.4 'fontsize' package. Set main font sizes (Ivan Valbusa)] % %<*driver> \documentclass[12pt]{ltxdoc} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[fontsize=12pt]{fontsize} \usepackage{array,booktabs,siunitx} %-------------------------------------------------------- % GRAPHICS %-------------------------------------------------------- \usepackage[svgnames]{xcolor} \definecolor{philA}{named}{DarkRed} \definecolor{philB}{named}{NavyBlue} \definecolor{sufred}{rgb}{0.5,0,0} \definecolor{sufgray}{rgb}{0.5,0.5,0.5} \usepackage{tikz} \usetikzlibrary{shadows} \usepackage[framemethod=TikZ]{mdframed} \mdfsetup{roundcorner=3pt,linecolor=white,backgroundcolor=gray!10} %-------------------------------------------------------- % DOC FACILITIES %-------------------------------------------------------- \usepackage{metalogo,hologo} \usepackage{guit}% before ltxdockit but after xcolor! \usepackage[final]{microtype} \let\cs\relax \let\cmd\relax \usepackage{ltxdockit} %-------------------------------------------------------- % FONTS %-------------------------------------------------------- \usepackage{cochineal} \usepackage[varqu,varl,var0]{inconsolata} \usepackage{biolinum} \usepackage{amsthm} \usepackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath} \usepackage[cal=boondoxo]{mathalfa} \usepackage{manfnt} %-------------------------------------------------------- % LAYOUT %-------------------------------------------------------- \usepackage[skip=1.5ex]{parskip} \setcounter{tocdepth}{3} \usepackage{geometry} \geometry{ a4paper, margin=3cm, %paperwidth=128mm, %paperheight=96mm, %margin=1cm, headheight=15pt, ignoreall, heightrounded} \usepackage{sectsty} \allsectionsfont{\sffamily} % -------------------------------------------------------- % OTHER PACKAGES % -------------------------------------------------------- \usepackage[autostyle]{csquotes} \usepackage[style=philosophy-classic]{biblatex} \addbibresource{fontsize.bib} %-------------------------------------------------------- % COMMANDS AND ENVIRONMENTS %-------------------------------------------------------- \newcommand{\new}{\marginpar{\textcolor{red}{\textbf{NEW!}}}} \newcommand{\argstyle}{\itshape} \DeclareRobustCommand*{\ar}[1]{\texttt{\char`\{}\textrm{\argstyle#1}\texttt{\char`\}}} \DeclareRobustCommand*{\oar}[1]{\texttt{[}\textrm{\argstyle#1}\texttt{]}} \DeclareRobustCommand*{\meta}[1]{% $\langle${\argstyle\rmfamily#1\kern0.12em}$\rangle$} \DeclareRobustCommand*{\arm}[1]{\ar{\meta{\argstyle#1}}} \DeclareRobustCommand*{\oarm}[1]{\oar{\meta{\argstyle#1}}} \newcommand*{\OR}{${}\mid{}$} % % New environments % \newenvironment{ttquote}{% \begin{mdframed}\ttfamily\microtypesetup{activate=false}}{\end{mdframed}} \newenvironment{latexcode}{\begin{mdframed}}{\end{mdframed}} \makeatletter % Customizing option and value list: \patchcmd{\optionlist}{\marglistwidth}{0pt}{}{} \patchcmd{\optionlist}{\hss}{\phantom{\rule{1pt}{20pt}}\hss}{}{} \patchcmd{\ltd@option@i}{\linewidth}{\linewidth-\marglistwidth}{}{} \patchcmd{\ltxsyntax}{\marglistwidth}{0pt}{}{} \patchcmd{\ltd@option@i}{=}{\ = }{}{} % New color for items \renewcommand*{\optionlistfont}{% \color{philA}\sffamily\displayverbfont} \renewcommand*{\ltxsyntaxlabelfont}{% \color{philA}\sffamily\displayverbfont} \renewcommand*{\marglistfont}{% \color{philA}\sffamily\displayverbfont} % % Table of contents % \renewcommand\tableofcontents{% \setlength{\columnsep}{1cm} {\centering \section*{\contentsname}% \@mkboth{\contentsname}{\contentsname}} \thispagestyle{empty} \begin{multicols}{2} \@starttoc{toc}% \end{multicols}} \makeatother % % Commands for code % \def\baddition{\color{DarkBlue}} \def\eaddition{\color{black}} % -------------------------------------------------------- % HYPERREF SETUP % -------------------------------------------------------- \usepackage{hyperref} \hypersetup{% hidelinks, pdftitle={User's guide to \textsf{fontsize}}, pdfsubject={A small package to change the font size}, pdfauthor={Ivan Valbusa}, pdfkeywords={latex, fonts}} % -------------------------------------------------------- % FINAL SETTINGS % -------------------------------------------------------- \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{fontsize.dtx} \end{document} % % \fi % % \CheckSum{1731} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % % \changes{v0.4}{2021/01/25}{Maintenance release. Updated documentation.} % \changes{v0.3}{2020/12/19}{Added definitions of some lengths omitted from KOMA-script files: \cmd{smallskiamount}, \cmd{medskiamount}, \cmd{bigskiamount}. Redefined \cmd{parindent} and \cmd{headheight}.} % \changes{v0.2}{2020/05/24}{Updated documentation and code comments.} % \changes{v0.1}{2020/02/20}{First public release} % \GetFileInfo{fontsize.dtx} % % \DoNotIndex{\newcommand,\newenvironment,\def,\begin,\vskip,\ } % \DoNotIndex{\DeclareOption,\ExecuteOptions,\RequirePackage} % \DoNotIndex{\@@end,\@empty,\@ifclassloaded,\@nameuse,\@nil} % \DoNotIndex{\@undefined,\\,\`,\addtocounter,\advance,\bfseries} % \DoNotIndex{\centering,\closeout,\define@key,\documentclass} % \DoNotIndex{\edef,\else,\end,\endinput,\endtitlepage,\expandafter} % \DoNotIndex{\extracolsep,\fi,\fill,\fontsize,\g@addto@macro,\toks} % \DoNotIndex{\hrule,\hspace,\if,\if@twoside,\ifcase,\ifdefined} % \DoNotIndex{\iffalse,\IfFileExists,\ifnum,\ifx,\immediate,\setcounter} % \DoNotIndex{\jobname,\let,\long,\MakeUppercase,\MessageBreak} % \DoNotIndex{\newcount,\newif,\newpage,\newtoks,\newwrite,\next} % \DoNotIndex{\noexpand,\nofiles,\normalfont,\normalsize,\null} % \DoNotIndex{\openout,\or,\Package,\PackageError,\PackageWarning} % \DoNotIndex{\PackageWarningNoLine,\paperheight,\paperwidth,\par} % \DoNotIndex{\parbox,\parindent,\relax,\scshape,\selectfont,\setkeys} % \DoNotIndex{\sffamily,\space,\stretch,\string,\textheight,\textwidth} % \DoNotIndex{\the,\thispagestyle,\unexpanded,\unless,\unskip,\upshape} % \DoNotIndex{\usepackage,\vbox,\vfill,\vspace,\write,\z@} % \DoNotIndex{\CurrentOption,\AtEndDocument,\@ne,\c@page,\m@ne} % \DoNotIndex{\@firstofone,\@gobble,\@makeother,\begingroup,\endgroup} % \DoNotIndex{\eTeXversion,\hbox,\hsize,\includegraphics,\newlinechar} % \DoNotIndex{\titlepage,\vss,\vtop,\xdef,\@gobbletwo,\color,\dimexpr} % \DoNotIndex{\huge,\large,\makebox,\ProcessOptions,\renewcommand} % % \thispagestyle{empty} % \begin{tikzpicture}[overlay,remember picture] % \draw[circular drop shadow,draw=none,fill=white] (current page.center) circle (6cm) node[align=center,anchor=center] {% % Ivan Valbusa\\[1cm] % %\Huge\color{gray}\bfseries \parbox{10cm}{\centering The \\{{\color{philA}\fontsize{30}{32}\textsf{fontsize}}\\ package}}\\[1cm] % \color{black!60!Goldenrod} % %\normalsize \fileversion{} -- \filedate % %}; % \end{tikzpicture} % \clearpage\thispagestyle{empty} % % \null\vfill % % ^^A ---------------------------------------------------------------- % ^^A % \section*{Legalese} % ^^A % ^^A ---------------------------------------------------------------- % % \noindent Copyright \copyright\ 2020-\the\year\ Ivan Valbusa % \smallskip % % \noindent This package is author-maintained. % Permission is granted to copy, distribute and/or modify this software % under the terms of the \LaTeX{} Project Public License, version 1.3 or % later (\url{http://latex-project.org/lppl}). % This software is provided ``as is'', without warranty of any kind, % either expressed or implied, including, but not limited to, the implied % warranties of merchantability and fitness for a particular purpose. % % ^^A ---------------------------------------------------------------- % ^^A % \section*{Feedback} % ^^A % ^^A ---------------------------------------------------------------- % % If you have any questions, feedback or requests please email % me at \texttt{ivan dot valbusa at gmail dot com}. If you need specific % features not already implemented, remember to attach the example files. % % \clearpage % % \begin{center} % {\color{philA}\bfseries\sffamily % \huge User's guide to \texttt{fontsize}\\[3mm]} % {\large\bfseries\sffamily A small package to change the font size} % \vspace{.8cm} % % \normalsize\fileversion{} -- \filedate % \vspace{.7cm} % % Ivan Valbusa\\[2mm] % \footnotesize\texttt{ivan dot valbusa at gmail dot com} % \vspace{1cm} % \end{center} % % \begin{abstract} % \noindent The \sty{fontsize} package allows you to set arbitrary sizes % for the main font of the document and to adjust the line spacing accordingly. You can also generate your own \file{.clo} file for better tuning. % \end{abstract} % % \tableofcontents % %^^A--------------------------------------------------------------------- % \section*{Credits} %^^A--------------------------------------------------------------------- % % The code is an excerpt of the \sty{scrextend} and % \sty{scrfontsizes} packages \parencite{koma}, with few minor % changes to make it completely independent of the KOMA-script bundle and with a couple of new features. The package is updated to version |3390 2019-11-18 17:09:35Z| of the \file{scrkernel-fonts.dtx} file. % %^^A--------------------------------------------------------------------- % \section*{Caveat} %^^A--------------------------------------------------------------------- % % Although effective with any value for the \meta{fontsize} (as long as the font % is scalable), the package is meant for small font size changes. % For truly optimal results you should (re)define your own \file{.clo} file. % Indeed note that the file generated with \cmd{generateclofile}, as well as the macros redefined via \cmd{changefontsize}, are a subset of the standard \file{.clo} files. %^^A--------------------------------------------------------------------- % \section{Usage} %^^A--------------------------------------------------------------------- % \enlargethispage{\baselineskip} % % The package can be loaded, as usual, with: % \begin{ttquote} % \noindent\cmd{usepackage}\oarg{options}|{fontsize}| % \end{ttquote} % %^^A The \sty{geometry} package and the settings to change the page layout %^^A must follow \sty{fontsize} to avoid errors in the layout % %^^A--------------------------------------------------------------------- % \subsection{Options} %^^A--------------------------------------------------------------------- % % \begin{optionlist} % % \optitem[10pt]{fontsize}{\meta{fontsize}} % % Sets the normal size to \meta{fontsize} and the normal line spacing % to 1.2\meta{fontsize}. The other sizes (\cmd{tiny}, \cmd{scriptsize}, % \cmd{small}, ecc.) and line spacings are set proportionally. % You can use any unit recognized by \TeX\ and you can % omit the unit as well (in which case it defaults to \texttt{pt}). % If a file named \file{\meta{name}\meta{fontsize}.clo} exists it is used to setup % the font sizes. This file can be generated through the \cmd{generateclofile} % command (see below). % % \optitem[custom]{cloname}{\meta{name}} % % Sets to \meta{name} the name prefix of the \file{.clo} file generated % by the \cmd{generateclofile} command (see below). % % \end{optionlist} % %^^A--------------------------------------------------------------------- % \subsection{Commands} %^^A--------------------------------------------------------------------- % % \begin{ltxsyntax} % % \cmditem{changefontsize}[baselineskip]{fontsize} \hfill iff \meta{baselineskip} $\geq$\meta{fontsize} % % Sets the normal size to \meta{fontsize} and the normal line spacing to % \meta{baselineskip}. The other sizes (\cmd{tiny}, \cmd{scriptsize}, % \cmd{small}, ecc.) and line spacings are set proportionally. % If the first optional argument is omitted the command has the same effect % of the \opt{fontsize} option. You can use any unit recognized by \TeX\ and % you can omit the unit as well (in which case it defaults to \texttt{pt}). % For example: \verb|\changefontsize[13.5pt]{11.5pt}|. % % \cmditem{generateclofile}{name}[baselineskip]{fontsize} \hfill iff \meta{baselineskip} $\geq$\meta{fontsize} % % Generates a file named \file{\meta{name}\meta{fontsize}.clo} in which the % normal size is \meta{fontsize} and the normal line spacing is \meta{baselineskip}. % The other sizes (\cmd{tiny}, \cmd{scriptsize}, % \cmd{small}, ecc.) and line spacings are set proportionally. % You can use any unit recognized % by \TeX\ and you can omit the unit as well (in which case it defaults % to \texttt{pt}). % If \opt{cloname=\meta{name}} \textit{and} \opt{fontsize=\meta{fontsize}} % the generated file will be automatically used to setup the main font sizes. % % \begin{tabular}{@{}m{0.05\textwidth}@{}m{0.95\textwidth}@{}} % \raisebox{1.475\height}{\dbend} & % \emph{In fact the \file{.clo} file is only needed if you intend to modify it. % In this case remember to comment the command, otherwise the edited % file will be overwrittern} % \end{tabular} % % \begin{ttquote}\small % \cmd{usepackage}|[fontsize=11.5pt]{fontsize}| |% loads custom11.5pt.clo|\\ % \cmd{generateclofile}|{custom}[13.5pt]{11.5pt}| |% generates custom11.5pt.clo| % % \cmd{usepackage}|[fontsize=11.5pt,cloname=fs]{fontsize}| |% loads fs11.5pt.clo| \\ % \cmd{generateclofile}|{fs}[13.5pt]{11.5pt}| |% generates fs11.5pt.clo| % \end{ttquote} % % \cmditem{printfontsize}[baselineskip]{fontsize} \hfill iff \meta{baselineskip} $\geq$\meta{fontsize} % % A command thought to test the \sty{fontsize} settings. % It prints a text sample for every sizing commands, showing the % value of the normal size and line spacing. % The section \ref{sec:example} below is generated by this command. % % \end{ltxsyntax} % %^^A--------------------------------------------------------------------- % \section{An example of font settings}\label{sec:example} %^^A-------------------------------------------------------------------- % % This section shows the values of the standard font sizing commands corresponding to \cmd{changefontsize}\texttt{[13]\{11\}}, which sets the normal size and line spacing, respectively, to 11\,pt and 13\,pt. The other sizes are scaled proportionally. % % \printfontsize[13]{11} % % \nocite{xkeyval,etoolbox} % % \StopEventually{% % \printbibliography[heading=bibintoc] % \PrintChanges\PrintIndex} % % \iffalse %<*package> % \fi %^^A--------------------------------------------------------------------- % \section{The Code} %^^A--------------------------------------------------------------------- %\textcolor{DarkBlue}{The parts added to the basic structure of \file{scrextend} and \file{scrfontsizes} are highlighted in blue.} % All the options of the package are defined via \sty{xkeyval}, while \sty{etoolbox} % is required to execute \cmd{AtEndOfPackage}. It is probably not necessary but for the moment I prefer to take advantage of it. % % \baddition % \begin{macrocode} \@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}} \@ifpackageloaded{etoolbox}{}{\RequirePackage{etoolbox}} % \end{macrocode} % \eaddition % Here we define the only new package option \opt{cloname}: % \baddition % \begin{macrocode} \DeclareOptionX{cloname}[custom]{\def\@fontsizefilebase{#1}} % \end{macrocode} % \eaddition % % \paragraph{Excerpt from \file{scrextend.sty}} % % Here the \sty{scrextend} code begins. Only a few names have been changed. % The value of \cmd{|@|fontsizefilebase} is set to \texttt{custom} instead of \texttt{scrsize}. % \begin{macrocode} \DeclareOptionX{fontsize}[10]{% \expandafter\@defaultunits\expandafter\@tempdima#1 pt\relax\@nnil \edef\@tempa{#1}% \setlength{\@tempdimb}{\@tempdima}% \edef\@tempb{\strip@pt\@tempdimb}% \addtolength{\@tempdimb}{-10\p@}% \edef\@ptsize{\strip@pt\@tempdimb}% \edef\@tempa{% \noexpand\makeatletter \noexpand\InputIfFileExists{\@fontsizefilebase\@tempa.clo}{% \noexpand\PackageInfo{fontsize}{% File `\@fontsizefilebase\@tempa.clo' used to setup font sizes}% }{% \noexpand\InputIfFileExists{\@fontsizefilebase\@tempb pt.clo}{% \noexpand\PackageInfo{fontsize}{% File `\@fontsizefilebase\@tempb pt.clo' used instead of% \noexpand\MessageBreak file `\@fontsizefilebase\@tempa.clo' to setup font sizes}% }{% \noexpand\changefontsize{#1}% }% }% }% \expandafter\AtEndOfPackage\expandafter{\@tempa}% } % \end{macrocode} % Now we can execute and process the new options defined above. As \opt{cloname} is responsible for defining \cmd{|@|fontsizefilebase} it must precede \opt{fontsize} which uses this command. % The \cmd{ctm@setlength} and \cmd{changefontsize} commands are simply new names, respectively, for \cmd{scr@setlength} and \cmd{changefontsizes} used in \file{scrextend.sty}. % \baddition % \begin{macrocode} \ExecuteOptionsX{cloname,fontsize} \ProcessOptionsX*\relax % \end{macrocode} % \eaddition % \begin{macrocode} \newcommand*\ctm@setlength[4]{% \ifdim #2<\ifdim #2=\z@ \z@ \else \p@\fi \ifdim #3<\ifdim #3=\z@ \z@ \else \p@\fi \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi \setlength{#1}{\p@ \@plus\p@ \@minus\p@}% \else \setlength{#1}{\p@ \@plus\p@ \@minus#4}% \fi \else \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi \setlength{#1}{\p@ \@plus#3 \@minus\p@}% \else \setlength{#1}{\p@ \@plus#3 \@minus#4}% \fi \fi \else \ifdim #3<\ifdim #3=\z@ \z@ \else \p@\fi \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi \setlength{#1}{#2 \@plus\p@ \@minus\p@}% \else \setlength{#1}{#2 \@plus\p@ \@minus#4}% \fi \else \ifdim #4<\ifdim #4=\z@ \z@ \else \p@\fi \setlength{#1}{#2 \@plus#3 \@minus\p@}% \else \setlength{#1}{#2 \@plus#3 \@minus#4}% \fi \fi \fi } \providecommand*{\changefontsize}[2][1.2\@tempdima]{% \@defaultunits\@tempdima#2pt\relax\@nnil \setlength{\@tempdimc}{\@tempdima}% \addtolength{\@tempdimc}{-10\p@}% \edef\@ptsize{\strip@pt\@tempdimc}% \@defaultunits\@tempdimb#1pt\relax\@nnil \setlength{\@tempdimc}{\dimexpr (100\@tempdimb / \@tempdima * \p@)}% \edef\@tempb{\the\@tempdimc}% \setlength{\@tempdimc}{\@tempdima}% \def\@tempa##1##2##3##4##5\@nnil{\def##1{##2.##3##4}}% \expandafter\@tempa\expandafter\@tempb\@tempb\@nnil% \ctm@setlength{\abovedisplayskip}% {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}% \ctm@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}% \ctm@setlength{\belowdisplayshortskip}% {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}% \setlength{\belowdisplayskip}{\abovedisplayskip}% \edef\normalsize{% \noexpand\@setfontsize\noexpand\normalsize {\the\@tempdima}{\the\@tempdimb}% \abovedisplayskip \the\abovedisplayskip \abovedisplayshortskip \the\abovedisplayshortskip \belowdisplayskip \the\belowdisplayskip \belowdisplayshortskip \the\belowdisplayshortskip \let\noexpand\@listi\noexpand\@listI }% \setlength{\@tempdima}{0.9125\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \ctm@setlength{\abovedisplayskip}% {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}% \ctm@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}% \ctm@setlength{\belowdisplayshortskip}% {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}% \setlength{\belowdisplayskip}{\abovedisplayskip}% \edef\small{% \noexpand\@setfontsize\noexpand\small {\the\@tempdima}{\the\@tempdimb}% \abovedisplayskip \the\abovedisplayskip \abovedisplayshortskip \the\abovedisplayshortskip \belowdisplayskip \the\belowdisplayskip \belowdisplayshortskip \the\belowdisplayshortskip \let\noexpand\@listi\noexpand\@listi@small }% \setlength{\@tempdima}{.83334\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \ctm@setlength{\abovedisplayskip}% {.8333\@tempdimb}{.1667\@tempdimb}{.5\@tempdimb}% \ctm@setlength{\abovedisplayshortskip}{\z@}{.25\@tempdimb}{\z@}% \ctm@setlength{\belowdisplayshortskip}% {.5\@tempdimb}{.25\@tempdimb}{.25\@tempdimb}% \setlength{\belowdisplayskip}{\abovedisplayskip}% \edef\footnotesize{% \noexpand\@setfontsize\noexpand\footnotesize {\the\@tempdima}{\the\@tempdimb}% \abovedisplayskip \the\abovedisplayskip \abovedisplayshortskip \the\abovedisplayshortskip \belowdisplayskip \the\belowdisplayskip \belowdisplayshortskip \the\belowdisplayshortskip \let\noexpand\@listi\noexpand\@listi@footnotesize }% \setlength{\@tempdima}{.66667\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \edef\scriptsize{% \noexpand\@setfontsize\noexpand\scriptsize {\the\@tempdima}{\the\@tempdimb}% }% \setlength{\@tempdima}{.5\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \edef\tiny{% \noexpand\@setfontsize\noexpand\tiny {\the\@tempdima}{\the\@tempdimb}% }% \setlength{\@tempdima}{1.2\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \edef\large{% \noexpand\@setfontsize\noexpand\large {\the\@tempdima}{\the\@tempdimb}% }% \setlength{\@tempdima}{1.44\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \edef\Large{% \noexpand\@setfontsize\noexpand\Large {\the\@tempdima}{\the\@tempdimb}% }% \setlength{\@tempdima}{1.728\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \edef\LARGE{% \noexpand\@setfontsize\noexpand\LARGE {\the\@tempdima}{\the\@tempdimb}% }% \setlength{\@tempdima}{2.074\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \edef\huge{% \noexpand\@setfontsize\noexpand\huge {\the\@tempdima}{\the\@tempdimb}% }% \setlength{\@tempdima}{2.488\@tempdimc}% \setlength{\@tempdimb}{\@tempb\@tempdima}% \edef\Huge{% \noexpand\@setfontsize\noexpand\Huge {\the\@tempdima}{\the\@tempdimb}% }% \normalsize% % \end{macrocode} % The KOMA files do not define \cmd{parindent} and other lengths related to the page dimensions (\cmd{textheight}, \cmd{headheight}, \cmd{headsep}, etc.) Anyway I think that some of these lengths are strictly linked to the font rather than to the page and text dimensions. Particularly \cmd{headheight}, whose value may cause a well known warning if \sty{fancyhdr} is loaded. So we definte the following new % lengths: % \baddition % \begin{macrocode} \setlength\parindent{\f@size pt}% \setlength\headheight{\dimexpr(\f@size pt+2pt)}% % \end{macrocode} % \eaddition % For these other lengths, all values are calculated proportionally to the main font. I took the \file{bk11.clo} file as a reference point. Note that the differences of these lengths in the files \file{bk10.clo} \file{bk11.clo} and \file{bk12.clo} only affect \cmd{headsep}, \cmd{topskip} and \cmd{footskip}, which are not redefined here. % \baddition % \begin{macrocode} \setlength\smallskipamount{\dimexpr((\f@size pt+1pt)/4) \@plus 1\p@ \@minus 1\p@}% \setlength\medskipamount{\dimexpr((\f@size pt+1pt)/2) \@plus 2\p@ \@minus 2\p@}% \setlength\bigskipamount{\dimexpr(\f@size pt+1pt) \@plus 4\p@ \@minus 4\p@}% % \end{macrocode} % \eaddition % The following table shows the values of some specific lengths % defined by the pacakge, relative to some significant settings % of the main font and line spacing. The values are exressed in pt % and rounded to the second decimal place. % % \begin{small} % \newcolumntype{Y}{@{}S[table-column-width=1.04cm]} % \noindent\begin{tabular}{@{}m{3.7cm}@{\hskip2mm}YYYYYYYYYYY@{\hskip-2mm}} % \toprule % Normal size & 10 & 10.1 & 10.2 & 10.3 & 10.4 & 10.5 & 10.6 & 10.7 & 10.8 & 10.9 & 11\\ % Line spacing &12 &12.12 &12.24 &12.36 &12.48 &12.6 &12.72 &12.84 &12.96 &13.08 &13.2\\\midrule % \cmd{headheight} &12 &12.1 &12.2 &12.3 &12.4 &12.5 &12.6 &12.7 &12.8 &12.9 &13\\ % \cmd{parindent} &10 &10.1 &10.2 &10.3 &10.4 &10.5 &10.6 &10.7 &10.8 &10.9 &11\\ % \cmd{bigskipamount}\ \hfill$\pm$\SI{4}{pt} &11 &11.1 &11.2 &11.3 &11.4 &11.5 &11.6 &11.7 &11.8 &11.9 &12\\ % \cmd{medskipamount}\ \hfill$\pm$\SI{2}{pt} &5.5 &5.55 &5.6 &5.65 &5.7 &5.75 &5.8 &5.85 &5.9 &5.95 &6\\ % \cmd{smallskipamount}\ \hfill$\pm$\SI{1}{pt} &2.75 &2.78 &2.8 &2.82 &2.85 &2.88 &2.9 &2.93 &2.95 &2.98 &3\\ % \bottomrule % \end{tabular} % \end{small} % \begin{macrocode} \setlength{\@tempdimb}{\f@baselineskip}% \ctm@setlength{\parsep}% {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}% \ctm@setlength{\topsep}% {.6667\@tempdimb}{.1667\@tempdimb}{.3333\@tempdimb}% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listi\endcsname \endgroup \edef\@listi{\leftmargin\leftmargini \topsep \the\topsep \parsep \the\parsep \itemsep \parsep \if@tempswa\noexpand\@list@extra\fi }% \let\@listI\@listi \ctm@setlength{\parsep}% {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}% \ctm@setlength{\topsep}% {.3333\@tempdimb}{.1667\@tempdimb}{.1667\@tempdimb}% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listi\endcsname \endgroup \edef\@listi@small{\leftmargin\leftmargini \topsep \the\topsep \parsep \the\parsep \itemsep \parsep \if@tempswa\noexpand\@list@extra\fi }% \ctm@setlength{\parsep}% {.125\@tempdimb}{.0625\@tempdimb}{.0625\@tempdimb}% \ctm@setlength{\topsep}% {.25\@tempdimb}{.125\@tempdimb}{.125\@tempdimb}% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listi\endcsname \endgroup \edef\@listi@footnotesize{\leftmargin\leftmargini \topsep \the\topsep \parsep \the\parsep \itemsep \parsep \if@tempswa\noexpand\@list@extra\fi }% \ctm@setlength{\parsep}% {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}% \ctm@setlength{\topsep}% {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listii\endcsname \endgroup \edef\@listii{\leftmargin\leftmarginii \labelwidth=\dimexpr \leftmargin-\labelsep \topsep \the\topsep \parsep \the\parsep \itemsep \parsep \if@tempswa\noexpand\@list@extra\fi }% \ctm@setlength{\topsep}% {.1667\@tempdimb}{.0833\@tempdimb}{.0833\@tempdimb}% \setlength{\partopsep}{\z@ \@plus\z@ \@minus\p@}% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listiii\endcsname \endgroup \edef\@listiii{\leftmargin\leftmarginiii \labelwidth=\dimexpr \leftmargin-\labelsep \topsep \the\topsep \parsep \z@ \partopsep \the\partopsep \itemsep \topsep \if@tempswa\noexpand\@list@extra\fi }% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listiv\endcsname \endgroup \edef\@listiv{\leftmargin\leftmarginiv \labelwidth=\dimexpr \leftmargin-\labelsep\relax \if@tempswa\noexpand\@list@extra\fi }% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listv\endcsname \endgroup \edef\@listv{\leftmargin\leftmarginv \labelwidth=\dimexpr \leftmargin-\labelsep\relax \if@tempswa\noexpand\@list@extra\fi }% \@tempswafalse \begingroup \def\@list@extra{\aftergroup\@tempswatrue}% \csname @listvi\endcsname \endgroup \edef\@listvi{\leftmargin\leftmarginvi \labelwidth=\dimexpr \leftmargin-\labelsep\relax \if@tempswa\noexpand\@list@extra\fi }% \@listi \setlength{\@tempdimb}{\f@baselineskip}% \setlength{\footnotesep}{.555\@tempdimb}% \ctm@setlength{\skip\footins}% {.75\@tempdimb}{.3333\@tempdimb}{.1667\@tempdimb}% \ctm@setlength{\floatsep}% {\@tempdimb}{.1667\@tempdimb}{.1667\@tempdimb}% \ctm@setlength{\textfloatsep}% {1.6667\@tempdimb}{.1667\@tempdimb}{.3333\@tempdimb}% \setlength{\intextsep}{\floatsep}% \setlength{\dblfloatsep}{\floatsep}% \setlength{\dbltextfloatsep}{\textfloatsep}% \setlength{\@fptop}{\z@ \@plus 1fil}% \setlength{\@fpsep}{.6667\@tempdimb \@plus 2fil}% \setlength{\@fpbot}{\@fptop}% \setlength{\@dblfptop}{\@fptop}% \setlength{\@dblfpsep}{\@fpsep}% \setlength{\@dblfpbot}{\@fptop}% \ctm@setlength{\partopsep}{.2\@tempdimb}{.1\@tempdimb}{.1\@tempdimb}% } % \end{macrocode} % % \paragraph{Excerpt from \file{scrfontsizes.sty}} % % Here is a portion of the \sty{scrfontsizes} package. It simply provides the \cmd{generateclofile} command, without the KOMA-related definitions. There are no reserved names for the \file{.clo} files. The command name is a new name for the KOMA \cmd{generatefontfile}. In fact, what the command generates, is a \file{.clo} file. % \begin{macrocode} \newcommand*{\generateclofile}[1]{% \kernel@ifnextchar [{\@generatefontfile{#1}}{\@@generatefontfile{#1}}% } \newcommand*{\@generatefontfile}{} \def\@generatefontfile#1[#2]#3{% \begingroup % \end{macrocode} % At least starting with version 3.31 of the \sty{scrfontsizes} package % the code of the \cmd{@generatefontfile} and \cmd{@@generatefontfile} % commands sets the \cmd{parskip} value to |0pt|. We also use |[#2]| % in place of |[{#2}]| for the optional argument of \cmd{changefontsize} % used immediately below. % \begin{macrocode} \setlength{\parskip}{0pt}% \changefontsize[#2]{#3}% \generate@fontfile{#1}{#3}% \endgroup } \newcommand\@@generatefontfile[2]{% \begingroup \setlength{\parskip}{0pt}% \changefontsize{#2}% \generate@fontfile{#1}{#2}% \endgroup } \newcommand*{\@@@generatefontfile}[2][]{} \newcommand*{\@fontfile}{} \let\@fontfile\@mainaux \newcommand*{\generate@fontfile}[2]{% \def\@ind{\space\space}% \immediate\openout\@fontfile #1#2.clo \immediate\write\@fontfile{\@percentchar^^J% \@percentchar\space This is file `#1#2.clo', generated with^^J% % \end{macrocode} % In the next three lines we only replace `scrfontsizes' with `fontsize' % and `Markus Kohm' with `Ivan Valbusa', in order to get the correc informations % in the .log file. % \begin{macrocode} \@percentchar\space fontsize \csname ver@fontsize.\@pkgextension\endcsname,^^J% \@percentchar\space Copyright (c) Ivan Valbusa.^^J% \@percentchar^^J% \string\ProvidesFile{#1#2.clo}[% \the\year/\ifnum\month<10 0\fi\the\month/\ifnum\day<10 0\fi\the\day% \space generated font size class option (#2)]}% \immediate\write\@fontfile{% \string\def\string\normalsize{\@percentchar^^J% \@ind\string\@setfontsize\string\normalsize{\f@size}{\f@baselineskip}% \@percentchar^^J% \@ind\string\abovedisplayskip\space \the\abovedisplayskip^^J% \@ind\string\abovedisplayshortskip\space \the\abovedisplayshortskip^^J% \@ind\string\belowdisplayskip\space \the\belowdisplayskip^^J% \@ind\string\belowdisplayshortskip\space \the\belowdisplayshortskip^^J% \@ind\string\let\string\@listi\string\@listI^^J% }\@percentchar% }% \begingroup\small\@listi \immediate\write\@fontfile{% \string\def\string\small{\@percentchar^^J% \@ind\string\@setfontsize\string\small{\f@size}{\f@baselineskip}% \@percentchar^^J% \@ind\string\abovedisplayskip\space \the\abovedisplayskip^^J% \@ind\string\abovedisplayshortskip\space \the\abovedisplayshortskip^^J% \@ind\string\belowdisplayskip\space \the\belowdisplayskip^^J% \@ind\string\belowdisplayshortskip\space \the\belowdisplayshortskip^^J% \@ind\string\def\string\@listi{\@percentchar^^J% \@ind\@ind\string\leftmargin\string\leftmargini^^J% \@ind\@ind\string\topsep \the\topsep^^J% \@ind\@ind\string\parsep \the\parsep^^J% \@ind\@ind\string\itemsep \string\parsep^^J% \@ind}\@percentchar^^J% }\@percentchar% }% \endgroup \begingroup\footnotesize\@listi \immediate\write\@fontfile{% \string\def\string\footnotesize{\@percentchar^^J% \@ind\string\@setfontsize\string\footnotesize{\f@size}{\f@baselineskip}% \@percentchar^^J% \@ind\string\abovedisplayskip\space \the\abovedisplayskip^^J% \@ind\string\abovedisplayshortskip\space \the\abovedisplayshortskip^^J% \@ind\string\belowdisplayskip\space \the\belowdisplayskip^^J% \@ind\string\belowdisplayshortskip\space \the\belowdisplayshortskip^^J% \@ind\string\def\string\@listi{\@percentchar^^J% \@ind\@ind\string\leftmargin\string\leftmargini^^J% \@ind\@ind\string\topsep \the\topsep^^J% \@ind\@ind\string\parsep \the\parsep^^J% \@ind\@ind\string\itemsep \string\parsep^^J% \@ind}\@percentchar^^J% }\@percentchar% }% \endgroup \begingroup\scriptsize \immediate\write\@fontfile{% \string\def\string\scriptsize{% \string\@setfontsize\string\scriptsize{\f@size}{\f@baselineskip}% }\@percentchar% }% \endgroup \begingroup\tiny \immediate\write\@fontfile{% \string\def\string\tiny{% \string\@setfontsize\string\tiny{\f@size}{\f@baselineskip}% }\@percentchar% }% \endgroup \begingroup\large \immediate\write\@fontfile{% \string\def\string\large{% \string\@setfontsize\string\large{\f@size}{\f@baselineskip}% }\@percentchar% }% \endgroup \begingroup\Large \immediate\write\@fontfile{% \string\def\string\Large{% \string\@setfontsize\string\Large{\f@size}{\f@baselineskip}% }\@percentchar% }% \endgroup \begingroup\LARGE \immediate\write\@fontfile{% \string\def\string\LARGE{% \string\@setfontsize\string\LARGE{\f@size}{\f@baselineskip}% }\@percentchar% }% \endgroup \begingroup\huge \immediate\write\@fontfile{% \string\def\string\huge{% \string\@setfontsize\string\huge{\f@size}{\f@baselineskip}% }\@percentchar% }% \endgroup \begingroup\Huge \immediate\write\@fontfile{% \string\def\string\Huge{% \string\@setfontsize\string\Huge{\f@size}{\f@baselineskip}% }\@percentchar% }% \endgroup \immediate\write\@fontfile{\string\normalsize}% % \end{macrocode} % The new lengths previously defined are recalled here and written in the .clo file % if the \cmd{generateclofile} command is used. % \baddition % \begin{macrocode} \begingroup \immediate\write\@fontfile{% \string\setlength{\string\parindent}{\the\parindent}^^J% \string\setlength{\string\headheight}{\the\headheight}^^J% \string\setlength{\string\smallskipamount}{\the\smallskipamount}^^J% \string\setlength{\string\medskipamount}{\the\medskipamount}^^J% \string\setlength{\string\bigskipamount}{\the\bigskipamount}^^J% }% \endgroup % \end{macrocode} % \eaddition % \begin{macrocode} \immediate\write\@fontfile{% \string\setlength{\string\footnotesep}{\the\footnotesep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\skip\string\footins}{\the\skip\footins}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\floatsep}{\the\floatsep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\textfloatsep}{\the\textfloatsep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\intextsep}{\the\intextsep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\dblfloatsep}{\the\dblfloatsep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\dbltextfloatsep}{\the\dbltextfloatsep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\@fptop}{\the\@fptop}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\@fpsep}{\the\@fpsep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\@fpbot}{\the\@fpbot}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\@dblfptop}{\the\@dblfptop}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\@dblfpsep}{\the\@dblfpsep}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\@dblfpbot}{\the\@dblfpbot}\@percentchar }% \immediate\write\@fontfile{% \string\setlength{\string\partopsep}{\the\partopsep}\@percentchar }% \begingroup \@listi \immediate\write\@fontfile{% \string\def\string\@listi{\@percentchar^^J% \@ind\string\leftmargin\string\leftmargini^^J% \@ind\string\topsep \the\topsep^^J% \@ind\string\parsep \the\parsep^^J% \@ind\string\itemsep \string\parsep^^J% }\@percentchar }% \endgroup \immediate\write\@fontfile{% \string\let\string\@listI\string\@listi }% \begingroup \@listii \immediate\write\@fontfile{% \string\def\string\@listii{\@percentchar^^J% \@ind\string\leftmargin\string\leftmarginii^^J% \@ind\string\labelwidth\string\leftmarginii^^J% \@ind\string\advance\string\labelwidth-\string\labelsep^^J% \@ind\string\topsep \the\topsep^^J% \@ind\string\parsep \the\parsep^^J% \@ind\string\itemsep \string\parsep^^J% }\@percentchar }% \endgroup \begingroup \@listiii \immediate\write\@fontfile{% \string\def\string\@listiii{\@percentchar^^J% \@ind\string\leftmargin\string\leftmarginiii^^J% \@ind\string\labelwidth\string\leftmarginiii^^J% \@ind\string\advance\string\labelwidth-\string\labelsep^^J% \@ind\string\topsep \the\topsep^^J% \@ind\string\parsep \the\parsep^^J% \@ind\string\partopsep \the\partopsep^^J% \@ind\string\itemsep \string\topsep^^J% }\@percentchar }% \endgroup \begingroup \@listiv \immediate\write\@fontfile{% \string\def\string\@listiv{\@percentchar^^J% \@ind\string\leftmargin\string\leftmarginiv^^J% \@ind\string\labelwidth\string\leftmarginiv^^J% \@ind\string\advance\string\labelwidth-\string\labelsep^^J% }\@percentchar }% \endgroup \begingroup \@listv \immediate\write\@fontfile{% \string\def\string\@listv{\@percentchar^^J% \@ind\string\leftmargin\string\leftmarginv^^J% \@ind\string\labelwidth\string\leftmarginv^^J% \@ind\string\advance\string\labelwidth-\string\labelsep^^J% }\@percentchar }% \endgroup \begingroup \@listvi \immediate\write\@fontfile{% \string\def\string\@listvi{\@percentchar^^J% \@ind\string\leftmargin\string\leftmarginvi^^J% \@ind\string\labelwidth\string\leftmarginvi^^J% \@ind\string\advance\string\labelwidth-\string\labelsep^^J% }\@percentchar }% \endgroup \immediate\write\@fontfile{% \string\@ifundefined{@list@extra}{}{\@percentchar^^J% \string\expandafter\string\ifnum\string\scr@v@is@ge{3.17}% \string\par@updaterelative\string\fi^^J% \@ind\string\l@addto@macro{\string\@listi}{\string\@list@extra}% \@percentchar^^J% \@ind\string\let\string\@listI=\string\@listi^^J% \@ind\string\l@addto@macro{\string\@listii}{\string\@list@extra}% \@percentchar^^J% \@ind\string\l@addto@macro{\string\@listiii}{\string\@list@extra}% \@percentchar^^J% \@ind\string\l@addto@macro{\string\footnotesize}{\string\protect \string\add@extra@listi{ftns}}\@percentchar^^J% \@ind\string\l@addto@macro{\string\small}{\string\protect \string\add@extra@listi{sml}}\@percentchar^^J% }\@percentchar^^J% \string\@listi^^J% \string\endinput^^J% \@percentchar^^J% \@percentchar\space End of file `#1#2.clo'. } \immediate\closeout\@fontfile } \@onlypreamble\generateclofile % \end{macrocode} % We will now define some internal commands to test the package functions. % \baddition % \begin{macrocode} \def\fontsize@lipsum{As any dedicated reader can clearly see, the Ideal of practical reason is a representation of, as far as I know, the things in themselves; as I have shown elsewhere, the phenomena should only be used as a canon for our understanding. The paralogisms of practical reason are what first give rise to the architectonic of practical reason. As will be shown, reason would thereby be made to contradict.} \chardef\fsbslash=`\\ % Thanks to @Werner (https://tex.stackexchange.com/a/87423/231952) \newcommand{\sizesamples}[1]{% \def\nextitem{\par}% Separator \renewcommand*{\do}[1]{\nextitem\bgroup\csname##1\endcsname \noindent\textbf{\csname ##1\endcsname \texttt{\fsbslash ##1}: \f@size pt on \the\baselineskip} \fontsize@lipsum\par\egroup }% How to process each item \docsvlist{#1}% Process list } \newcommand{\printfontsize}[2][]{% \changefontsize[#1]{#2} \sizesamples{tiny,scriptsize,footnotesize,small, normalsize,large,Large,LARGE,huge,Huge}} % \end{macrocode} % \eaddition % \iffalse % % \fi % % \iffalse %<*bib> @manual{xkeyval, title = {The \textsf{xkeyval} package}, subtitle = {Extension of the keyval package}, author = {Adriaens, Hendri}, url = {http://www.ctan.org/pkg/xkeyval}, urldate = {2020-07-05}, date = {2014-03-12}, version = {2.7a} } @manual{etoolbox, title = {The \sty{etoolbox} Package. An e-\TeX{} Toolbox for Class and Package Authors}, author = {Philipp Lehman and Joseph Wright}, url = {http://www.ctan.org/pkg/etoolbox}, urldate = {2020-07-05}, date = {2019-09-21}, version = {2.5h} } @manual{koma, title = {KOMA -- Script. A versatile \LaTeXe{} bundle}, author = {Frank Neukam and Markus Kohm and Axel Kielhorn}, url = {http://www.ctan.org/pkg/koma-script}, urldate = {2020-07-05}, date = {2020-04-19}, version = {3.30} } % % \fi % \Finale