From 1081587ed6ce2e64971782aa306741ba925790dc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 18 Mar 2021 21:13:56 +0000 Subject: fontsize (18mar21) (branch) git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58523 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/fontsize/fontsize.bib | 8 + Master/texmf-dist/doc/latex/fontsize/fontsize.pdf | Bin 393943 -> 399282 bytes .../texmf-dist/source/latex/fontsize/fontsize.dtx | 408 +++++++++++++-------- Master/texmf-dist/tex/latex/fontsize/fontsize.sty | 60 ++- 4 files changed, 283 insertions(+), 193 deletions(-) diff --git a/Master/texmf-dist/doc/latex/fontsize/fontsize.bib b/Master/texmf-dist/doc/latex/fontsize/fontsize.bib index 1200785e5fb..8a68ab48a3e 100644 --- a/Master/texmf-dist/doc/latex/fontsize/fontsize.bib +++ b/Master/texmf-dist/doc/latex/fontsize/fontsize.bib @@ -44,3 +44,11 @@ date = {2020-12-19}, version = {1.065 } } + +@manual{xfp, + title = {The \textit{xfp} package Floating Point Unit}, + author = {{The \LaTeX\ Project}}, + url = {https://www.ctan.org/pkg/xfp}, + urldate = {2021-03-14}, + date = {2021-03-12}, +} diff --git a/Master/texmf-dist/doc/latex/fontsize/fontsize.pdf b/Master/texmf-dist/doc/latex/fontsize/fontsize.pdf index 5642de57f85..37a1db0cfaf 100644 Binary files a/Master/texmf-dist/doc/latex/fontsize/fontsize.pdf and b/Master/texmf-dist/doc/latex/fontsize/fontsize.pdf differ diff --git a/Master/texmf-dist/source/latex/fontsize/fontsize.dtx b/Master/texmf-dist/source/latex/fontsize/fontsize.dtx index a7a75d6db68..a471f4c5ca3 100644 --- a/Master/texmf-dist/source/latex/fontsize/fontsize.dtx +++ b/Master/texmf-dist/source/latex/fontsize/fontsize.dtx @@ -56,16 +56,14 @@ This work has the LPPL maintenance status "author-maintained". %\NeedsTeXFormat{LaTeX2e}[2005/12/01] %\ProvidesPackage{fontsize} %<*package> - [2021/03/04 v0.8 'fontsize' package. Set main font sizes (Ivan Valbusa)] + [2021/03/14 v0.8.1 '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,tabu} -\usepackage{siunitx} -\usepackage{multicol} +\usepackage{fontsize} + \changefontsize[13.7]{11.7} %-------------------------------------------------------- % GRAPHICS %-------------------------------------------------------- @@ -117,6 +115,13 @@ This work has the LPPL maintenance status "author-maintained". \usepackage[autostyle]{csquotes} \usepackage[style=philosophy-classic]{biblatex} \addbibresource{fontsize.bib} +\usepackage{array} +\usepackage{booktabs} +\usepackage{tabu} +\usepackage{siunitx} +\usepackage{multicol} +\usepackage{longtable} +\usepackage{caption} %-------------------------------------------------------- % COMMANDS AND ENVIRONMENTS %-------------------------------------------------------- @@ -169,6 +174,73 @@ This work has the LPPL maintenance status "author-maintained". \end{multicols}} \makeatother % +% Commands for table 1 and 2 +% +\ExplSyntaxOn +\NewExpandableDocumentCommand{\getsize}{O{5}m} +{ + \fp_eval:n { round(#2,#1) } +} +\ExplSyntaxOff +\makeatletter +\def\tabfontsize{\fontsize{12}{14}\selectfont} +\def\fs@getsize#1{% + \edef\fs@value{% + \SI[ + detect-all = true, + round-mode = places, + round-precision = 2, + round-integer-to-decimal + ]{\getsize[2]{#1}}{}% + }% + \tabfontsize% + \fs@value% +} +\newcommand{\tabrowone}[1]{% + \tabfontsize + \texttt{\symbol{92}#1} + & + \changefontsize[9.6]{8}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[10.2]{8.5}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[10.8]{9}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[11.4]{9.5}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[12]{10}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[12.6]{10.5}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[13.2]{11}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[13.8]{11.5}\csname#1\endcsname\fs@getsize{\f@size} & + \changefontsize[14,4]{12}\csname#1\endcsname\fs@getsize{\f@size} + \\* + \rowfont{\color{black!70}} + & + \changefontsize[9.6]{8}\csname#1\endcsname\fs@getsize{\baselineskip} & + \changefontsize[10.2]{8.5}\csname#1\endcsname\fs@getsize{\baselineskip} & + \changefontsize[10.8]{9}\csname#1\endcsname\fs@getsize{\baselineskip} & + \changefontsize[11.4]{9.5}\csname#1\endcsname\fs@getsize{\baselineskip} & + \changefontsize[12]{10}\csname#1\endcsname\fs@getsize{\baselineskip} & + \changefontsize[12.6]{10.5}\csname#1\endcsname\fs@getsize{\baselineskip}& + \changefontsize[13.2]{11}\csname#1\endcsname\fs@getsize{\baselineskip} & + \changefontsize[13.8]{11.5}\csname#1\endcsname\fs@getsize{\baselineskip}& + \changefontsize[14.4]{12}\csname#1\endcsname\fs@getsize{\baselineskip} +} + +\newcommand{\tabrowtwo}[2]{% + \tabfontsize + \texttt{\symbol{92}#1}#2 + & + \changefontsize[12]{10.0}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.1}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.2}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.3}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.4}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.5}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.6}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.7}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.8}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{10.9}\fs@getsize{\csname#1\endcsname} & + \changefontsize[12]{11}\fs@getsize{\csname#1\endcsname} +} +\makeatother +% % Commands for code % \def\baddition{\color{DarkBlue}} @@ -196,7 +268,7 @@ This work has the LPPL maintenance status "author-maintained". % % \fi % -% \CheckSum{3128} +% \CheckSum{3064} % % \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 @@ -215,6 +287,8 @@ This work has the LPPL maintenance status "author-maintained". % Right brace \} Tilde \~} % % +% \changes{v0.8.1}{2021/03/14}{New \cmd{sampletext} command. +% Some lengths are now defined via \sty{xfp} package. Removed \cmd{headheight} definition. Updated documentation.} % \changes{v0.8}{2021/03/04}{Corrected a bug occuring when the line spacing is grater than \SI{163.84}{pt}.} % \changes{v0.7}{2021/02/10}{New font sizing commands \cmd{HUGE}, \cmd{HUGEr}, \cmd{HUGErr}, \cmd{HUGErrr}. Changed default name for the \file{.clo} file to \opt{fontsize}. Updated documentation.} % \changes{v0.6}{2021/02/06}{New font sizing commands from \cmd{small} down. Updated documentation.} @@ -345,7 +419,7 @@ This work has the LPPL maintenance status "author-maintained". %^^A--------------------------------------------------------------------- % \section{Usage} %^^A--------------------------------------------------------------------- -% \enlargethispage{\baselineskip} +%^^A \enlargethispage{\baselineskip} % % The package can be loaded, as usual, with: % \begin{ttquote} @@ -365,9 +439,16 @@ This work has the LPPL maintenance status "author-maintained". % % 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. +% 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}). +% +% \begin{footnotesize} +% As \sty{fontsize} takes effect after the class is loaded, you should +% set a font size class option that comes close to the font size passed +% to \sty{fontsize}. For example, +% if you set \opt{fontsize=12.2pt} you should load the class option \opt{12pt}. +% \end{footnotesize} % % \optitem[fontsize]{cloname}{\meta{name}} % @@ -375,6 +456,13 @@ This work has the LPPL maintenance status "author-maintained". % \file{\meta{name}\meta{fontsize}.clo} to setup the font sizes. % This file can be generated through the \cmd{generateclofile} % command (see below). +% +%^^A If \opt{cloname=fontsize-std} and \opt{fontsize=10\OR 11\OR 12} +%^^A a file which emulate the standard bk*.clo files will be used. +%^^A \file{fontsize-std10pt.clo}, +%^^A \file{fontsize-std11pt.clo} or +%^^A \file{fontsize-std11pt.clo} will be used, +% % % \end{optionlist*} % @@ -388,11 +476,11 @@ 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. +% 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: +% %\begin{latexcode} %\begin{verbatim} %\changefontsize[13.5pt]{11.5pt} @@ -411,7 +499,7 @@ This work has the LPPL maintenance status "author-maintained". % 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. +% \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 overwritten.} % @@ -436,9 +524,9 @@ This work has the LPPL maintenance status "author-maintained". %\end{verbatim} %\end{latexcode} % -%^^A \cmditem{sampletext}{text} +% \cmditem{sampletext}{text} % -%^^A Defines the \meta{text} to be used by \cmd{printsamples}. +% Defines the \meta{text} to be used by \cmd{printsamples}. % % \end{ltxsyntax} % @@ -446,9 +534,8 @@ This work has the LPPL maintenance status "author-maintained". % \subsection{New font sizing commands}\label{sec:sizingcmd} %^^A-------------------------------------------------------------------- % -% The package provides three additional font sizing commands for each standard size. -% The value of these new sizes (rounded to the second decimal place) are shown in -% table \ref{tab:sizes}. +% The package provides three additional font sizing commands for each standard size (plus the new \cmd{HUGE} command). +% See table \ref{tab:sizes} for details. % \medskip % %\def\fshw{Lipsum} @@ -484,6 +571,7 @@ This work has the LPPL maintenance status "author-maintained". % \tcmd{Largerr} & \Largerr \fshw \\ % \tcmd{Largerrr} & \Largerrr \fshw % \end{tabular} +% \hskip5mm % \begin{tabular}[b]{ll} % \cmd{LARGE} & \LARGE \fshw \\ % \tcmd{LARGEr} & \LARGEr \fshw \\ @@ -505,21 +593,21 @@ This work has the LPPL maintenance status "author-maintained". % } %\medskip % -% \begin{footnotesize} +% \begin{small} %\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 such as Cochineal % used in this document \parencite{cochineal}, but % if the font has optical sizes, unusual things can happen: -% some larger sizes may appear smaller. In any case, with the \LaTeX\ -% default font (i.e. Computer Modern) I recommend loading -% \cmd{RequirePackage}|{fix-cm}| just before \cmd{documentclass}. -% For example, with the Latin Modern 12\,pt typeface \parencite{lm} -% a similar situation can be encountered:\medskip +% some larger sizes may appear smaller. +% For example, with the Latin Modern typeface \parencite{lm} +% a similar situation can be encountered when normal size is set +% to 12\,pt:\medskip % % \begingroup % \centering % \fontfamily{lmr}\selectfont +% %\begin{minipage}[b]{8cm} % \begin{tabular}[b]{lll} % \tcmd{largerr} & \texttlf{15.84\,pt} &\largerr Hello world \\ @@ -540,86 +628,99 @@ This work has the LPPL maintenance status "author-maintained". % right which shows the letter H appropriately scaled to see the % differences better). % -% \end{footnotesize} -% -% \clearpage\thispagestyle{empty} -% \def\ivalbmidrule{\arrayrulecolor{black!40}\midrule\rowfont{\color{philA}}} -% \begin{table} -%\vspace*{-1cm} -% \centering -% \centerline{% -% \begin{tabu}{lSSSSSSSSS} -%\toprule\rowfont{\color{philA}} -% \tcmd{tiny} & 4.00 & 4.25 & 4.50 & 4.75 & 5.00 & 5.25 & 5.50 & 5.75 & 6.00 \\ -% \cmd{tinyr} & 4.33 & 4.60 & 4.88 & 5.15 & 5.42 & 5.69 & 5.96 & 6.23 & 6.50 \\ -% \cmd{tinyrr} & 4.67 & 4.96 & 5.25 & 5.54 & 5.83 & 6.12 & 6.42 & 6.71 & 7.00 \\ -% \cmd{tinyrrr} & 5.00 & 5.31 & 5.62 & 5.94 & 6.25 & 6.56 & 6.88 & 7.19 & 7.50 \\ -%\ivalbmidrule -% \tcmd{scriptsize} & 5.33 & 5.67 & 6.00 & 6.33 & 6.67 & 7.00 & 7.33 & 7.67 & 8.00 \\ -% \cmd{scriptsizer} & 5.67 & 6.02 & 6.38 & 6.73 & 7.08 & 7.44 & 7.79 & 8.15 & 8.50 \\ -% \cmd{scriptsizerr} & 6.00 & 6.38 & 6.75 & 7.12 & 7.50 & 7.88 & 8.25 & 8.62 & 9.00 \\ -% \cmd{scriptsizerrr} & 6.33 & 6.73 & 7.13 & 7.52 & 7.92 & 8.31 & 8.71 & 9.10 & 9.50 \\ -%\ivalbmidrule -% \tcmd{footnotesize} & 6.67 & 7.08 & 7.50 & 7.92 & 8.33 & 8.75 & 9.17 & 9.58 & 10.00 \\ -% \cmd{footnotesizer} & 6.83 & 7.25 & 7.68 & 8.10 & 8.53 & 8.96 & 9.38 & 9.81 & 10.24 \\ -% \cmd{footnotesizerr} & 6.98 & 7.42 & 7.86 & 8.29 & 8.73 & 9.17 & 9.60 & 10.04 & 10.48 \\ -% \cmd{footnotesizerrr} & 7.14 & 7.59 & 8.03 & 8.48 & 8.93 & 9.37 & 9.82 & 10.27 & 10.71 \\ -%\ivalbmidrule -% \tcmd{small} & 7.30 & 7.76 & 8.21 & 8.67 & 9.13 & 9.58 & 10.04 & 10.49 & 10.95 \\ -% \cmd{smallr} & 7.47 & 7.94 & 8.41 & 8.88 & 9.34 & 9.81 & 10.28 & 10.75 & 11.21 \\ -% \cmd{smallrr} & 7.65 & 8.13 & 8.61 & 9.08 & 9.56 & 10.04 & 10.52 & 11.00 & 11.48 \\ -% \cmd{smallrrr} & 7.82 & 8.31 & 8.80 & 9.29 & 9.78 & 10.27 & 10.76 & 11.25 & 11.74 \\ -%\ivalbmidrule -% \tcmd{normalsize} & 8.00 & 8.50 & 9.00 & 9.50 & 10.00 & 10.50 & 11.00 & 11.50 & 12.00 \\ -% \cmd{normalsizer} & 8.40 & 8.93 & 9.45 & 9.98 & 10.50 & 11.03 & 11.55 & 12.08 & 12.60 \\ -% \cmd{normalsizerr} & 8.80 & 9.35 & 9.90 & 10.45 & 11.00 & 11.55 & 12.10 & 12.65 & 13.20 \\ -% \cmd{normalsizerrr} & 9.20 & 9.77 & 10.35 & 10.92 & 11.50 & 12.07 & 12.65 & 13.22 & 13.80 \\ -%\ivalbmidrule -% \tcmd{large} & 9.60 & 10.20 & 10.80 & 11.40 & 12.00 & 12.60 & 13.20 & 13.80 & 14.40 \\ -% \cmd{larger} & 10.08 & 10.71 & 11.34 & 11.97 & 12.60 & 13.23 & 13.86 & 14.49 & 15.12 \\ -% \cmd{largerr} & 10.56 & 11.22 & 11.88 & 12.54 & 13.20 & 13.86 & 14.52 & 15.18 & 15.84 \\ -% \cmd{largerrr} & 11.04 & 11.73 & 12.42 & 13.11 & 13.80 & 14.49 & 15.18 & 15.87 & 16.56 \\ -%\ivalbmidrule -% \tcmd{Large} & 11.52 & 12.24 & 12.96 & 13.68 & 14.40 & 15.12 & 15.84 & 16.56 & 17.28 \\ -% \cmd{Larger} & 12.10 & 12.85 & 13.61 & 14.36 & 15.12 & 15.88 & 16.63 & 17.39 & 18.14 \\ -% \cmd{Largerr} & 12.67 & 13.46 & 14.26 & 15.05 & 15.84 & 16.63 & 17.42 & 18.22 & 19.01 \\ -% \cmd{Largerrr} & 13.25 & 14.08 & 14.90 & 15.73 & 16.56 & 17.39 & 18.22 & 19.04 & 19.87 \\ -%\ivalbmidrule -% \tcmd{LARGE} & 13.82 & 14.69 & 15.55 & 16.42 & 17.28 & 18.14 & 19.01 & 19.87 & 20.74 \\ -% \cmd{LARGEr} & 14.52 & 15.42 & 16.33 & 17.24 & 18.14 & 19.05 & 19.96 & 20.87 & 21.77 \\ -% \cmd{LARGErr} & 15.21 & 16.16 & 17.11 & 18.06 & 19.01 & 19.96 & 20.91 & 21.86 & 22.81 \\ -% \cmd{LARGErrr} & 15.90 & 16.89 & 17.89 & 18.88 & 19.88 & 20.87 & 21.86 & 22.86 & 23.85 \\ -%\ivalbmidrule -% \tcmd{huge} & 16.59 & 17.63 & 18.67 & 19.70 & 20.74 & 21.78 & 22.81 & 23.85 & 24.89 \\ -% \cmd{huger} & 17.42 & 18.51 & 19.6 & 20.69 & 21.78 & 22.86 & 23.95 & 25.04 & 26.13 \\ -% \cmd{hugerr} & 18.25 & 19.39 & 20.53 & 21.67 & 22.81 & 23.95 & 25.09 & 26.23 & 27.37 \\ -% \cmd{hugerrr} & 19.08 & 20.27 & 21.46 & 22.65 & 23.85 & 25.04 & 26.23 & 27.42 & 28.61 \\ -%\ivalbmidrule -% \tcmd{Huge} & 19.90 & 21.15 & 22.39 & 23.64 & 24.88 & 26.12 & 27.37 & 28.61 & 29.86 \\ -% \cmd{Huger} & 20.89 & 22.19 & 23.50 & 24.80 & 26.11 & 27.42 & 28.72 & 30.03 & 31.33 \\ -% \cmd{Hugerr} & 21.87 & 23.24 & 24.61 & 25.97 & 27.34 & 28.71 & 30.07 & 31.44 & 32.81 \\ -% \cmd{Hugerrr} & 22.86 & 24.28 & 25.71 & 27.14 & 28.57 & 30.00 & 31.43 & 32.86 & 34.28 \\ -%\ivalbmidrule -% \tcmd{HUGE} & 24.05 & 25.55 & 27.05 & 28.56 & 30.06 & 31.56 & 33.07 & 34.57 & 36.07 \\ -% \cmd{HUGEr} & 25.24 & 26.82 & 28.39 & 29.97 & 31.55 & 33.13 & 34.70 & 36.28 & 37.86 \\ -% \cmd{HUGErr} & 26.43 & 28.08 & 29.74 & 31.39 & 33.04 & 34.69 & 36.34 & 38.00 & 39.65 \\ -% \cmd{HUGErrr} & 27.62 & 29.35 & 31.08 & 32.80 & 34.53 & 36.26 & 37.98 & 39.71 & 41.44 \\ -% \arrayrulecolor{black}\bottomrule -%\end{tabu} -%} -% \caption{The value of all available sizes (rounded to the second decimal place) relative to \cmd{normalsize} ranging from 8\,pt to 12\,pt with an increment of 0.5\,pt}\label{tab:sizes} -%\end{table} -%\clearpage\thispagestyle{plain} +%^^A In any case, if you use this package with the \LaTeX\ +%^^A default font (i.e. Computer Modern) I recommend loading +%^^A \cmd{RequirePackage}|{fix-cm}| just before \cmd{documentclass}. +% +% +% \end{small} +% +%\newgeometry{top=2cm,bottom=3cm} +% +%\begin{smallrrr} +% +%\def\grayrule{\\\tabucline[0.4pt black!40 off 2pt]{-}\\[-2ex]\rowfont{\color{philA}}} +% +%\begin{longtabu}{m{3.4cm}@{}*{8}{@{}r@{}}r} +% \caption{The value of all available sizes (rounded to the second decimal place) +% relative to \cmd{normalsize} ranging from 8\,pt to 12\,pt with increments of +% 0.5\,pt. The first row of each size shows the font size; the second row (colored in +% gray) shows the default line spacing}\label{tab:sizes}\\[1ex] +% \toprule +% \endfirsthead +% +% \multicolumn{10}{l}{\scriptsize\itshape \ldots continues from previous page}\\*[1ex] +% \endhead +% +% \multicolumn{10}{r}{\scriptsize\itshape continues on next page\ldots} +% \endfoot +% +% \arrayrulecolor{black} +% \bottomrule +% \endlastfoot +% +% \rowfont{\color{philA}} +% \tabrowone{tiny}\\ +% \tabrowone{tinyr}\\ +% \tabrowone{tinyrr}\\ +% \tabrowone{tinyrrr}\grayrule +% \tabrowone{scriptsize}\\ +% \tabrowone{scriptsizer}\\ +% \tabrowone{scriptsizerr}\\ +% \tabrowone{scriptsizerrr}\grayrule +% \tabrowone{footnotesize}\\ +% \tabrowone{footnotesizer}\\ +% \tabrowone{footnotesizerr}\\ +% \tabrowone{footnotesizerrr}\grayrule +% \tabrowone{small}\\ +% \tabrowone{smallr}\\ +% \tabrowone{smallrr}\\ +% \tabrowone{smallrrr}\grayrule +% \tabrowone{normalsize}\\ +% \tabrowone{normalsizer}\\ +% \tabrowone{normalsizerr}\\ +% \tabrowone{normalsizerrr}\grayrule +% \tabrowone{large}\\ +% \tabrowone{larger}\\ +% \tabrowone{largerr}\\ +% \tabrowone{largerrr}\grayrule +% \tabrowone{Large}\\ +% \tabrowone{Larger}\\ +% \tabrowone{Largerr}\\ +% \tabrowone{Largerrr}\grayrule +% \tabrowone{LARGE}\\ +% \tabrowone{LARGEr}\\ +% \tabrowone{LARGErr}\\ +% \tabrowone{LARGErrr}\grayrule +% \tabrowone{huge}\\ +% \tabrowone{huger}\\ +% \tabrowone{hugerr}\\ +% \tabrowone{hugerrr}\grayrule +% \tabrowone{Huge}\\ +% \tabrowone{Huger}\\ +% \tabrowone{Hugerr}\\ +% \tabrowone{Hugerrr}\grayrule +% \tabrowone{HUGE}\\ +% \tabrowone{HUGEr}\\ +% \tabrowone{HUGErr}\\ +% \tabrowone{HUGErrr}\\ +%\end{longtabu} +% +%\end{smallrrr} +% +%\restoregeometry % %^^A--------------------------------------------------------------------- % % \section{Some text samples}\label{sec:example} % %^^A-------------------------------------------------------------------- -% The following examples are obtained with the \cmd{printsamples} command (see section \ref{sec:commands}). +% The following samples are obtained with the \cmd{printsamples} command (see section \ref{sec:commands}): +%\begin{verbatim} +%\printsamples{12.6pt}{10.6pt}[normalsizerr,normalsizerrr,large,larger,largerr] +%\end{verbatim} % -% \printsamples{13.2pt}{11.2pt}[normalsizer,normalsizerr,normalsizerrr,large,larger] -% \printsamples{13.4pt}{11.7pt}[normalsizer,normalsizerr,normalsizerrr,large,larger] +% \printsamples{12.6pt}{10.6pt}[normalsizerr,normalsizerrr,large,larger,largerr] % % \StopEventually{% % \printbibliography[heading=bibintoc] @@ -633,10 +734,14 @@ This work has the LPPL maintenance status "author-maintained". %^^A--------------------------------------------------------------------- %\textcolor{DarkBlue}{The parts added to the basic code of \file{scrextend} and \file{scrfontsizes} are highlighted in blue.} % -%\noindent All the options of the package are defined via \sty{xkeyval} \parencite{xkeyval}. Only a new package option called \opt{cloname} is defined. +%\noindent All the options of the package are defined via \sty{xkeyval} \parencite{xkeyval}, +% while the \sty{xfp} package \parencite{xfp} provides the \cmd{fpeval} command +% to use instead of \cmd{dimexpr} for some size calculations. +% Only a new package option called \opt{cloname} is defined. % \baddition % \begin{macrocode} \@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}} +\@ifpackageloaded{xfp}{}{\RequirePackage{xfp}} \DeclareOptionX{cloname}[fontsize]{\def\@fontsizefilebase{#1}} % \end{macrocode} % \eaddition @@ -732,10 +837,10 @@ This work has the LPPL maintenance status "author-maintained". % the maximum dimension that may be stored in plain % \TeX\ and \LaTeX. % The problem, which is probably more theoretical than practical, -% can be solved simply by changing it to this (thanks to Claudio Beccari): +% can be solved (thanks to Claudio Beccari) simply by changing it to this: % \baddition % \begin{macrocode} - \setlength{\@tempdimc}{100\dimexpr (\@tempdimb * \p@ / \@tempdima)} + \setlength{\@tempdimc}{\fpeval{100*\@tempdimb/\@tempdima}pt}% % \end{macrocode} % \eaddition % \begin{macrocode} @@ -1136,43 +1241,40 @@ 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 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: +% The KOMA files do not define \cmd{parindent} and other lengths that are +% are strictly linked to the font rather than to the dimensions of the page and the text. So first we set \cmd{parindent} to \cmd{normalsize}: % \baddition % \begin{macrocode} \setlength\parindent{\@tempdimb}% -\setlength\headheight{\dimexpr(\@tempdimb+2pt)}% % \end{macrocode} % \eaddition -% 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. +% 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 the lengths in the files \file{bk*.clo} not affected by \sty{fontsize} only concern \cmd{headheight}, \cmd{headsep}, \cmd{topskip} and \cmd{footskip}. % \baddition % \begin{macrocode} -\setlength\smallskipamount{\dimexpr(1.1\@tempdimb/4) \@plus 1\p@ \@minus 1\p@}% -\setlength\medskipamount{\dimexpr(1.1\@tempdimb/2) \@plus 2\p@ \@minus 2\p@}% -\setlength\bigskipamount{\dimexpr(1.1\@tempdimb) \@plus 4\p@ \@minus 4\p@}% +\setlength\smallskipamount{\fpeval{1.090909091\@tempdimb/4}pt \@plus 1\p@ \@minus 1\p@}% +\setlength\medskipamount{\fpeval{1.090909091\@tempdimb/2}pt \@plus 2\p@ \@minus 2\p@}% +\setlength\bigskipamount{\fpeval{1.090909091\@tempdimb}pt \@plus 4\p@ \@minus 4\p@}% % \end{macrocode} % \eaddition -% The following table shows the values of some specific lengths -% 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.\medskip -% -% \begin{footnotesize} -% \newcolumntype{Y}{@{}S[table-column-width=1.04cm]} -% \centerline{% -% \noindent\begin{tabular}{@{}m{3.7cm}@{\hskip2mm}YYYYYYYYYYY@{}} -%\toprule -% Normal size & 10.00 & 10.10 & 10.20 & 10.30 & 10.40 & 10.50 & 10.60 & 10.70 & 10.80 & 10.90 & 11.00 \\ -% Line spacing & 12.00 & 12.12 & 12.24 & 12.36 & 12.48 & 12.60 & 12.72 & 12.84 & 12.96 & 13.08 & 13.20 \\ -% \midrule -% \cmd{headheight} & 12.00 & 12.10 & 12.20 & 12.30 & 12.40 & 12.50 & 12.60 & 12.70 & 12.80 & 12.90 & 13.00 \\ -% \cmd{parindent} & 10.00 & 10.10 & 10.20 & 10.30 & 10.40 & 10.50 & 10.60 & 10.70 & 10.80 & 10.90 & 11.00 \\ -% \cmd{smallskipamount}\ \hfill$\pm$\SI{1}{pt} & 2.75 & 2.78 & 2.81 & 2.83 & 2.86 & 2.89 & 2.92 & 2.94 & 2.97 & 3.00 & 3.03 \\ -% \cmd{medskipamount}\ \hfill$\pm$\SI{2}{pt} & 5.50 & 5.56 & 5.61 & 5.67 & 5.72 & 5.78 & 5.83 & 5.89 & 5.94 & 6.00 & 6.05 \\ -% \cmd{bigskipamount}\ \hfill$\pm$\SI{4}{pt} & 11.00 & 11.11 & 11.22 & 11.33 & 11.44 & 11.55 & 11.66 & 11.77 & 11.88 & 11.99 & 12.10 \\ +% \def\tabfontsize{\fontsize{10.5}{12.5}\selectfont} +% \def\plusminus{\hskip.5pt\parbox[b]{4mm}{\fontsize{5}{5}\itshape plus\\minus}\hskip1pt} +% \begin{table}\tabfontsize\centering +% \caption{The values of some specific lengths set by the package, +% in relation to some significant settings of the normal size. +% The values are expressed in pt and rounded to the second +% decimal place.}\label{tab:skips} +% \begin{tabu}{@{\hskip2pt}m{4.5cm}@{\hskip2mm}*{11}{@{\hskip-1pt}r}@{\hskip2pt}} +% \toprule +% \rowfont{\tabfontsize}Normal size +% & 10.00 & 10.10 & 10.20 & 10.30 & 10.40 & 10.50 +% & 10.60 & 10.70 & 10.80 & 10.90 & 11.00 \\\midrule +% \tabrowtwo{parindent}{}\\ +% \tabrowtwo{smallskipamount}{\ \hfill (\plusminus\SI{1}{pt})}\\ +% \tabrowtwo{medskipamount}{\ \hfill (\plusminus\SI{2}{pt})}\\ +% \tabrowtwo{bigskipamount}{\ \hfill (\plusminus\SI{4}{pt})}\\ % \bottomrule -% \end{tabular} -% } -% \end{footnotesize} +% \end{tabu} +%\end{table} % \begin{macrocode} \setlength{\@tempdimb}{\f@baselineskip}% \ctm@setlength{\parsep}% @@ -1862,27 +1964,12 @@ This work has the LPPL maintenance status "author-maintained". }% \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 + \string\@listi^^J% + \string\endinput^^J% + \@percentchar^^J% + \@percentchar\space End of file `#1#2.clo'. +} +\immediate\closeout\@fontfile } \@onlypreamble\generateclofile % \end{macrocode} @@ -1892,15 +1979,16 @@ This work has the LPPL maintenance status "author-maintained". % \sty{etoolbox} \parencite{etoolbox}. % \baddition % \begin{macrocode} -\def\fontsizelipsum{% - 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 easily be shown in the - next section, reason would thereby be made to contradict, in view of - these considerations, the Ideal of practical reason, yet the manifold - depends on the phenomena.} +\newcommand{\sampletext}[1]{\def\fs@sampletext{#1}} +\def\fs@sampletext{% + 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 easily be shown in + the next section, reason would thereby be made to contradict, in view of + these considerations, the Ideal of practical reason, yet the manifold + depends on the phenomena.} \ExplSyntaxOn @@ -1947,7 +2035,7 @@ This work has the LPPL maintenance status "author-maintained". \noindent\texttt{\symbol{92}##1}:~ % print the font size command \__fontsize_round_f:n {size}~on~ % print the size in points \__fontsize_round_f:n {baselineskip}.~ % print the baseline skip in points - \fontsizelipsum % sample text + \fs@sampletext % sample text \par\addvspace{\medskipamount} % finish up } % close the group @@ -2008,6 +2096,14 @@ This work has the LPPL maintenance status "author-maintained". date = {2020-12-19}, version = {1.065 } } + +@manual{xfp, + title = {The \textit{xfp} package Floating Point Unit}, + author = {{The \LaTeX\ Project}}, + url = {https://www.ctan.org/pkg/xfp}, + urldate = {2021-03-14}, + date = {2021-03-12}, +} % % \fi % \Finale diff --git a/Master/texmf-dist/tex/latex/fontsize/fontsize.sty b/Master/texmf-dist/tex/latex/fontsize/fontsize.sty index b2905b61644..080ef528ba1 100644 --- a/Master/texmf-dist/tex/latex/fontsize/fontsize.sty +++ b/Master/texmf-dist/tex/latex/fontsize/fontsize.sty @@ -26,8 +26,9 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{fontsize} - [2021/03/04 v0.8 'fontsize' package. Set main font sizes (Ivan Valbusa)] + [2021/03/14 v0.8.1 'fontsize' package. Set main font sizes (Ivan Valbusa)] \@ifpackageloaded{xkeyval}{}{\RequirePackage{xkeyval}} +\@ifpackageloaded{xfp}{}{\RequirePackage{xfp}} \DeclareOptionX{cloname}[fontsize]{\def\@fontsizefilebase{#1}} \DeclareOptionX{fontsize}[10]{% \expandafter\@defaultunits\expandafter\@tempdima#1 pt\relax\@nnil @@ -94,7 +95,7 @@ \addtolength{\@tempdimc}{-10\p@}% \edef\@ptsize{\strip@pt\@tempdimc}% \@defaultunits\@tempdimb#1pt\relax\@nnil - \setlength{\@tempdimc}{100\dimexpr (\@tempdimb * \p@ / \@tempdima)} + \setlength{\@tempdimc}{\fpeval{100*\@tempdimb/\@tempdima}pt}% \edef\@tempb{\the\@tempdimc}% \setlength{\@tempdimc}{\@tempdima}% \def\@tempa##1##2##3##4##5\@nnil{\def##1{##2.##3##4}}% @@ -437,10 +438,9 @@ }% \normalsize% \setlength\parindent{\@tempdimb}% -\setlength\headheight{\dimexpr(\@tempdimb+2pt)}% -\setlength\smallskipamount{\dimexpr(1.1\@tempdimb/4) \@plus 1\p@ \@minus 1\p@}% -\setlength\medskipamount{\dimexpr(1.1\@tempdimb/2) \@plus 2\p@ \@minus 2\p@}% -\setlength\bigskipamount{\dimexpr(1.1\@tempdimb) \@plus 4\p@ \@minus 4\p@}% +\setlength\smallskipamount{\fpeval{1.090909091\@tempdimb/4}pt \@plus 1\p@ \@minus 1\p@}% +\setlength\medskipamount{\fpeval{1.090909091\@tempdimb/2}pt \@plus 2\p@ \@minus 2\p@}% +\setlength\bigskipamount{\fpeval{1.090909091\@tempdimb}pt \@plus 4\p@ \@minus 4\p@}% \setlength{\@tempdimb}{\f@baselineskip}% \ctm@setlength{\parsep}% {.3333\@tempdimb}{.1667\@tempdimb}{.0833\@tempdimb}% @@ -1095,38 +1095,24 @@ }% \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 + \string\@listi^^J% + \string\endinput^^J% + \@percentchar^^J% + \@percentchar\space End of file `#1#2.clo'. +} +\immediate\closeout\@fontfile } \@onlypreamble\generateclofile -\def\fontsizelipsum{% - 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 easily be shown in the - next section, reason would thereby be made to contradict, in view of - these considerations, the Ideal of practical reason, yet the manifold - depends on the phenomena.} +\newcommand{\sampletext}[1]{\def\fs@sampletext{#1}} +\def\fs@sampletext{% + 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 easily be shown in + the next section, reason would thereby be made to contradict, in view of + these considerations, the Ideal of practical reason, yet the manifold + depends on the phenomena.} \ExplSyntaxOn @@ -1171,7 +1157,7 @@ \noindent\texttt{\symbol{92}##1}:~ % print the font size command \__fontsize_round_f:n {size}~on~ % print the size in points \__fontsize_round_f:n {baselineskip}.~ % print the baseline skip in points - \fontsizelipsum % sample text + \fs@sampletext % sample text \par\addvspace{\medskipamount} % finish up } % close the group -- cgit v1.2.3