summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-06 22:32:42 +0000
committerKarl Berry <karl@freefriends.org>2021-02-06 22:32:42 +0000
commitf79993ce1baaff40acde1ac02130abefc6b0e0ef (patch)
tree7c20531c9b80df2ec73181eefd999046f80ac01b /Master/texmf-dist/source/latex
parent39378a05890e8acd64706acf9e74410d82bf96a1 (diff)
fontsize (6feb21)
git-svn-id: svn://tug.org/texlive/trunk@57648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/fontsize/fontsize.dtx501
1 files changed, 406 insertions, 95 deletions
diff --git a/Master/texmf-dist/source/latex/fontsize/fontsize.dtx b/Master/texmf-dist/source/latex/fontsize/fontsize.dtx
index 3d3d31f92f9..983eb465213 100644
--- a/Master/texmf-dist/source/latex/fontsize/fontsize.dtx
+++ b/Master/texmf-dist/source/latex/fontsize/fontsize.dtx
@@ -56,7 +56,7 @@ This work has the LPPL maintenance status "author-maintained".
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{fontsize}
%<*package>
- [2021/01/31 v0.5 'fontsize' package. Set main font sizes (Ivan Valbusa)]
+ [2021/02/06 v0.6 'fontsize' package. Set main font sizes (Ivan Valbusa)]
%</package>
%<*driver>
\documentclass[12pt]{ltxdoc}
@@ -86,6 +86,7 @@ This work has the LPPL maintenance status "author-maintained".
\let\cs\relax
\let\cmd\relax
\usepackage{ltxdockit}
+\usepackage{kantlipsum}
%--------------------------------------------------------
% FONTS
%--------------------------------------------------------
@@ -96,7 +97,6 @@ This work has the LPPL maintenance status "author-maintained".
\usepackage[cochineal,bigdelims,cmintegrals,vvarbb]{newtxmath}
\usepackage[cal=boondoxo]{mathalfa}
\usepackage{manfnt}
-\usepackage{lettrine}
%--------------------------------------------------------
% LAYOUT
%--------------------------------------------------------
@@ -199,7 +199,7 @@ This work has the LPPL maintenance status "author-maintained".
%</driver>
% \fi
%
-% \CheckSum{2372}
+% \CheckSum{2991}
%
% \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
@@ -218,7 +218,8 @@ This work has the LPPL maintenance status "author-maintained".
% Right brace \} Tilde \~}
%
%
-% \changes{v0.5}{2021/01/31}{New font sizing commands \cmd{\meta{cmdname}r}, \cmd{\meta{cmdname}rr}, \cmd{\meta{cmdname}rrr}. New command \cmd{printsamples}. Updated documentation.}
+% \changes{v0.6}{2021/02/06}{New font sizing commands from \cmd{small} down. Updated documentation.}
+% \changes{v0.5}{2021/01/31}{New font sizing commands from \cmd{normalsize} up. New command \cmd{printsamples}. Updated documentation.}
% \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.}
@@ -310,7 +311,8 @@ This work has the LPPL maintenance status "author-maintained".
%
% \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.
+% for the main font of the document and to adjust the line spacing accordingly.
+% It also provides new font sizing commands and lets you generate your own \file{.clo} file for better tuning.
% \end{abstract}
%
% \tableofcontents
@@ -327,10 +329,10 @@ This work has the LPPL maintenance status "author-maintained".
% \section*{Caveat}
%^^A---------------------------------------------------------------------
%
-% Although effective with any value for the \meta{fontsize} (as long as the font
+% Although effective with any value of the font size (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.
+% In fact 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---------------------------------------------------------------------
@@ -357,11 +359,11 @@ This work has the LPPL maintenance status "author-maintained".
% \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
+% 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}}
+% \optitem[fontsize]{cloname}{\meta{name}}
%
% Sets to \meta{name} the name prefix of the \file{.clo} file generated
% by \cmd{generateclofile} (see below).
@@ -379,7 +381,7 @@ This work has the LPPL maintenance status "author-maintained".
% 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
+% 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:
@@ -398,17 +400,17 @@ This work has the LPPL maintenance status "author-maintained".
% 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}}
+% If \opt{cloname=\meta{name}} \textit{and} \opt{fontsize=\meta{fontsize}},
% the generated file will be automatically used to setup the main sizes.
%
% \alert \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}
+% file will be overwrittern.}
%
%\begin{latexcode}
%\begin{verbatim}
-%\usepackage[cloname=fs,fontsize=11.5pt]{fontsize} % loads fs11.5pt.clo
-% \generateclofile{fs}[13.5pt]{11.5pt} % creates fs11.5pt.clo
+%\usepackage[cloname=fs,fontsize=11.5]{fontsize} % loads fs11.5.clo
+% \generateclofile{fs}[13.5]{11.5} % creates fs11.5.clo
%\end{verbatim}
%\end{latexcode}
%
@@ -416,7 +418,7 @@ This work has the LPPL maintenance status "author-maintained".
%
% A command thought to test the \sty{fontsize} settings.
% It prints a text sample for every size given in the third optional argument.
-% If this argument is omitted it prints a sample for each available size.
+% If this argument is omitted, it prints a sample for each available size.
%
%\begin{latexcode}
%\begin{verbatim}
@@ -427,26 +429,77 @@ This work has the LPPL maintenance status "author-maintained".
%
% \end{ltxsyntax}
%^^A---------------------------------------------------------------------
-% \section{New sizing commands}\label{sec:sizingcmd}
+% \section{New font sizing commands}\label{sec:sizingcmd}
%^^A--------------------------------------------------------------------
-% The packages provides three variants for each size bigger then \cmd{normalsize}:
+% The package provides three additional font sizing commands for each standard size:
%
-%\newcolumntype{L}{>{\color{sufred}}l}
-%\begin{tabular}{@{}LLLLLL}
-% \cmd{normalsizer} & \cmd{larger} & \cmd{Larger} & \cmd{LARGEr}& \cmd{huger}& \cmd{Huger}\\
-% \cmd{normalsizerr} & \cmd{largerr} & \cmd{Largerr} & \cmd{LARGErr}& \cmd{hugerr}& \cmd{Hugerr}\\
-% \cmd{normalsizerrr} & \cmd{largerrr} & \cmd{Largerr} & \cmd{LARGErrr}& \cmd{hugerrr}& \cmd{Hugerrr}\\
+%\def\fshw{Lipsum}
+%\newcommand{\tcmd}[1]{\textcolor{sufred}{\cmd{#1}}}
+%\begin{center}
+%\begin{tabular}{@{}llll}
+%\cmd{tiny} & \tiny \fshw &\cmd{large} & \large \fshw \\
+%\tcmd{tinyr} & \tinyr \fshw &\tcmd{larger} & \larger \fshw \\
+%\tcmd{tinyrr} & \tinyrr \fshw &\tcmd{largerr} & \largerr \fshw \\
+%\tcmd{tinyrrr} & \tinyrrr \fshw &\tcmd{largerrr} & \largerrr \fshw \\
+%\cmd{scriptsize} & \scriptsize \fshw &\cmd{Large} & \Large \fshw \\
+%\tcmd{scriptsizer} & \scriptsizer \fshw &\tcmd{Larger} & \Larger \fshw \\
+%\tcmd{scriptsizerr} & \scriptsizerr \fshw &\tcmd{Largerr} & \Largerr \fshw \\
+%\tcmd{scriptsizerrr} & \scriptsizerrr \fshw &\tcmd{Largerrr} & \Largerrr \fshw \\
+%\cmd{footnotesize} & \footnotesize \fshw &\cmd{LARGE} & \LARGE \fshw \\
+%\tcmd{footnotesizer} & \footnotesizer \fshw &\tcmd{LARGEr} & \LARGEr \fshw \\
+%\tcmd{footnotesizerr} & \footnotesizerr \fshw &\tcmd{LARGErr} & \LARGErr \fshw \\
+%\tcmd{footnotesizerrr} & \footnotesizerrr \fshw &\tcmd{LARGErrr} & \LARGErrr \fshw \\
+%\cmd{small} & \small \fshw &\cmd{huge} & \huge \fshw \\
+%\tcmd{smallr} & \smallr \fshw &\tcmd{huger} & \huger \fshw \\
+%\tcmd{smallrr} & \smallrr \fshw &\tcmd{huger} & \hugerr \fshw \\
+%\tcmd{smallrrr} & \smallrrr \fshw &\tcmd{huger} & \hugerrr \fshw \\
+%\cmd{normalsize} & \normalsize \fshw &\cmd{Huge} & \Huge \fshw \\
+%\tcmd{normalsizer} & \normalsizer \fshw &\tcmd{Huger} & \Huger \fshw \\
+%\tcmd{normalsizerr} & \normalsizerr \fshw &\tcmd{Hugerr} & \Hugerr \fshw \\
+%\tcmd{normalsizerrr} & \normalsizerrr \fshw &\tcmd{Hugerr} & \Hugerrr \fshw
%\end{tabular}
+%\end{center}
+%
+% \begin{normalsize}
+%\alert If you want these commands to work as expected, the font must be
+% smoothly scalable. This is the case of many Type 1 and Open Type fonts.
+% Anyway, if the font has optical sizes, unusual things can happen:
+% some larger sizes may appear smaller. For example, with the Latin Modern 12\,pt typeface a similar situation can be encountered:\medskip
+%
+% \begingroup
+% \centering
+% \fontfamily{lmr}\selectfont
+%\begin{minipage}[b]{8cm}
+% \begin{tabular}[b]{lll}
+% \tcmd{largerr} & \texttlf{15.84\,pt} &\largerr Hello world \\
+% \tcmd{larger} & \texttlf{15.12\,pt} &\larger Hello world \\
+% \tcmd{large} & \texttlf{14.40\,pt} &\large Hello world
+% \end{tabular}
+%\end{minipage}
+% \tikz[overlay]{\draw[->,draw=red,very thick] (0.17,1.25) -- (3.7,1.4);}
+% \scalebox{3}{\large H} \scalebox{3}{\larger H} \scalebox{3}{\largerr H}
+%
+% \endgroup
+% \end{normalsize}
+% \medskip
+%
+% In fact the font used for the \cmd{larger} `Hello world' is bigger than
+% that used for the \cmd{large} one. This optical effect is due to the minor
+% thickness of the stems, which makes the words appear shorter and clearer,
+% but not less high (as you can see in the figure on the
+% right which shows the letter H appropriately scaled to see the
+% differences better).
+%
%^^A---------------------------------------------------------------------
% \section{Some text samples}\label{sec:example}
%
%^^A--------------------------------------------------------------------
%
-% Below you can see some text samples scaled proportionally
-% to match the different values of the selected normal size and line spacing.
+%^^A Below you can see some text samples scaled proportionally
+%^^A to match the different values of the selected normal size and line spacing.
%
-% \printsamples{13pt}{11pt}[normalsizer,normalsizerr,normalsizerrr]
-% \printsamples{13.5pt}{12pt}[large,larger]
+% \printsamples{13pt}{11pt}[normalsizerr,normalsizerrr,large]
+% \printsamples{13.4pt}{11.7pt}[normalsizerr,normalsizerrr]
%
% \nocite{xkeyval,etoolbox}
%
@@ -463,25 +516,21 @@ This work has the LPPL maintenance status "author-maintained".
%\alert \textcolor{DarkBlue}{The parts added to the basic structure of \file{scrextend} and \file{scrfontsizes} are highlighted in blue.}
%
%\noindent 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.
-%
+% is required to execute \cmd{AtEndOfPackage}. It is probably not necessary
+% but for the moment I prefer to take advantage of it. Only a new package
+% option called \opt{cloname} is defined.
% \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}}
+\DeclareOptionX{cloname}[fontsize]{\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}.
+% The value of \cmd{|@|fontsizefilebase} is set to \texttt{fontsize} instead of \texttt{scrsize}.
% \begin{macrocode}
\DeclareOptionX{fontsize}[10]{%
\expandafter\@defaultunits\expandafter\@tempdima#1 pt\relax\@nnil
@@ -653,34 +702,161 @@ This work has the LPPL maintenance status "author-maintained".
{\the\@tempdima}{\the\@tempdimb}%
}%
% \end{macrocode}
-% Here we define some new font sizing commands. There are three variants
-% for each standard command starting from \cmd{normalsize} to \cmd{Huge}:
+% We will now define some new font sizing commands. There are three variants
+% for each standard command:
% \cmd{\meta{cmd}r} > \cmd{\meta{cmd}rr} > \cmd{\meta{cmd}rrr}.
% Every level is scaled proportionally in order to preserve the default
% value of the corresponding standard command.
% \baddition
-% \paragraph{\color{black}Definition of \cmd{normalsizer}, \cmd{normalsizerr}, \cmd{normalsizerrr}. Scale factor: 0.05.}
+% \begin{macrocode}
+ \def\fontsize@pre{%
+ \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}%
+ }
+ \def\fontsize@app{%
+ \abovedisplayskip \the\abovedisplayskip
+ \abovedisplayshortskip \the\abovedisplayshortskip
+ \belowdisplayskip \the\belowdisplayskip
+ \belowdisplayshortskip \the\belowdisplayshortskip
+ }
+% \end{macrocode}
+% {\color{black}Definition of \cmd{smallr}, \cmd{smallrr}, \cmd{smallrrr}. Scale factor: 0,021875.}
+% \begin{macrocode}
+ \setlength{\@tempdima}{0.934375\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
+ \edef\smallr{%
+ \noexpand\@setfontsize\noexpand\smallr
+ {\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listi@small
+ }%
+ \setlength{\@tempdima}{0.95625\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
+ \edef\smallrr{%
+ \noexpand\@setfontsize\noexpand\smallrr
+ {\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listi@small
+ }%
+ \setlength{\@tempdima}{0.978125\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
+ \edef\smallrrr{%
+ \noexpand\@setfontsize\noexpand\smallrrr
+ {\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listi@small
+ }%
+% \end{macrocode}
+% {\color{black}Definition of \cmd{footnotesizer}, \cmd{footnotesizerr}, \cmd{footnotesizerrr}. Scale factor: 0.01979.}
+% \begin{macrocode}
+ \setlength{\@tempdima}{0.85313\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
+ \edef\footnotesizer{%
+ \noexpand\@setfontsize\noexpand\footnotesizer
+ {\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listi@footnotesize
+ }%
+ \setlength{\@tempdima}{0.87292\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
+ \edef\footnotesizerr{%
+ \noexpand\@setfontsize\noexpand\footnotesizerr
+ {\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listi@footnotesize
+ }%
+ \setlength{\@tempdima}{0.89271\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
+ \edef\footnotesizerrr{%
+ \noexpand\@setfontsize\noexpand\footnotesizerrr
+ {\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listi@footnotesize
+ }%
+% \end{macrocode}
+% {\color{black}Definition of \cmd{scriptsizer}, \cmd{scriptsizerr}, \cmd{scriptsizerrr}. Scale factor: 0,0416675.}
+% \begin{macrocode}
+ \setlength{\@tempdima}{0.7083375\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\scriptsizer{%
+ \noexpand\@setfontsize\noexpand\scriptsizer
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{0.750005\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\scriptsizerr{%
+ \noexpand\@setfontsize\noexpand\scriptsizerr
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{0.7916725\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\scriptsizerrr{%
+ \noexpand\@setfontsize\noexpand\scriptsizerrr
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+% \end{macrocode}
+% {\color{black}Definition of \cmd{tinyr}, \cmd{tinyrr}, \cmd{tinyrrr}. Scale factor: 0.0416675.}
+% \begin{macrocode}
+ \setlength{\@tempdima}{0.5416675\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\tinyr{%
+ \noexpand\@setfontsize\noexpand\tinyr
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{0.583335\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\tinyrr{%
+ \noexpand\@setfontsize\noexpand\tinyrr
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+ \setlength{\@tempdima}{0.6250025\@tempdimc}%
+ \setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \edef\tinyrrr{%
+ \noexpand\@setfontsize\noexpand\tinyrrr
+ {\the\@tempdima}{\the\@tempdimb}%
+ }%
+% \end{macrocode}
+% {\color{black}Definition of \cmd{normalsizer}, \cmd{normalsizerr}, \cmd{normalsizerrr}. Scale factor: 0.05.}
% \begin{macrocode}
\setlength{\@tempdima}{1.05\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
\edef\normalsizer{%
\noexpand\@setfontsize\noexpand\normalsizer
{\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listI
}%
\setlength{\@tempdima}{1.1\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
+ \fontsize@pre
\edef\normalsizerr{%
\noexpand\@setfontsize\noexpand\normalsizerr
{\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listI
}%
\setlength{\@tempdima}{1.15\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
\edef\normalsizerrr{%
+ \fontsize@pre
\noexpand\@setfontsize\noexpand\normalsizerrr
{\the\@tempdima}{\the\@tempdimb}%
+ \fontsize@app
+ \let\noexpand\@listi\noexpand\@listI
}%
% \end{macrocode}
-% \paragraph{\color{black}Definition of \cmd{larger}, \cmd{largerr}, \cmd{largerrr}. Scale factor: 0,06.}
+% {\color{black}Definition of \cmd{larger}, \cmd{largerr}, \cmd{largerrr}. Scale factor: 0,06.}
% \begin{macrocode}
\setlength{\@tempdima}{1.26\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
@@ -701,7 +877,7 @@ This work has the LPPL maintenance status "author-maintained".
{\the\@tempdima}{\the\@tempdimb}%
}%
% \end{macrocode}
-% \paragraph{\color{black}Definition of \cmd{Larger}, \cmd{Largerr}, \cmd{Largerrr}. Scale factor: 0,072.}
+% {\color{black}Definition of \cmd{Larger}, \cmd{Largerr}, \cmd{Largerrr}. Scale factor: 0,072.}
% \begin{macrocode}
\setlength{\@tempdima}{1.512\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
@@ -722,7 +898,7 @@ This work has the LPPL maintenance status "author-maintained".
{\the\@tempdima}{\the\@tempdimb}%
}%
% \end{macrocode}
-% \paragraph{\color{black}Definition of \cmd{LARGEr}, \cmd{LARGErr}, \cmd{LARGErrr}. Scale factor: 0,0865.}
+% {\color{black}Definition of \cmd{LARGEr}, \cmd{LARGErr}, \cmd{LARGErrr}. Scale factor: 0,0865.}
% \begin{macrocode}
\setlength{\@tempdima}{1.8145\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
@@ -743,7 +919,7 @@ This work has the LPPL maintenance status "author-maintained".
{\the\@tempdima}{\the\@tempdimb}%
}%
% \end{macrocode}
-% \paragraph{\color{black}Definition of \cmd{huger}, \cmd{hugerr}, \cmd{hugerrr}. Scale factor: 0,1035.}
+% {\color{black}Definition of \cmd{huger}, \cmd{hugerr}, \cmd{hugerrr}. Scale factor: 0,1035.}
% \begin{macrocode}
\setlength{\@tempdima}{2.1775\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
@@ -764,7 +940,7 @@ This work has the LPPL maintenance status "author-maintained".
{\the\@tempdima}{\the\@tempdimb}%
}%
% \end{macrocode}
-% \paragraph{\color{black}Definition of \cmd{Huger}, \cmd{Hugerr}, \cmd{Hugerrr}. Scale factor: 0.123.}
+% {\color{black}Definition of \cmd{Huger}, \cmd{Hugerr}, \cmd{Hugerrr}. Scale factor: 0.123.}
% \begin{macrocode}
\setlength{\@tempdima}{2.611\@tempdimc}%
\setlength{\@tempdimb}{\@tempb\@tempdima}%
@@ -789,28 +965,27 @@ This work has the LPPL maintenance status "author-maintained".
% \begin{macrocode}
\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:
+% 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 dimensions of the page and the text, particularly \cmd{headheight}, whose value may cause a well known warning if \sty{fancyhdr} is loaded. So we define the following new lengths:
% \baddition
% \begin{macrocode}
-\setlength\parindent{\f@size pt}%
-\setlength\headheight{\dimexpr(\f@size pt+2pt)}%
+\setlength\parindent{\@tempdimb}%
+\setlength\headheight{\dimexpr(\@tempdimb+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.
+% For the following 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@}%
+\setlength\smallskipamount{\dimexpr((\@tempdimb+1pt)/4) \@plus 1\p@ \@minus 1\p@}%
+\setlength\medskipamount{\dimexpr((\@tempdimb+1pt)/2) \@plus 2\p@ \@minus 2\p@}%
+\setlength\bigskipamount{\dimexpr(\@tempdimb+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
+% defined by the package, in relation to some significant settings
+% of the main font and line spacing. The values are expressed in pt
% and rounded to the second decimal place.
%
-% \begin{small}
+% \begin{footnotesizer}
% \newcolumntype{Y}{@{}S[table-column-width=1.04cm]}
% \noindent\begin{tabular}{@{}m{3.7cm}@{\hskip2mm}YYYYYYYYYYY@{\hskip-2mm}}
% \toprule
@@ -823,7 +998,7 @@ This work has the LPPL maintenance status "author-maintained".
% \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}
+% \end{footnotesizer}
% \begin{macrocode}
\setlength{\@tempdimb}{\f@baselineskip}%
\ctm@setlength{\parsep}%
@@ -955,7 +1130,7 @@ This work has the LPPL maintenance status "author-maintained".
%
% \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.
+% 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}}%
@@ -964,7 +1139,7 @@ This work has the LPPL maintenance status "author-maintained".
\def\@generatefontfile#1[#2]#3{%
\begingroup
% \end{macrocode}
-% At least starting with version 3.31 of the \sty{scrfontsizes} package
+% At least starting from version 3.31 of \sty{scrfontsizes},
% 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}
@@ -992,7 +1167,7 @@ This work has the LPPL maintenance status "author-maintained".
\@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
+% and `Markus Kohm' with `Ivan Valbusa', in order to get the correct information
% in the .log file.
% \begin{macrocode}
\@percentchar\space fontsize
@@ -1103,25 +1278,142 @@ This work has the LPPL maintenance status "author-maintained".
% written in the .clo file if the \cmd{generateclofile} command is used.
% \baddition
% \begin{macrocode}
+ \begingroup\tinyr
+\immediate\write\@fontfile{%
+ \string\def\string\tinyr{%
+ \string\@setfontsize\string\tinyr{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+}%
+\endgroup
+\begingroup\tinyrr
+\immediate\write\@fontfile{%
+ \string\def\string\tinyrr{%
+ \string\@setfontsize\string\tinyrr{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+}%
+\endgroup
+\begingroup\tinyrrr
+\immediate\write\@fontfile{%
+ \string\def\string\tinyrrr{%
+ \string\@setfontsize\string\tinyrrr{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+}%
+ \endgroup
+ \begingroup\scriptsizer
+ \immediate\write\@fontfile{%
+ \string\def\string\scriptsizer{%
+ \string\@setfontsize\string\scriptsizer{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+ \begingroup\scriptsizerr
+ \immediate\write\@fontfile{%
+ \string\def\string\scriptsizerr{%
+ \string\@setfontsize\string\scriptsizerr{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+\endgroup
+ \begingroup\scriptsizerrr
+ \immediate\write\@fontfile{%
+ \string\def\string\scriptsizerrr{%
+ \string\@setfontsize\string\scriptsizerrr{\f@size}{\f@baselineskip}%
+ }\@percentchar%
+ }%
+ \endgroup
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\fs@appnormal{
+ \@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%
+}
+\def\fs@appsmall{%
+ \@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%
+}
+ \begingroup\smallr\@listi
+\immediate\write\@fontfile{%
+ \string\def\string\smallr{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\smallr{\f@size}{\f@baselineskip}%
+ \fs@appsmall%
+ }\@percentchar%
+}%
+\endgroup
+\begingroup\smallrr\@listi
+\immediate\write\@fontfile{%
+ \string\def\string\smallrr{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\smallrr{\f@size}{\f@baselineskip}%
+ \fs@appsmall%
+ }\@percentchar%
+}%
+\endgroup
+\begingroup\smallrrr\@listi
+\immediate\write\@fontfile{%
+ \string\def\string\smallrrr{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\smallrrr{\f@size}{\f@baselineskip}%
+ \fs@appsmall%
+ }\@percentchar%
+}%
+\endgroup
+\begingroup\footnotesizer\@listi
+\immediate\write\@fontfile{%
+ \string\def\string\footnotesizer{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\footnotesizer{\f@size}{\f@baselineskip}%
+ \fs@appsmall%
+ }\@percentchar%
+}%
+\endgroup
+\begingroup\footnotesizerr\@listi
+\immediate\write\@fontfile{%
+ \string\def\string\footnotesizerr{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\footnotesizerr{\f@size}{\f@baselineskip}%
+ \fs@appsmall%
+ }\@percentchar%
+}%
+\endgroup
+\begingroup\footnotesizerrr\@listi
+\immediate\write\@fontfile{%
+ \string\def\string\footnotesizerrr{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\footnotesizerrr{\f@size}{\f@baselineskip}%
+ \fs@appsmall%
+ }\@percentchar%
+}%
+\endgroup
\begingroup\normalsizer
\immediate\write\@fontfile{%
- \string\def\string\normalsizer{%
- \string\@setfontsize\string\normalsizer{\f@size}{\f@baselineskip}%
+ \string\def\string\normalsizer{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\normalsizer{\f@size}{\f@baselineskip}%
+ \fs@appnormal%
}\@percentchar%
}%
\endgroup
\begingroup\normalsizerr
\immediate\write\@fontfile{%
- \string\def\string\normalsizerr{%
- \string\@setfontsize\string\normalsizerr{\f@size}{\f@baselineskip}%
- }\@percentchar%
+ \string\def\string\normalsizerr{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\normalsizerr{\f@size}{\f@baselineskip}%
+ \fs@appnormal%
+ }\@percentchar%
}%
\endgroup
\begingroup\normalsizerrr
\immediate\write\@fontfile{%
- \string\def\string\normalsizerrr{%
- \string\@setfontsize\string\normalsizerrr{\f@size}{\f@baselineskip}%
- }\@percentchar%
+ \string\def\string\normalsizerrr{\@percentchar^^J%
+ \@ind\string\@setfontsize\string\normalsizerrr{\f@size}{\f@baselineskip}%
+ \fs@appnormal%
+ }\@percentchar%
}%
\endgroup
\begingroup\larger
@@ -1172,6 +1464,7 @@ This work has the LPPL maintenance status "author-maintained".
\string\@setfontsize\string\Largerrr{\f@size}{\f@baselineskip}%
}\@percentchar%
}%
+\endgroup
\begingroup\LARGEr
\immediate\write\@fontfile{%
\string\def\string\LARGEr{%
@@ -1192,6 +1485,7 @@ This work has the LPPL maintenance status "author-maintained".
\string\@setfontsize\string\LARGErrr{\f@size}{\f@baselineskip}%
}\@percentchar%
}%
+\endgroup
\begingroup\huger
\immediate\write\@fontfile{%
\string\def\string\huger{%
@@ -1212,6 +1506,7 @@ This work has the LPPL maintenance status "author-maintained".
\string\@setfontsize\string\hugerrr{\f@size}{\f@baselineskip}%
}\@percentchar%
}%
+\endgroup
\begingroup\Huger
\immediate\write\@fontfile{%
\string\def\string\Huger{%
@@ -1232,6 +1527,7 @@ This work has the LPPL maintenance status "author-maintained".
\string\@setfontsize\string\Hugerrr{\f@size}{\f@baselineskip}%
}\@percentchar%
}%
+\endgroup
% \end{macrocode}
% \eaddition
% \begin{macrocode}
@@ -1392,45 +1688,60 @@ This work has the LPPL maintenance status "author-maintained".
\@onlypreamble\generateclofile
% \end{macrocode}
% We will now define some internal commands to test the package functions.
+% Since version 0.6 I have been using the \LaTeX 3 solution provided by
+% Enrico Gregorio in place of the previous macros based on \sty{etoolbox}.
% \baddition
% \begin{macrocode}
\ExplSyntaxOn
-\NewExpandableDocumentCommand{\getlength}{O{5}m}
+\NewDocumentCommand{\printsamples}
+{
+ m
+ m
+ O{tiny,tinyr,tinyrr,tinyrrr,
+ scriptsize,scriptsizer,scriptsizerr,scriptsizerrr,
+ footnotesize,footnotesizer,footnotesizerr,footnotesizerrr,
+ small,smallr,smallrr,smallrrr,
+ normalsize,normalsizer,normalsizerr,normalsizerrr,
+ large,larger,largerr,largerrr,
+ Large,Larger,Largerr,Largerrr,
+ LARGE,LARGEr,LARGErr,LARGErrr,
+ huge,huger,hugerr,hugerrr,
+ Huge,Huger,Hugerr,Hugerrr}
+}
{
- \fp_eval:n { round(#2,#1) }
+ \fontsize_printsamples:nnn { #1 } { #2 } { #3 }
}
-\ExplSyntaxOff
-\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
- 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{\csname ##1\endcsname \texttt{\fsbslash ##1}:
- \getlength[2]{\f@size}\,pt on \getlength[2]{\the\baselineskip}\,pt.} \fontsize@lipsum\par\egroup
- }% How to process each item
- \docsvlist{#1}% Process list
+% helper function to print the rounded sizes
+\cs_new:Nn \__fontsize_round_f:n
+{
+ \fp_eval:n { round(\use:c{f@#1},1) } pt
}
-\NewDocumentCommand \printsamples { m m O{
- normalsize,normalsizer,normalsizerr,normalsizerrr,
- large,larger,largerr,largerrr,
- Large,Larger,Largerr,Largerrr,
- LARGE,LARGEr,LARGErr,LARGErrr,
- huge,huger,hugerr,hugerrr,
- Huge,Huger,Hugerr,Hugerrr} }
+
+% the main function
+\cs_new_protected:Nn \fontsize_printsamples:nnn
{
- \changefontsize[#1]{#2}
- \subsubsection*{Text samples for #2 on #1}
- \sizesamples{#3}
+ % group to bound the font changes
+ \group_begin:
+ % set the size
+ \changefontsize[#1]{#2}\selectfont
+ % header
+ \subsubsection*{Text~samples~for~#2~on~#1}
+ % map through the desired sizes
+ \clist_map_inline:nn { #3 }
+ {
+ \use:c{##1} % set the font size
+ \noindent\texttt{\symbol{92}##1}:~ % print the font size command
+ \__fontsize_round_f:n {size}~ % print the size in points
+ \__fontsize_round_f:n {baselineskip}.~ % print the baseline skip in points
+ \kant[1][1-3] % sample text
+ \par\addvspace{\medskipamount} % finish up
+ }
+ % close the group
+ \group_end:
}
+\ExplSyntaxOff
% \end{macrocode}
% \eaddition
% \iffalse