summaryrefslogtreecommitdiff
path: root/macros/latex/contrib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-04-08 03:00:47 +0000
committerNorbert Preining <norbert@preining.info>2024-04-08 03:00:47 +0000
commit23803b0f35b5b0020c2c03924a79ed79654b130f (patch)
tree1935465ea1680bd709092ec465f831c945c63383 /macros/latex/contrib
parent8b8ca487806f0f30fc532309d920767c745b568d (diff)
CTAN sync 202404080300
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r--macros/latex/contrib/abntexto/README4
-rw-r--r--macros/latex/contrib/abntexto/abntexto.cls56
-rw-r--r--macros/latex/contrib/abntexto/abntexto.pdfbin258189 -> 260747 bytes
-rw-r--r--macros/latex/contrib/abntexto/abntexto.tex2
-rw-r--r--macros/latex/contrib/fontscale/README.txt10
-rw-r--r--macros/latex/contrib/fontscale/fontscale-manual-table-classic.tex72
-rw-r--r--macros/latex/contrib/fontscale/fontscale-manual-table-font-steps.tex70
-rw-r--r--macros/latex/contrib/fontscale/fontscale-manual-table-modular-musical.tex70
-rw-r--r--macros/latex/contrib/fontscale/fontscale-manual.pdfbin129635 -> 129725 bytes
-rw-r--r--macros/latex/contrib/fontscale/fontscale-manual.tex764
-rw-r--r--macros/latex/contrib/fontscale/fontscale.sty2621
-rw-r--r--macros/latex/contrib/hulipsum/README2
-rw-r--r--macros/latex/contrib/hulipsum/hulipsum.dtx77
-rw-r--r--macros/latex/contrib/hulipsum/hulipsum.ins4
-rw-r--r--macros/latex/contrib/hulipsum/hulipsum.pdfbin145394 -> 156432 bytes
15 files changed, 1906 insertions, 1846 deletions
diff --git a/macros/latex/contrib/abntexto/README b/macros/latex/contrib/abntexto/README
index 8a02781587..eeaeb92ef6 100644
--- a/macros/latex/contrib/abntexto/README
+++ b/macros/latex/contrib/abntexto/README
@@ -1,6 +1,6 @@
Public Domain Software
-2023-11-13
-3.1.0-beta
+2024-06-04
+3.1.1-beta
Elayson Abreu
abntexto.classe@gmail.com
diff --git a/macros/latex/contrib/abntexto/abntexto.cls b/macros/latex/contrib/abntexto/abntexto.cls
index bdfd09ff5e..f7a74197fc 100644
--- a/macros/latex/contrib/abntexto/abntexto.cls
+++ b/macros/latex/contrib/abntexto/abntexto.cls
@@ -1,6 +1,6 @@
%! Public Domain Software
-%! 2023-11-13
-%! 3.1.0-beta
+%! 2024-04-06
+%! 3.1.1-beta
%! Elayson Abreu
%! abntexto.classe@gmail.com
@@ -30,7 +30,7 @@
% \begin{code}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{abntexto}[2023-11-13 3.1.0-beta Preparation of works in ABNT standards]
+\ProvidesClass{abntexto}[2024-04-06 3.1.1-beta Preparation of works in ABNT standards]
\LoadClass{article}
\RequirePackage{geometry}
@@ -82,16 +82,21 @@
% A instrução |\textual| põe a numeração de página no topo direito nas páginas ímpares e no topo esquerdo em páginas pares. Além disso, |twoside| vai espelhar as margens horizontais.
+% O comando |\eletroniclayout| é útil para leitura do trabalho em {\em display} digital. Para ativar este {\em layout} basta escrever |\let\onesidelayout=\eletroniclayout| e |\let\twosidelayout=\eletroniclayout| no preâmbulo do documento.
+
% Por algum motivo, |\newgeometry| reseta |\baselineskip| e |\parindent|, então temos de repetir estas instruções.
-% \begin{code}
-\def\pretextual{%
- \let\@oddhead=\empty
- \let\@evenhead=\empty
- \let\@oddfoot=\empty
- \let\@evenfoot=\empty
+% \begin{code}
+\def\onesidelayout{%
+ \newgeometry{
+ twoside=false,
+ left = 3cm,
+ top = 3cm,
+ right = 2cm,
+ bottom = 2cm
+ }
}
-\def\textual{%
+\def\twosidelayout{%
\newgeometry{
twoside=true,
left = 3cm,
@@ -99,6 +104,26 @@
right = 2cm,
bottom = 2cm
}%
+}
+\def\eletroniclayout{%
+ \newgeometry{
+ twoside=false,
+ left = 2.5cm,
+ top = 3cm,
+ right = 2.5cm,
+ bottom = 2cm
+ }%
+}
+
+\def\pretextual{%
+ \onesidelayout
+ \let\@oddhead=\empty
+ \let\@evenhead=\empty
+ \let\@oddfoot=\empty
+ \let\@evenfoot=\empty
+}
+\def\textual{%
+ \twosidelayout
\spacing{1.5}%
\parindent=1.5cm
\def\@oddhead{\hfil\small\thepage}%
@@ -817,14 +842,7 @@
\spacing{1.5}
-\geometry{
- a4paper,
- twoside=false,
- left=3cm,
- top=3cm,
- right=2cm,
- bottom=2cm
-}
+\geometry{a4paper}
\frenchspacing
\parindent=0pt
@@ -880,4 +898,4 @@
\AddToHook{begindocument}{\pretextual}
\endinput
-% \end{code}
+% \end{code} \ No newline at end of file
diff --git a/macros/latex/contrib/abntexto/abntexto.pdf b/macros/latex/contrib/abntexto/abntexto.pdf
index a1f9ae0fac..c714fcc8d2 100644
--- a/macros/latex/contrib/abntexto/abntexto.pdf
+++ b/macros/latex/contrib/abntexto/abntexto.pdf
Binary files differ
diff --git a/macros/latex/contrib/abntexto/abntexto.tex b/macros/latex/contrib/abntexto/abntexto.tex
index 32dc5e19d7..a46c613c06 100644
--- a/macros/latex/contrib/abntexto/abntexto.tex
+++ b/macros/latex/contrib/abntexto/abntexto.tex
@@ -121,7 +121,7 @@
\par}
\vskip3in
-{\centering\large\ttfamily 3.1.0-beta\par}
+{\centering\large\ttfamily 3.1.1-beta\par}
\newpage
\nonum\notoc\section{Sumário}
diff --git a/macros/latex/contrib/fontscale/README.txt b/macros/latex/contrib/fontscale/README.txt
index 292cfada9b..f7cc1562b8 100644
--- a/macros/latex/contrib/fontscale/README.txt
+++ b/macros/latex/contrib/fontscale/README.txt
@@ -1,5 +1,5 @@
-Package: fontscale -- A user interface for setting document font sizes
-Copyright: 2024 (c) Oliver Beery <beeryoliver@gmail.com>
-CTAN: https://ctan.org/pkg/fontscale
-Repository: https://github.com/beeryoliver/fontscale
-License: The LaTeX Project Public License 1.3c
+Package: fontscale -- A user interface for setting document font sizes
+Copyright: 2024 (c) Oliver Beery <beeryoliver@gmail.com>
+CTAN: https://ctan.org/pkg/fontscale
+Repository: https://github.com/beeryoliver/fontscale
+License: The LaTeX Project Public License 1.3c
diff --git a/macros/latex/contrib/fontscale/fontscale-manual-table-classic.tex b/macros/latex/contrib/fontscale/fontscale-manual-table-classic.tex
index 56015bba68..d62f104635 100644
--- a/macros/latex/contrib/fontscale/fontscale-manual-table-classic.tex
+++ b/macros/latex/contrib/fontscale/fontscale-manual-table-classic.tex
@@ -1,37 +1,37 @@
-\ProvidesFile{fontscale-manual-table-classic.tex}[2024-03-08]
-
-\begin{table}
- \centering
- \caption
- {%
- The size of each font size command in \unit{pt} when using a classic typographic scale.%
- \label{table:classicscales}%
- }
- \bigskip
- \begin{tblr}
- {
- colspec=
- {
- l
- Q[si={table-format=3.2},c]
- Q[si={table-format=3.2},c]
- Q[si={table-format=3.2},c]
- }
- ,cell{1}{2-Z}={guard}
- }
- \toprule
- Command & \Key{classic-10pt} & \Key{classic-11pt} & \Key{classic-12pt} \\
- \midrule
- \cs{tiny} & 6 & 7 & 8 \\
- \cs{scriptsize} & 7 & 8 & 9 \\
- \cs{footnotesize} & 8 & 9 & 10 \\
- \cs{small} & 9 & 10 & 11 \\
- \cs{normalsize} & 10 & 11 & 12 \\
- \cs{large} & 11 & 12 & 14 \\
- \cs{Large} & 12 & 14 & 16 \\
- \cs{LARGE} & 14 & 16 & 18 \\
- \cs{huge} & 16 & 18 & 21 \\
- \cs{Huge} & 18 & 21 & 24 \\
- \bottomrule
- \end{tblr}
+\ProvidesFile{fontscale-manual-table-classic.tex}[2024-03-08]
+
+\begin{table}
+ \centering
+ \caption
+ {%
+ The size of each font size command in \unit{pt} when using a classic typographic scale.%
+ \label{table:classicscales}%
+ }
+ \bigskip
+ \begin{tblr}
+ {
+ colspec=
+ {
+ l
+ Q[si={table-format=3.2},c]
+ Q[si={table-format=3.2},c]
+ Q[si={table-format=3.2},c]
+ }
+ ,cell{1}{2-Z}={guard}
+ }
+ \toprule
+ Command & \Key{classic-10pt} & \Key{classic-11pt} & \Key{classic-12pt} \\
+ \midrule
+ \cs{tiny} & 6 & 7 & 8 \\
+ \cs{scriptsize} & 7 & 8 & 9 \\
+ \cs{footnotesize} & 8 & 9 & 10 \\
+ \cs{small} & 9 & 10 & 11 \\
+ \cs{normalsize} & 10 & 11 & 12 \\
+ \cs{large} & 11 & 12 & 14 \\
+ \cs{Large} & 12 & 14 & 16 \\
+ \cs{LARGE} & 14 & 16 & 18 \\
+ \cs{huge} & 16 & 18 & 21 \\
+ \cs{Huge} & 18 & 21 & 24 \\
+ \bottomrule
+ \end{tblr}
\end{table} \ No newline at end of file
diff --git a/macros/latex/contrib/fontscale/fontscale-manual-table-font-steps.tex b/macros/latex/contrib/fontscale/fontscale-manual-table-font-steps.tex
index 8392f99dbb..570d67d665 100644
--- a/macros/latex/contrib/fontscale/fontscale-manual-table-font-steps.tex
+++ b/macros/latex/contrib/fontscale/fontscale-manual-table-font-steps.tex
@@ -1,36 +1,36 @@
-\ProvidesFile{fontscale-manual-table-font-steps.tex}[2024-03-08]
-
-\begin{table}
- \centering
- \caption
- {%
- The step of each font size command.
- These are constants and cannot be changed.%
- \label{table:fontsteps}%
- }
- \bigskip
- \begin{tblr}
- {
- colspec=
- {
- l
- Q[si={table-format=3.2},c]
- }
- , cell{1}{2}={guard}
- }
- \toprule
- Command & Step \\
- \midrule
- \cs{tiny} & -4 \\
- \cs{scriptsize} & -3 \\
- \cs{footnotesize} & -2 \\
- \cs{small} & -1 \\
- \cs{normalsize} & 0 \\
- \cs{large} & 1 \\
- \cs{Large} & 2 \\
- \cs{LARGE} & 3 \\
- \cs{huge} & 4 \\
- \cs{Huge} & 5 \\
- \bottomrule
- \end{tblr}
+\ProvidesFile{fontscale-manual-table-font-steps.tex}[2024-03-08]
+
+\begin{table}
+ \centering
+ \caption
+ {%
+ The step of each font size command.
+ These are constants and cannot be changed.%
+ \label{table:fontsteps}%
+ }
+ \bigskip
+ \begin{tblr}
+ {
+ colspec=
+ {
+ l
+ Q[si={table-format=3.2},c]
+ }
+ , cell{1}{2}={guard}
+ }
+ \toprule
+ Command & Step \\
+ \midrule
+ \cs{tiny} & -4 \\
+ \cs{scriptsize} & -3 \\
+ \cs{footnotesize} & -2 \\
+ \cs{small} & -1 \\
+ \cs{normalsize} & 0 \\
+ \cs{large} & 1 \\
+ \cs{Large} & 2 \\
+ \cs{LARGE} & 3 \\
+ \cs{huge} & 4 \\
+ \cs{Huge} & 5 \\
+ \bottomrule
+ \end{tblr}
\end{table} \ No newline at end of file
diff --git a/macros/latex/contrib/fontscale/fontscale-manual-table-modular-musical.tex b/macros/latex/contrib/fontscale/fontscale-manual-table-modular-musical.tex
index 6fd10d9991..fad108d9e9 100644
--- a/macros/latex/contrib/fontscale/fontscale-manual-table-modular-musical.tex
+++ b/macros/latex/contrib/fontscale/fontscale-manual-table-modular-musical.tex
@@ -1,36 +1,36 @@
-\ProvidesFile{fontscale-manual-table-modular-musical.tex}[2024-03-08]
-
-\begin{table}
- \centering
- \caption
- {%
- The size of each font size command when using a modular or musical typographic scale with the initial settings.
- The font sizes are in \unit{pt} and rounded to two decimal places.%
- }
- \bigskip
- \begin{tblr}
- {
- colspec=
- {
- l
- Q[si={table-format=3.2},c]
- Q[si={table-format=3.2},c]
- }
- ,cell{1}{2-3}={guard}
- }
- \toprule
- Command & \Key{modular} & \Key{musical} \\
- \midrule
- \cs{tiny} & 6.24 & 5.74 \\
- \cs{scriptsize} & 7.02 & 6.60 \\
- \cs{footnotesize} & 7.90 & 7.58 \\
- \cs{small} & 8.89 & 8.71 \\
- \cs{normalsize} & 10 & 10 \\
- \cs{large} & 11.25 & 11.49 \\
- \cs{Large} & 12.66 & 13.20 \\
- \cs{LARGE} & 14.24 & 15.16 \\
- \cs{huge} & 16.02 & 17.41 \\
- \cs{Huge} & 18.02 & 20 \\
- \bottomrule
- \end{tblr}
+\ProvidesFile{fontscale-manual-table-modular-musical.tex}[2024-03-08]
+
+\begin{table}
+ \centering
+ \caption
+ {%
+ The size of each font size command when using a modular or musical typographic scale with the initial settings.
+ The font sizes are in \unit{pt} and rounded to two decimal places.%
+ }
+ \bigskip
+ \begin{tblr}
+ {
+ colspec=
+ {
+ l
+ Q[si={table-format=3.2},c]
+ Q[si={table-format=3.2},c]
+ }
+ ,cell{1}{2-3}={guard}
+ }
+ \toprule
+ Command & \Key{modular} & \Key{musical} \\
+ \midrule
+ \cs{tiny} & 6.24 & 5.74 \\
+ \cs{scriptsize} & 7.02 & 6.60 \\
+ \cs{footnotesize} & 7.90 & 7.58 \\
+ \cs{small} & 8.89 & 8.71 \\
+ \cs{normalsize} & 10 & 10 \\
+ \cs{large} & 11.25 & 11.49 \\
+ \cs{Large} & 12.66 & 13.20 \\
+ \cs{LARGE} & 14.24 & 15.16 \\
+ \cs{huge} & 16.02 & 17.41 \\
+ \cs{Huge} & 18.02 & 20 \\
+ \bottomrule
+ \end{tblr}
\end{table} \ No newline at end of file
diff --git a/macros/latex/contrib/fontscale/fontscale-manual.pdf b/macros/latex/contrib/fontscale/fontscale-manual.pdf
index 67af2fa36c..d45ffefea9 100644
--- a/macros/latex/contrib/fontscale/fontscale-manual.pdf
+++ b/macros/latex/contrib/fontscale/fontscale-manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/fontscale/fontscale-manual.tex b/macros/latex/contrib/fontscale/fontscale-manual.tex
index bb08e2eff9..8dd13a5cbe 100644
--- a/macros/latex/contrib/fontscale/fontscale-manual.tex
+++ b/macros/latex/contrib/fontscale/fontscale-manual.tex
@@ -1,383 +1,383 @@
-\documentclass{beery}
-
-\begin{document}
-
-
-\section*
- {%
- \SetFontStep*{1}%
- The \pkg{fontscale} package%
- }
-
-A user interface for setting document font sizes
-
-Oliver Beery
-
-Version 1.1.0\quad{}31 March 2024
-
-
-\section{Introduction}
-\label{sec:intro}
-
-\subsection{About}
-\label{subsec:about}
-
-\listheading{The \pkg{fontscale} package provides the following functionalities:}
-\begin{itemize}
- \item
- Set document font sizes via a classic, modular, or musical typographic scale.
- \item
- Set arbitrary scales, sizes, and baselineskips for the standard font size commands \cs{tiny}, \cs{scriptsize}, \cs{footnotesize}, \cs{small}, \cs{normalsize}, \cs{large}, \cs{Large}, \cs{LARGE}, \cs{huge}, and \cs{Huge}.
- \item
- Set the font size settings mid\-/document or within a local group.
- \item
- Set the font size by setting the font step, scale, or size.
- \item
- Set the font size relative to the current font size.
- \item
- Use the current font step, scale, size, and baselineskip directly, for example, for printing or within calculations.
- \item
- Print sample text to test different font sizes.
- \item
- For advanced users, store the step, scale, size, and baselineskip of each font size command in \pkg{expl3} variables.
-\end{itemize}
-
-
-\subsection{Loading the package}
-\label{subsec:loading}
-
-This package requires the 10 October 2023 \pkg{l3kernel} update.
-Since this update is fairly recent, you may need to ensure that your \LaTeX{} installation is up\-/to\-/date before using this package.
-
-This package lets the user set arbitrary font sizes.
-This works with most fonts produced today, but, for historical reasons, the default Computer Modern font is available only in a number of fixed sizes.
-If you get a warning that Computer Modern is not available in the requested size, you may need to add the code \cs{RequirePackage{fix-cm}} before \cs{documentclass} to make Computer Modern available at arbitrary font sizes.
-
-\cs{usepackage}\marg{fontscale}
-\nopagebreak\newline
-\cs{fontscalesetup}\marg{\meta{keys}}
-
-Load the \pkg{fontscale} package via the usual command in the document preamble.
-This package has no package options.
-Instead, the package keys are set up via the command \cs{fontscalesetup}\marg{\meta{keys}}.
-\meta{keys} must receive a comma\-/separated list of keys and their associated values.
-The package keys are documented in \S\ref{sec:choosing} and \S\ref{sec:overwriting}.
-
-Many \LaTeX{} document classes have a font size option (\Key{10pt}, \Key{11pt}, \Key{12pt}, etc.\@) which not only changes the set of document font sizes, but also modifies additional settings such as the page layout and vertical spacing which were specifically designed to work with those font sizes.
-For this reason, you may want to set the document class font size option close to the value of \cs{normalsize} set by this package.
-
-Internally, this package sets up each font size command from \cs{tiny} to \cs{Huge} using the kernel command \cs{@setfontsize}\---they have no additional functionality beyond that of \cs{@setfontsize}.
-Unlike the standard document classes, the font size commands set up by this package do not change the vertical spacing for displayed math and list structures.
-If the user would like to add this functionality or perhaps other features to the font size commands, they can do so via hooks, which are documented in the \LaTeX{} kernel.
-
-
-\subsection{Terminology}
-\label{subsec:terminology}
-
-When using the \pkg{fontscale} package, each font size, including the standard font size commands from \cs{tiny} to \cs{Huge}, has a step, scale, size, and baselineskip.
-The latter two parameters are the familiar first and second arguments to the low\-/level font command \cs{fontsize}\marg{\meta{size}}\marg{\meta{baselineskip}}.
-The font scale is the relative font size; the ratio of the font size to \cs{normalsize}.
-The font step is the number of font size gradations from \cs{normalsize}, which has a step of \num{0}.
-Table~\ref{table:fontsteps} lists the font step of each font size command.
-
-\input{./fontscale-manual-table-font-steps.tex}
-
-
-\section{Choosing the typographic scale}
-\label{sec:choosing}
-
-\Key{typographic-scale}
- [classic-10pt, classic-11pt, classic-12pt, modular, musical]
- [classic-10pt]
-\newline
-\Key{modular/ratio}[\meta{number}][1.125]
-\newline
-\Key{musical/ratio}[\meta{number}][2]%
-\nopagebreak\newline
-\Key{musical/notes}[\meta{integer}][5]
-
-The key \Key{typographic\-/scale} sets the font sizes using a classic, modular, or musical typographic scale.
-These are common methods of choosing a set of document font sizes.
-The choice of typographic scale initializes to \Key{classic\-/10pt}.
-
-The key \Key{typographic\-/scale} can also be set in a condensed format via the keys \Key{classic\-/10pt}, \Key{classic\-/11pt}, \Key{classic\-/12pt}, \Key{modular}, or \Key{musical}, which set the key \Key{typographic\-/scale} to the corresponding value.
-
-The classic typographic scale consists of the traditional font sizes
-\numlist{6;7;8;9;10;11;12;14;16;18;21;24;36;48;60;72}.%
-\footnote{See \S{}3.1 of \textit{The Elements of Typographic Style} by Robert Bringhurst.}
-They have been used since the sixteenth century and are the default font sizes on most computer software.
-The keys \Key{classic-10pt, classic-11pt, classic-12pt} set the size of each font size command to values based on their position in the classic typographic scale.
-The size of \cs{normalsize} is the named point size.
-The sizes of the other font size commands are the adjacent font sizes in the scale.
-Table~\ref{table:classicscales} lists the size of each font size command when using a classic typographic scale.
-
-\input{./fontscale-manual-table-classic.tex}
-
-The key \Key{modular} sets the font sizes from \cs{tiny} to \cs{Huge} using a modular typographic scale.
-In a modular scale, each font size is a fixed ratio from the adjacent font sizes.%
-\footnote{\url{https://alistapart.com/article/more-meaningful-typography/}}
-Here, the base font size is the size of \cs{normalsize}, which can be set via the key \Key{normalsize/size}[\meta{size}], more documented in \S\ref{sec:overwriting}.
-If not set, \cs{normalsize} initializes to \qty{10}{pt}.
-The modular ratio can be set via the key \Key{modular\slash{}ratio}.
-The initial modular ratio is \num{1.125}.
-
-\input{./fontscale-manual-table-modular-musical.tex}
-
-The key \Key{musical} sets the font sizes according to their position in a musical typographic scale.
-The font size is calculated using the formula:%
-\footnote
- {%
- I have referenced this article by Spencer Mortensen:
- \newline
- \url{https://spencermortensen.com/articles/typographic-scale/}%
- }
-\[ f_i = f_0 \times r ^ { i / n } \]
-$f_0$ is the base font size, the size of \cs{normalsize}.
-$f_i$ is the font size with font step~$i$.
-$n$ is the number of notes in the musical scale\---the number of font size gradations or steps above \cs{normalsize}.
-$r$ is the ratio of the musical scale, the ratio of the highest to the lowest note $ f_n / f_0 $.
-(The modular typographic scale is actually a special case of the musical typographic scale where $n=1$.)
-
-The musical ratio~$r$ and the number of notes~$n$ can be set via the keys \Key{musical\slash{}ratio} and \Key{musical\slash{}notes}.
-The initial musical ratio\---\num{2}\---and the initial number of notes\---\num{5}\---are the same as that of the classic typographic scale.%
-\footnote{Ibid.}
-Conveniently, \cs{Huge} is \num{5} steps above \cs{normalsize}.
-The font size of \cs{normalsize}~$f_0$ can be set using the key \Key{normalsize/size}[\meta{size}], more documented in \S\ref{sec:overwriting}.
-When using a musical typographic scale, \cs{normalsize} initializes to \qty{10}{pt}.%
-\footnote {I have set the initial value to \qty{10}{pt} instead of the \qty{12}{pt} recommended by the Spencer Mortensen article because this matches the default settings of the standard \LaTeXe{} document classes.}
-
-\Key{baselineskip-size-ratio}[\meta{number}][1.2]
-\KeepNextPar*
-
-The key \Key{baselineskip\-/size\-/ratio} sets the ratio of the font baselineskip to the font size.
-By default, the font baselineskip of each font size command equals its font size times \Key{baselineskip\-/size\-/ratio}.
-Users should not adjust this value unless they really know what they are doing.
-When using increased line spacing, users should prefer the low\-/level font command \cs{linespread} or the \pkg{setspace} package.
-
-
-\section{Overwriting the typographic scale}
-\label{sec:overwriting}
-
-In some situations, users may need to explicitly set the scale, size, or baselineskip of a font size command, overwriting the value set by the keys in \S\ref{sec:choosing}.
-Note that the font steps and the scale of \cs{normalsize} are constants and cannot be changed.
-
-\Key{\meta{font size command}/scale}[\meta{number}]
-\KeepNextPar*
-
-The keys \Key{\meta{font size command}\slash{}scale} set the scale of \meta{font size command} to \meta{number}, ignoring the value set by the key \Key{typographic-scale}.
-The key \Key{normalsize\slash{}scale} is not defined.
-
-\Key{\meta{font size command}/size}[\meta{size}]
-\KeepNextPar*
-
-The keys \Key{\meta{font size command}\slash{}size} set the size of \meta{font size command} to \meta{size}, ignoring the values set by the keys \Key{typographic-scale} and \Key{\meta{font size command}\slash{}scale}.
-\meta{size} supplies a default unit of \unit{pt}.
-
-The package will issue a warning if the user sets the keys \Key{\meta{font size command}\slash{}size} and \Key{\meta{font size command}\slash{}scale} for the same \meta{font size command} since the latter key will be ignored.
-
-\Key{\meta{font size command}/baselineskip}[\meta{skip}]
-\KeepNextPar*
-
-The keys \Key{\meta{font size command}\slash{}baselineskip} set the font baselineskip of \meta{font size command} to \meta{skip} instead of calculating it from the size of \meta{font size command} and \Key{baselineskip\-/size\-/ratio}.
-\meta{skip} supplies a default unit of \unit{pt}.
-
-\Key{\meta{font size command}}[\meta{size}]
-\nopagebreak\newline
-\Key{\meta{font size command}}[\meta{size}/\meta{baselineskip}]
-
-The keys \Key{\meta{font size command}} set the keys \Key{\meta{font size command}\slash{}size} or \Key{\meta{font size command}\slash{}baselineskip} in a condensed format.
-The latter format resembles traditional typographic notation where the size and leading of a text can be expressed as, for example, $10/12$ or $11/13$.
-The number before/after the slash is the size/leading in \unit{pts}.
-
-\Key{ignore-order}[true, false][false]
-\KeepNextPar*
-
-The user should take care to ensure that the font sizes and font baselineskips remain in the correct order when directly setting the scales, sizes, or baselineskips of the different font size commands.
-The magnitudes of the sizes and baselineskips should be ordered from \cs{tiny} to \cs{normalsize} to \cs{Huge}.
-This is important for typographic and syntactic consistency.
-This package will issue a warning if they are not in the correct order.
-The user can disable this warning via the key \Key{ignore\-/order}[true] or just \Key{ignore\-/order}.
-
-
-\section{User commands}
-\label{sec:usercommands}
-
-\subsection{Expandable font parameters}
-\label{subsec:fontparameters}
-
-\cs{CurrentFontStep}
-\nopagebreak\newline
-\cs{CurrentFontScale}
-\newline
-\cs{CurrentFontSize}
-\nopagebreak\newline
-\cs{CurrentFontBaselineskip}
-
-These are fully expandable commands that expand to the current font step, scale, size, or baselineskip.
-They can be used for printing or within calculations.
-Caution: \cs{CurrentFontStep} will expand to nothing if the current step is undefined.
-
-Internally, \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} use the kernel command \cs{f@size}.
-\cs{CurrentFontSize} expands to \texttt{f@size pt}.
-\cs{CurrentFontBaselineskip} expands to the kernel command \cs{f@baselineskip}.
-Note that the low\-/level font command \cs{fontsize}\marg{\meta{size}}\allowbreak\marg{\meta{baselineskip}} sets \cs{f@size} before expanding its second argument.
-This means that \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} may need to be first expanded if used in \meta{baselineskip}.
-This package provides the command \cs{SetFontSizeBaselineskip} as an alternative to \cs{fontsize} + \cs{selectfont} that avoids this issue (\S\ref{subsec:fontsize}).
-
-\subsection{More font sizing commands}
-\label{subsec:fontsize}
-
-The \pkg{fontscale} package provides the commands \cs{SetFontStep}, \cs{SetFontScale}, \cs{SetFontSize}, \cs{ScaleFont}, and \cs{SetFontSizeBaselineskip} which set the font size in different ways.
-The first three commands have a starred version which sets the font size relative to the current font size.
-Internally, these commands all use the low\-/level font commands \cs{fontsize}\marg{\meta{size}}\allowbreak\marg{\meta{baselineskip}} and \cs{selectfont}.
-These commands should be used only in special cases.
-Generally, users should prefer the font size commands from \cs{tiny} to \cs{Huge} for typographic and syntactic consistency, although \cs{SetFontStep*}\marg{\meta{integer}} can use a font size command directly.
-
-\cs{SetFontStep}\marg{\meta{number}}
-\nopagebreak\newline
-\cs{SetFontStep*}\marg{\meta{number}}
-
-\cs{SetFontStep} sets the font size by setting the font step to \meta{number}.
-The starred version \cs{SetFontStep*} adds \meta{number} to the current font step.
-If the choice of typographic scale is not modular or musical, then the only valid values for \meta{number} are the integers from \num{-4} to \num{5}, corresponding to the font size commands from \cs{tiny} to \cs{Huge}.
-\cs{SetFontStep} will issue an error if the step is invalid.
-\cs{SetFontStep} sets the font baselineskip to the calculated font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
-If the step matches the step of any font size command, then that font size command will be used directly.
-
-\listheading{Examples:}
-\begin{itemize}
- \item
- For example, \cs{SetFontStep}\marg{-2} and \cs{SetFontStep}\marg{2} use \cs{footnotesize} and \cs{Large}.
- Note that it is typically better to use the equivalent font size command in place of \cs{SetFontStep}\marg{\meta{integer}}.
- \item
- If the current font size is \cs{normalsize}, \cs{SetFontStep*}\marg{1} and \cs{SetFontStep*}\marg{-1} use \cs{large} and \cs{small}.
- This is useful for moving up or down a note on the typographic scale.
- \item
- If the choice of typographic scale is modular or musical, \cs{SetFontStep*}\marg{-0.5} sets the font size and font baselineskip to values between that of \cs{normalsize} and \cs{small}.
- Otherwise, it produces an error.
-\end{itemize}
-
-\cs{SetFontScale}\marg{\meta{number}}
-\nopagebreak\newline
-\cs{SetFontScale*}\marg{\meta{number}}
-
-\cs{SetFontScale} sets the font size by setting the font scale to \meta{number}.
-The font baselineskip is set to the calculated font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
-The starred version \cs{SetFontScale*} adds \meta{number} to the current font scale.
-For example, \cs{SetFontScale}\marg{1.25} makes the font size 25\% larger than \cs{normalsize}.
-If the current font size is \cs{normalsize}, \cs{SetFontScale*}\marg{0.25} is equivalent to \cs{SetFontScale}\marg{1.25}.
-
-\cs{SetFontSize}\marg{\meta{size}}
-\nopagebreak\newline
-\cs{SetFontSize*}\marg{\meta{size}}
-
-\cs{SetFontSize} sets the font size to \meta{size}.
-\meta{size} supplies a default unit of \unit{pt}.
-The font baselineskip is set to the font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
-The starred version \cs{SetFontSize*} adds \meta{size} to the current size.
-For example, \cs{SetFontSize*}\marg{1} and \cs{SetFontSize*}\marg{-1pt} increase and decrease the current font size by a \unit{pt}.
-
-\cs{ScaleFont}\marg{\meta{number}}
-\KeepNextPar*
-
-Scales the current font size and the current font baselineskip by \meta{number}.
-\cs{ScaleFont} resembles the \cs{scalefont} command provided by the \pkg{scalefnt} package, except that it uses floating point calculations and clears the stretch and shrink components of the font baselineskip.
-For example, if the current font size and font baselineskip are \qty{10}{pt} and \qty{12}{pt}, using \cs{ScaleFont}\marg{0.8} will reduce them proportionally to \qty{8}{pt} and \qty{9.6}{pt}.
-
-\cs{SetFontSizeBaselineskip}\marg{\meta{size}}\marg{\meta{baselineskip}}
-\KeepNextPar*
-
-Sets the font size and font baselineskip to \meta{size} and \meta{baselineskip}.
-Both \meta{size} and \meta{baselineskip} supply a default unit of \unit{pt}.
-\cs{SetFontSizeBaselineskip} can be used as an alternative to \cs{fontsize} + \cs{selectfont} as it avoids the issue with \cs{f@size} discussed in \S\ref{subsec:fontparameters}
-\vfill\pagebreak%manual
-
-\subsection{Testing and debugging}
-\label{subsec:debug}
-
-The commands documented here are intended primarily for testing and debugging.
-I have used them often when developing this package so I think users will find them helpful.
-
-\cs{PrintFontParameters}
-\nopagebreak\newline
-\cs{PrintAllFontParameters}
-
-\cs{PrintFontParameters} prints the current step, scale, size, and baselineskip in this order in a comma\-/separated list of key = value pairs.
-If the current step is undefined (as explained for \cs{SetFontStep} in \S\ref{subsec:fontsize}), it will be left blank.
-\cs{PrintAllFontParameters} prints the step, scale, size, and baselineskip of each font size command.
-
-\cs{PrintSampleText}\oarg{\meta{text}}
-\nopagebreak\newline
-\cs{PrintSampleText*}\oarg{\meta{text}}
-
-\cs{PrintSampleText} prints \meta{text} in each font size ordered from \cs{tiny} to \cs{Huge} each followed by a paragraph break.
-The starred version \cs{PrintSampleText*} reverses the sizing order.
-The \meta{text} can be changed via the optional argument, but cannot contain \cs{par} tokens.
-The default \meta{text} is \enquote{The \texttt{fontscale} package: A user interface for setting document font sizes}.
-
-\cs{PrintFontSizeCommand}
-\KeepNextPar*
-
-\cs{PrintFontSizeCommand} tests whether the current font size and font baselineskip match that of any font size command.
-If so, it prints the name of that font size command.
-If not, it instead prints \enquote{UNDEFINED\@}.
-One useful way of printing example text is by using
-\cs{PrintSampleText}\allowbreak\oarg{\cs{PrintFontSizeCommand}:\textvisiblespace{}\cs{PrintFontParameters}}.
-
-\subsection
- {%
- \texorpdfstring
- {More on \cs{fontscalesetup}}
- {More on \textbackslash{}fontscalesetup}%
- }
-\label{subsec:fontscalesetup}
-
-\cs{fontscalesetup}\marg{\meta{keys}}
-\KeepNextPar*
-
-Sets and processes the \pkg{fontscale} package keys and uses \cs{normalsize}.
-\cs{fontscalesetup} can be applied mid\-/document or locally within the current \TeX{} group.
-The key \Key{reset} is also available.
-Its value must be either \texttt{initial} or \texttt{preamble}.
-The key \Key{reset}[initial] or just \Key{reset} sets all the keys to their initial values.
-The key \Key{reset}[preamble] sets all the keys to their values at the end of the preamble (or does nothing if used before the end of the preamble).
-
-
-\section{Programming}
-\label{sec:programming}
-
-This section is relevant to \LaTeX3 programmers.
-
-The user commands \cs{SetFontStep}, \cs{SetFontScale}, \cs{SetFontSize}, \cs{ScaleFont}, and \cs{SetFontSizeBaselineskip} are set up to work with \cs{text_purify:n}.
-\cs{text_purify:n} will correctly remove these commands and their arguments.
-This includes the starred versions \cs{SetFontStep*}, \cs{SetFontScale*}, and \cs{SetFontSize*}.
-
-This package does not provide any public \pkg{expl3} functions.
-
-This package provides some public \pkg{expl3} variables.
-The package stores in public variables the step, scale, size, and baselineskip of each font size command.
-These variables should not be modified directly.
-Instead, they should be modified only indirectly via the command \cs{fontscalesetup}.
-
-Each takes the form:
-
-\begingroup
- \ttfamily
- \textbackslash{}c\_fontscale\_\meta{font size command}\_step\_fp
- \nopagebreak\newline
- \textbackslash{}l\_fontscale\_\meta{font size command}\_scale\_fp
- \newline
- \textbackslash{}l\_fontscale\_\meta{font size command}\_size\_dim
- \nopagebreak\newline
- \textbackslash{}l\_fontscale\_\meta{font size command}\_baselineskip\_skip
-\endgroup
-
-Exception:
-\cs{l_fontscale_normalsize_scale_fp} is not defined.
-The scale of \cs{normalsize} is instead stored as the constant \cs{c_fontscale_normalsize_scale_fp}, which always equals \num{1}.
-
-The step, scale, size, and baselineskip of each font size command are also stored in property lists, one for each font size command:
-
-\texttt{\textbackslash{}l\_fontscale\_\meta{font size command}\_prop}
-
+\documentclass{beery}
+
+\begin{document}
+
+
+\section*
+ {%
+ \SetFontStep*{1}%
+ The \pkg{fontscale} package%
+ }
+
+A user interface for setting document font sizes
+
+Oliver Beery
+
+Version 1.1.1\quad{}7 April 2024
+
+
+\section{Introduction}
+\label{sec:intro}
+
+\subsection{About}
+\label{subsec:about}
+
+\listheading{The \pkg{fontscale} package provides the following functionalities:}
+\begin{itemize}
+ \item
+ Set document font sizes via a classic, modular, or musical typographic scale.
+ \item
+ Set arbitrary scales, sizes, and baselineskips for the standard font size commands \cs{tiny}, \cs{scriptsize}, \cs{footnotesize}, \cs{small}, \cs{normalsize}, \cs{large}, \cs{Large}, \cs{LARGE}, \cs{huge}, and \cs{Huge}.
+ \item
+ Set the font size settings mid\-/document or within a local group.
+ \item
+ Set the font size by setting the font step, scale, or size.
+ \item
+ Set the font size relative to the current font size.
+ \item
+ Use the current font step, scale, size, and baselineskip directly, for example, for printing or within calculations.
+ \item
+ Print sample text to test different font sizes.
+ \item
+ For advanced users, store the step, scale, size, and baselineskip of each font size command in \pkg{expl3} variables.
+\end{itemize}
+
+
+\subsection{Loading the package}
+\label{subsec:loading}
+
+This package requires the 10 October 2023 \pkg{l3kernel} update.
+Since this update is fairly recent, you may need to ensure that your \LaTeX{} installation is up\-/to\-/date before using this package.
+
+This package lets the user set arbitrary font sizes.
+This works with most fonts produced today, but, for historical reasons, the default Computer Modern font is available only in a number of fixed sizes.
+If you get a warning that Computer Modern is not available in the requested size, you may need to add the code \cs{RequirePackage{fix-cm}} before \cs{documentclass} to make Computer Modern available at arbitrary font sizes.
+
+\cs{usepackage}\marg{fontscale}
+\nopagebreak\newline
+\cs{fontscalesetup}\marg{\meta{keys}}
+
+Load the \pkg{fontscale} package via the usual command in the document preamble.
+This package has no package options.
+Instead, the package keys are set up via the command \cs{fontscalesetup}\marg{\meta{keys}}.
+\meta{keys} must receive a comma\-/separated list of keys and their associated values.
+The package keys are documented in \S\ref{sec:choosing} and \S\ref{sec:overwriting}.
+
+Many \LaTeX{} document classes have a font size option (\Key{10pt}, \Key{11pt}, \Key{12pt}, etc.\@) which not only changes the set of document font sizes, but also modifies additional settings such as the page layout and vertical spacing which were specifically designed to work with those font sizes.
+For this reason, you may want to set the document class font size option close to the value of \cs{normalsize} set by this package.
+
+Internally, this package sets up each font size command from \cs{tiny} to \cs{Huge} using the kernel command \cs{@setfontsize}\---they have no additional functionality beyond that of \cs{@setfontsize}.
+Unlike the standard document classes, the font size commands set up by this package do not change the vertical spacing for displayed math and list structures.
+If the user would like to add this functionality or perhaps other features to the font size commands, they can do so via hooks, which are documented in the \LaTeX{} kernel.
+
+
+\subsection{Terminology}
+\label{subsec:terminology}
+
+When using the \pkg{fontscale} package, each font size, including the standard font size commands from \cs{tiny} to \cs{Huge}, has a step, scale, size, and baselineskip.
+The latter two parameters are the familiar first and second arguments to the low\-/level font command \cs{fontsize}\marg{\meta{size}}\marg{\meta{skip}}.
+The font scale is the relative font size; the ratio of the font size to \cs{normalsize}.
+The font step is the number of font size gradations from \cs{normalsize}, which has a step of \num{0}.
+Table~\ref{table:fontsteps} lists the font step of each font size command.
+
+\input{./fontscale-manual-table-font-steps.tex}
+
+
+\section{Choosing the typographic scale}
+\label{sec:choosing}
+
+\Key{typographic-scale}
+ [classic-10pt, classic-11pt, classic-12pt, modular, musical]
+ [classic-10pt]
+\newline
+\Key{modular/ratio}[\meta{number}][1.125]
+\newline
+\Key{musical/ratio}[\meta{number}][2]%
+\nopagebreak\newline
+\Key{musical/notes}[\meta{integer}][5]
+
+The key \Key{typographic\-/scale} sets the font sizes using a classic, modular, or musical typographic scale.
+These are common methods of choosing a set of document font sizes.
+The choice of typographic scale initializes to \Key{classic\-/10pt}.
+
+The key \Key{typographic\-/scale} can also be set in a condensed format via the keys \Key{classic\-/10pt}, \Key{classic\-/11pt}, \Key{classic\-/12pt}, \Key{modular}, or \Key{musical}, which set the key \Key{typographic\-/scale} to the corresponding value.
+
+The classic typographic scale consists of the traditional font sizes
+\numlist{6;7;8;9;10;11;12;14;16;18;21;24;36;48;60;72}.%
+\footnote{See \S{}3.1 of \textit{The Elements of Typographic Style} by Robert Bringhurst.}
+They have been used since the sixteenth century and are the default font sizes on most computer software.
+The keys \Key{classic-10pt, classic-11pt, classic-12pt} set the size of each font size command to values based on their position in the classic typographic scale.
+The size of \cs{normalsize} is the named point size.
+The sizes of the other font size commands are the adjacent font sizes in the scale.
+Table~\ref{table:classicscales} lists the size of each font size command when using a classic typographic scale.
+
+\input{./fontscale-manual-table-classic.tex}
+
+The key \Key{modular} sets the font sizes from \cs{tiny} to \cs{Huge} using a modular typographic scale.
+In a modular scale, each font size is a fixed ratio from the adjacent font sizes.%
+\footnote{\url{https://alistapart.com/article/more-meaningful-typography/}}
+Here, the base font size is the size of \cs{normalsize}, which can be set via the key \Key{normalsize/size}[\meta{size}], more documented in \S\ref{sec:overwriting}.
+If not set, \cs{normalsize} initializes to \qty{10}{pt}.
+The modular ratio can be set via the key \Key{modular\slash{}ratio}.
+The initial modular ratio is \num{1.125}.
+
+\input{./fontscale-manual-table-modular-musical.tex}
+
+The key \Key{musical} sets the font sizes according to their position in a musical typographic scale.
+The font size is calculated using the formula:%
+\footnote
+ {%
+ I have referenced this article by Spencer Mortensen:
+ \newline
+ \url{https://spencermortensen.com/articles/typographic-scale/}%
+ }
+\[ f_i = f_0 \times r ^ { i / n } \]
+$f_0$ is the base font size, the size of \cs{normalsize}.
+$f_i$ is the font size with font step~$i$.
+$n$ is the number of notes in the musical scale\---the number of font size gradations or steps above \cs{normalsize}.
+$r$ is the ratio of the musical scale, the ratio of the highest to the lowest note $ f_n / f_0 $.
+(The modular typographic scale is actually a special case of the musical typographic scale where $n=1$.)
+
+The musical ratio~$r$ and the number of notes~$n$ can be set via the keys \Key{musical\slash{}ratio} and \Key{musical\slash{}notes}.
+The initial musical ratio\---\num{2}\---and the initial number of notes\---\num{5}\---are the same as that of the classic typographic scale.%
+\footnote{Ibid.}
+Conveniently, \cs{Huge} is \num{5} steps above \cs{normalsize}.
+The font size of \cs{normalsize}~$f_0$ can be set using the key \Key{normalsize/size}[\meta{size}], more documented in \S\ref{sec:overwriting}.
+When using a musical typographic scale, \cs{normalsize} initializes to \qty{10}{pt}.%
+\footnote {I have set the initial value to \qty{10}{pt} instead of the \qty{12}{pt} recommended by the Spencer Mortensen article because this matches the default settings of the standard \LaTeXe{} document classes.}
+
+\Key{baselineskip-size-ratio}[\meta{number}][1.2]
+\KeepNextPar*
+
+The key \Key{baselineskip\-/size\-/ratio} sets the ratio of the font baselineskip to the font size.
+By default, the font baselineskip of each font size command equals its font size times \Key{baselineskip\-/size\-/ratio}.
+Users should not adjust this value unless they really know what they are doing.
+When using increased line spacing, users should prefer the low\-/level font command \cs{linespread} or the \pkg{setspace} package.
+
+
+\section{Overwriting the typographic scale}
+\label{sec:overwriting}
+
+In some situations, users may need to explicitly set the scale, size, or baselineskip of a font size command, overwriting the value set by the keys in \S\ref{sec:choosing}.
+Note that the font steps and the scale of \cs{normalsize} are constants and cannot be changed.
+
+\Key{\meta{font size command}/scale}[\meta{number}]
+\KeepNextPar*
+
+The keys \Key{\meta{font size command}\slash{}scale} set the scale of \meta{font size command} to \meta{number}, ignoring the value set by the key \Key{typographic-scale}.
+The key \Key{normalsize\slash{}scale} is not defined.
+
+\Key{\meta{font size command}/size}[\meta{size}]
+\KeepNextPar*
+
+The keys \Key{\meta{font size command}\slash{}size} set the size of \meta{font size command} to \meta{size}, ignoring the values set by the keys \Key{typographic-scale} and \Key{\meta{font size command}\slash{}scale}.
+\meta{size} supplies a default unit of \unit{pt}.
+
+The package will issue a warning if the user sets the keys \Key{\meta{font size command}\slash{}size} and \Key{\meta{font size command}\slash{}scale} for the same \meta{font size command} since the latter key will be ignored.
+
+\Key{\meta{font size command}/baselineskip}[\meta{skip}]
+\KeepNextPar*
+
+The keys \Key{\meta{font size command}\slash{}baselineskip} set the font baselineskip of \meta{font size command} to \meta{skip} instead of calculating it from the size of \meta{font size command} and \Key{baselineskip\-/size\-/ratio}.
+\meta{skip} supplies a default unit of \unit{pt}.
+
+\Key{\meta{font size command}}[\meta{size}]
+\nopagebreak\newline
+\Key{\meta{font size command}}[\meta{size}/\meta{skip}]
+
+The keys \Key{\meta{font size command}} set the keys \Key{\meta{font size command}\slash{}size} or \Key{\meta{font size command}\slash{}baselineskip} in a condensed format.
+The latter format resembles traditional typographic notation where the size and leading of a text can be expressed as, for example, $10/12$ or $11/13$.
+The number before/after the slash is the size/leading in \unit{pts}.
+
+\Key{ignore-order}[true, false][false]
+\KeepNextPar*
+
+The user should take care to ensure that the font sizes and font baselineskips remain in the correct order when directly setting the scales, sizes, or baselineskips of the different font size commands.
+The magnitudes of the sizes and baselineskips should be ordered from \cs{tiny} to \cs{normalsize} to \cs{Huge}.
+This is important for typographic and syntactic consistency.
+This package will issue a warning if they are not in the correct order.
+The user can disable this warning via the key \Key{ignore\-/order}[true] or just \Key{ignore\-/order}.
+
+
+\section{User commands}
+\label{sec:usercommands}
+
+\subsection{Expandable font parameters}
+\label{subsec:fontparameters}
+
+\cs{CurrentFontStep}
+\nopagebreak\newline
+\cs{CurrentFontScale}
+\newline
+\cs{CurrentFontSize}
+\nopagebreak\newline
+\cs{CurrentFontBaselineskip}
+
+These are fully expandable commands that expand to the current font step, scale, size, or baselineskip.
+They can be used for printing or within calculations.
+Caution: \cs{CurrentFontStep} will expand to nothing if the current step is undefined.
+
+Internally, \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} use the kernel command \cs{f@size}.
+\cs{CurrentFontSize} expands to \texttt{f@size pt}.
+\cs{CurrentFontBaselineskip} expands to the kernel command \cs{f@baselineskip}.
+Note that the low\-/level font command \cs{fontsize}\marg{\meta{size}}\allowbreak\marg{\meta{skip}} sets \cs{f@size} before expanding its second argument.
+This means that \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} may need to be first expanded if used in \meta{skip}.
+This package provides the command \cs{SetFontSizeBaselineskip} as an alternative to \cs{fontsize} + \cs{selectfont} that avoids this issue (\S\ref{subsec:fontsize}).
+
+\subsection{More font sizing commands}
+\label{subsec:fontsize}
+
+The \pkg{fontscale} package provides the commands \cs{SetFontStep}, \cs{SetFontScale}, \cs{SetFontSize}, \cs{ScaleFont}, and \cs{SetFontSizeBaselineskip} which set the font size in different ways.
+The first three commands have a starred version which sets the font size relative to the current font size.
+Internally, these commands all use the low\-/level font commands \cs{fontsize}\marg{\meta{size}}\allowbreak\marg{\meta{skip}} and \cs{selectfont}.
+These commands should be used only in special cases.
+Generally, users should prefer the font size commands from \cs{tiny} to \cs{Huge} for typographic and syntactic consistency, although \cs{SetFontStep*}\marg{\meta{integer}} can use a font size command directly.
+
+\cs{SetFontStep}\marg{\meta{number}}
+\nopagebreak\newline
+\cs{SetFontStep*}\marg{\meta{number}}
+
+\cs{SetFontStep} sets the font size by setting the font step to \meta{number}.
+The starred version \cs{SetFontStep*} adds \meta{number} to the current font step.
+If the choice of typographic scale is not modular or musical, then the only valid values for \meta{number} are the integers from \num{-4} to \num{5}, corresponding to the font size commands from \cs{tiny} to \cs{Huge}.
+\cs{SetFontStep} will issue an error if the step is invalid.
+\cs{SetFontStep} sets the font baselineskip to the calculated font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
+If the step matches the step of any font size command, then that font size command will be used directly.
+
+\listheading{Examples:}
+\begin{itemize}
+ \item
+ For example, \cs{SetFontStep}\marg{-2} and \cs{SetFontStep}\marg{2} use \cs{footnotesize} and \cs{Large}.
+ Note that it is typically better to use the equivalent font size command in place of \cs{SetFontStep}\marg{\meta{integer}}.
+ \item
+ If the current font size is \cs{normalsize}, \cs{SetFontStep*}\marg{1} and \cs{SetFontStep*}\marg{-1} use \cs{large} and \cs{small}.
+ This is useful for moving up or down a note on the typographic scale.
+ \item
+ If the choice of typographic scale is modular or musical, \cs{SetFontStep*}\marg{-0.5} sets the font size and font baselineskip to values between that of \cs{normalsize} and \cs{small}.
+ Otherwise, it produces an error.
+\end{itemize}
+
+\cs{SetFontScale}\marg{\meta{number}}
+\nopagebreak\newline
+\cs{SetFontScale*}\marg{\meta{number}}
+
+\cs{SetFontScale} sets the font size by setting the font scale to \meta{number}.
+The font baselineskip is set to the calculated font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
+The starred version \cs{SetFontScale*} adds \meta{number} to the current font scale.
+For example, \cs{SetFontScale}\marg{1.25} makes the font size 25\% larger than \cs{normalsize}.
+If the current font size is \cs{normalsize}, \cs{SetFontScale*}\marg{0.25} is equivalent to \cs{SetFontScale}\marg{1.25}.
+
+\cs{SetFontSize}\marg{\meta{size}}
+\nopagebreak\newline
+\cs{SetFontSize*}\marg{\meta{size}}
+
+\cs{SetFontSize} sets the font size to \meta{size}.
+\meta{size} supplies a default unit of \unit{pt}.
+The font baselineskip is set to the font size \texttimes{} \Key{baselineskip\-/size\-/ratio}.
+The starred version \cs{SetFontSize*} adds \meta{size} to the current size.
+For example, \cs{SetFontSize*}\marg{1} and \cs{SetFontSize*}\marg{-1pt} increase and decrease the current font size by a \unit{pt}.
+
+\cs{ScaleFont}\marg{\meta{number}}
+\KeepNextPar*
+
+Scales the current font size and the current font baselineskip by a factor of \meta{number}.
+\cs{ScaleFont} resembles the \cs{scalefont} command provided by the \pkg{scalefnt} package, except that it uses floating point calculations and clears the stretch and shrink components of the font baselineskip.
+For example, if the current font size and font baselineskip are \qty{10}{pt} and \qty{12}{pt}, using \cs{ScaleFont}\marg{0.8} will reduce them proportionally to \qty{8}{pt} and \qty{9.6}{pt}.
+
+\cs{SetFontSizeBaselineskip}\marg{\meta{size}}\marg{\meta{skip}}
+\KeepNextPar*
+
+Sets the font size and font baselineskip to \meta{size} and \meta{skip}.
+Both \meta{size} and \meta{skip} supply a default unit of \unit{pt}.
+\cs{SetFontSizeBaselineskip} can be used as an alternative to \cs{fontsize} + \cs{selectfont} as it avoids the issue with \cs{f@size} discussed in \S\ref{subsec:fontparameters}
+\vfill\pagebreak%manual
+
+\subsection{Testing and debugging}
+\label{subsec:debug}
+
+The commands documented here are intended primarily for testing and debugging.
+I have used them often when developing this package so I think users will find them helpful.
+
+\cs{PrintFontParameters}
+\nopagebreak\newline
+\cs{PrintAllFontParameters}
+
+\cs{PrintFontParameters} prints the current step, scale, size, and baselineskip in this order in a comma\-/separated list of key = value pairs.
+If the current step is undefined (as explained for \cs{SetFontStep} in \S\ref{subsec:fontsize}), it will be left blank.
+\cs{PrintAllFontParameters} prints the step, scale, size, and baselineskip of each font size command.
+
+\cs{PrintSampleText}\oarg{\meta{text}}
+\nopagebreak\newline
+\cs{PrintSampleText*}\oarg{\meta{text}}
+
+\cs{PrintSampleText} prints \meta{text} in each font size ordered from \cs{tiny} to \cs{Huge} each followed by a paragraph break.
+The starred version \cs{PrintSampleText*} reverses the sizing order.
+The \meta{text} can be changed via the optional argument, but cannot contain \cs{par} tokens.
+The default \meta{text} is \enquote{The \texttt{fontscale} package: A user interface for setting document font sizes}.
+
+\cs{PrintFontSizeCommand}
+\KeepNextPar*
+
+\cs{PrintFontSizeCommand} tests whether the current font size and font baselineskip match that of any font size command.
+If so, it prints the name of that font size command.
+If not, it instead prints \enquote{UNDEFINED\@}.
+One useful way of printing example text is by using
+\cs{PrintSampleText}\allowbreak\oarg{\cs{PrintFontSizeCommand}:\textvisiblespace{}\cs{PrintFontParameters}}.
+
+\subsection
+ {%
+ \texorpdfstring
+ {More on \cs{fontscalesetup}}
+ {More on \textbackslash{}fontscalesetup}%
+ }
+\label{subsec:fontscalesetup}
+
+\cs{fontscalesetup}\marg{\meta{keys}}
+\KeepNextPar*
+
+Sets and processes the \pkg{fontscale} package keys and uses \cs{normalsize}.
+\cs{fontscalesetup} can be applied mid\-/document or locally within the current \TeX{} group.
+The key \Key{reset} is also available.
+Its value must be either \texttt{initial} or \texttt{preamble}.
+The key \Key{reset}[initial] or just \Key{reset} sets all the keys to their initial values.
+The key \Key{reset}[preamble] sets all the keys to their values at the end of the preamble (or does nothing if used before the end of the preamble).
+
+
+\section{Programming}
+\label{sec:programming}
+
+This section is relevant to \LaTeX3 programmers.
+
+The user commands \cs{SetFontStep}, \cs{SetFontScale}, \cs{SetFontSize}, \cs{ScaleFont}, and \cs{SetFontSizeBaselineskip} are set up to work with \cs{text_purify:n}.
+\cs{text_purify:n} will correctly remove these commands and their arguments.
+This includes the starred versions \cs{SetFontStep*}, \cs{SetFontScale*}, and \cs{SetFontSize*}.
+
+This package does not provide any public \pkg{expl3} functions.
+
+This package provides some public \pkg{expl3} variables.
+The package stores in public variables the step, scale, size, and baselineskip of each font size command.
+These variables should not be modified directly.
+Instead, they should be modified only indirectly via the command \cs{fontscalesetup}.
+
+Each takes the form:
+
+\begingroup
+ \ttfamily
+ \textbackslash{}c\_fontscale\_\meta{font size command}\_step\_fp
+ \nopagebreak\newline
+ \textbackslash{}l\_fontscale\_\meta{font size command}\_scale\_fp
+ \newline
+ \textbackslash{}l\_fontscale\_\meta{font size command}\_size\_dim
+ \nopagebreak\newline
+ \textbackslash{}l\_fontscale\_\meta{font size command}\_baselineskip\_skip
+\endgroup
+
+Exception:
+\cs{l_fontscale_normalsize_scale_fp} is not defined.
+The scale of \cs{normalsize} is instead stored as the constant \cs{c_fontscale_normalsize_scale_fp}, which always equals \num{1}.
+
+The step, scale, size, and baselineskip of each font size command are also stored in property lists, one for each font size command:
+
+\texttt{\textbackslash{}l\_fontscale\_\meta{font size command}\_prop}
+
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/fontscale/fontscale.sty b/macros/latex/contrib/fontscale/fontscale.sty
index 2047438621..b89dccbb3c 100644
--- a/macros/latex/contrib/fontscale/fontscale.sty
+++ b/macros/latex/contrib/fontscale/fontscale.sty
@@ -1,1308 +1,1315 @@
-% Package : fontscale -- A user interface for setting document font sizes
-% Copyright : 2024 (c) Oliver Beery <beeryoliver@gmail.com>
-% CTAN : https://ctan.org/pkg/fontscale
-% Repository: https://github.com/beeryoliver/fontscale
-% License : The LaTeX Project Public License 1.3c
-
-% The 2022-06-01 LaTeX kernel update added \ProcessKeyOptions.
-\NeedsTeXFormat{LaTeX2e}[2022-06-01]
-\ProvidesExplPackage
- {fontscale}
- {2024-03-31}
- {1.1.0}
- {A user interface for setting document font sizes}
-
-% The 2023-10-10 l3kernel update added many 'e'-variants.
-\IfExplAtLeastTF { 2023-10-10 }
- { }
- {
- \msg_new:nnn { fontscale } { expl3-out-of-date }
- {
- The~ package~ could~ not~ load.~
- The~ fontscale~ package~ requires~
- L3~ programming~ layer~ version~ 2023-10-10~ or~ later.
- }
- \msg_critical:nn { fontscale } { expl3-out-of-date }
- }
-
-% SOME VARIABLES
-
-\fp_const:Nn \c_fontscale_tiny_step_fp { -4 }
-\fp_const:Nn \c_fontscale_scriptsize_step_fp { -3 }
-\fp_const:Nn \c_fontscale_footnotesize_step_fp { -2 }
-\fp_const:Nn \c_fontscale_small_step_fp { -1 }
-\fp_const:Nn \c_fontscale_normalsize_step_fp { 0 }
-\fp_const:Nn \c_fontscale_large_step_fp { 1 }
-\fp_const:Nn \c_fontscale_Large_step_fp { 2 }
-\fp_const:Nn \c_fontscale_LARGE_step_fp { 3 }
-\fp_const:Nn \c_fontscale_huge_step_fp { 4 }
-\fp_const:Nn \c_fontscale_Huge_step_fp { 5 }
-
-\fp_const:Nn \c_fontscale_normalsize_scale_fp { 1 }
-
-\seq_const_from_clist:Nn \c__fontscale_names_seq
- {
- tiny
- , scriptsize
- , footnotesize
- , small
- , normalsize
- , large
- , Large
- , LARGE
- , huge
- , Huge
- }
-\seq_const_from_clist:Nn \c__fontscale_names_other_seq
- {
- tiny
- , scriptsize
- , footnotesize
- , small
- , large
- , Large
- , LARGE
- , huge
- , Huge
- }
-
-\prop_new:N \l_fontscale_tiny_prop
-\prop_new:N \l_fontscale_scriptsize_prop
-\prop_new:N \l_fontscale_footnotesize_prop
-\prop_new:N \l_fontscale_small_prop
-\prop_new:N \l_fontscale_normalsize_prop
-\prop_new:N \l_fontscale_large_prop
-\prop_new:N \l_fontscale_Large_prop
-\prop_new:N \l_fontscale_LARGE_prop
-\prop_new:N \l_fontscale_huge_prop
-\prop_new:N \l_fontscale_Huge_prop
-
-\prop_put:Nnn \l_fontscale_tiny_prop { step } { -4 }
-\prop_put:Nnn \l_fontscale_scriptsize_prop { step } { -3 }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { step } { -2 }
-\prop_put:Nnn \l_fontscale_small_prop { step } { -1 }
-\prop_put:Nnn \l_fontscale_normalsize_prop { step } { 0 }
-\prop_put:Nnn \l_fontscale_large_prop { step } { 1 }
-\prop_put:Nnn \l_fontscale_Large_prop { step } { 2 }
-\prop_put:Nnn \l_fontscale_LARGE_prop { step } { 3 }
-\prop_put:Nnn \l_fontscale_huge_prop { step } { 4 }
-\prop_put:Nnn \l_fontscale_Huge_prop { step } { 5 }
-
-\prop_put:Nnn \l_fontscale_normalsize_prop { scale } { 1 }
-
-\fp_new:N \l_fontscale_tiny_scale_fp
-\fp_new:N \l_fontscale_scriptsize_scale_fp
-\fp_new:N \l_fontscale_footnotesize_scale_fp
-\fp_new:N \l_fontscale_small_scale_fp
-\fp_new:N \l_fontscale_large_scale_fp
-\fp_new:N \l_fontscale_Large_scale_fp
-\fp_new:N \l_fontscale_LARGE_scale_fp
-\fp_new:N \l_fontscale_huge_scale_fp
-\fp_new:N \l_fontscale_Huge_scale_fp
-
-\dim_new:N \l_fontscale_tiny_size_dim
-\dim_new:N \l_fontscale_scriptsize_size_dim
-\dim_new:N \l_fontscale_footnotesize_size_dim
-\dim_new:N \l_fontscale_small_size_dim
-\dim_new:N \l_fontscale_normalsize_size_dim
-\dim_new:N \l_fontscale_large_size_dim
-\dim_new:N \l_fontscale_Large_size_dim
-\dim_new:N \l_fontscale_LARGE_size_dim
-\dim_new:N \l_fontscale_huge_size_dim
-\dim_new:N \l_fontscale_Huge_size_dim
-
-\skip_new:N \l_fontscale_tiny_baselineskip_skip
-\skip_new:N \l_fontscale_scriptsize_baselineskip_skip
-\skip_new:N \l_fontscale_footnotesize_baselineskip_skip
-\skip_new:N \l_fontscale_small_baselineskip_skip
-\skip_new:N \l_fontscale_normalsize_baselineskip_skip
-\skip_new:N \l_fontscale_large_baselineskip_skip
-\skip_new:N \l_fontscale_Large_baselineskip_skip
-\skip_new:N \l_fontscale_LARGE_baselineskip_skip
-\skip_new:N \l_fontscale_huge_baselineskip_skip
-\skip_new:N \l_fontscale_Huge_baselineskip_skip
-
-\fp_new:N \l__fontscale_normalsize_size_fp
-\str_new:N \l__fontscale_typographic_scale_str
-\tl_new:N \l__fontscale_keys_precompile_preamble_tl
-
-% Temporary variables
-\fp_new:N \l__fontscale_step_fp
-\tl_new:N \l__fontscale_step_tl
-\tl_new:N \l__fontscale_scale_tl
-\dim_new:N \l__fontscale_size_dim
-\skip_new:N \l__fontscale_baselineskip_skip
-
-% INITIAL FONT PARAMETERS
-
-\fp_set:Nn \l__fontscale_normalsize_size_fp { 10 }
-
-\dim_set:Nn \l_fontscale_tiny_size_dim { 6pt }
-\dim_set:Nn \l_fontscale_scriptsize_size_dim { 7pt }
-\dim_set:Nn \l_fontscale_footnotesize_size_dim { 8pt }
-\dim_set:Nn \l_fontscale_small_size_dim { 9pt }
-\dim_set:Nn \l_fontscale_normalsize_size_dim { 10pt }
-\dim_set:Nn \l_fontscale_large_size_dim { 11pt }
-\dim_set:Nn \l_fontscale_Large_size_dim { 12pt }
-\dim_set:Nn \l_fontscale_LARGE_size_dim { 14pt }
-\dim_set:Nn \l_fontscale_huge_size_dim { 16pt }
-\dim_set:Nn \l_fontscale_Huge_size_dim { 18pt }
-
-\fp_set:Nn \l_fontscale_tiny_scale_fp { 0.6 }
-\fp_set:Nn \l_fontscale_scriptsize_scale_fp { 0.7 }
-\fp_set:Nn \l_fontscale_footnotesize_scale_fp { 0.8 }
-\fp_set:Nn \l_fontscale_small_scale_fp { 0.9 }
-\fp_set:Nn \l_fontscale_large_scale_fp { 1.1 }
-\fp_set:Nn \l_fontscale_Large_scale_fp { 1.2 }
-\fp_set:Nn \l_fontscale_LARGE_scale_fp { 1.4 }
-\fp_set:Nn \l_fontscale_huge_scale_fp { 1.6 }
-\fp_set:Nn \l_fontscale_Huge_scale_fp { 1.8 }
-
-\skip_set:Nn \l_fontscale_tiny_baselineskip_skip { 7.2pt }
-\skip_set:Nn \l_fontscale_scriptsize_baselineskip_skip { 8.4pt }
-\skip_set:Nn \l_fontscale_footnotesize_baselineskip_skip { 9.6pt }
-\skip_set:Nn \l_fontscale_small_baselineskip_skip { 10.8pt }
-\skip_set:Nn \l_fontscale_normalsize_baselineskip_skip { 12 pt }
-\skip_set:Nn \l_fontscale_large_baselineskip_skip { 13.2pt }
-\skip_set:Nn \l_fontscale_Large_baselineskip_skip { 14.4pt }
-\skip_set:Nn \l_fontscale_LARGE_baselineskip_skip { 16.8pt }
-\skip_set:Nn \l_fontscale_huge_baselineskip_skip { 19.2pt }
-\skip_set:Nn \l_fontscale_Huge_baselineskip_skip { 21.6pt }
-
-\prop_put:Nnn \l_fontscale_tiny_prop { scale } { 0.6 }
-\prop_put:Nnn \l_fontscale_scriptsize_prop { scale } { 0.7 }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { scale } { 0.8 }
-\prop_put:Nnn \l_fontscale_small_prop { scale } { 0.9 }
-\prop_put:Nnn \l_fontscale_large_prop { scale } { 1.1 }
-\prop_put:Nnn \l_fontscale_Large_prop { scale } { 1.2 }
-\prop_put:Nnn \l_fontscale_LARGE_prop { scale } { 1.4 }
-\prop_put:Nnn \l_fontscale_huge_prop { scale } { 1.6 }
-\prop_put:Nnn \l_fontscale_Huge_prop { scale } { 1.8 }
-
-\prop_put:Nnn \l_fontscale_tiny_prop { size } { 6pt }
-\prop_put:Nnn \l_fontscale_scriptsize_prop { size } { 7pt }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { size } { 8pt }
-\prop_put:Nnn \l_fontscale_small_prop { size } { 9pt }
-\prop_put:Nnn \l_fontscale_normalsize_prop { size } { 10pt }
-\prop_put:Nnn \l_fontscale_large_prop { size } { 11pt }
-\prop_put:Nnn \l_fontscale_Large_prop { size } { 12pt }
-\prop_put:Nnn \l_fontscale_LARGE_prop { size } { 14pt }
-\prop_put:Nnn \l_fontscale_huge_prop { size } { 16pt }
-\prop_put:Nnn \l_fontscale_Huge_prop { size } { 18pt }
-
-\prop_put:Nnn \l_fontscale_tiny_prop { baselineskip } { 7.2pt }
-\prop_put:Nnn \l_fontscale_scriptsize_prop { baselineskip } { 8.4pt }
-\prop_put:Nnn \l_fontscale_footnotesize_prop { baselineskip } { 9.6pt }
-\prop_put:Nnn \l_fontscale_small_prop { baselineskip } { 10.8pt }
-\prop_put:Nnn \l_fontscale_normalsize_prop { baselineskip } { 12 pt }
-\prop_put:Nnn \l_fontscale_large_prop { baselineskip } { 13.2pt }
-\prop_put:Nnn \l_fontscale_Large_prop { baselineskip } { 14.4pt }
-\prop_put:Nnn \l_fontscale_LARGE_prop { baselineskip } { 16.8pt }
-\prop_put:Nnn \l_fontscale_huge_prop { baselineskip } { 19.2pt }
-\prop_put:Nnn \l_fontscale_Huge_prop { baselineskip } { 21.6pt }
-
-% SOME HELPER FUNCTIONS
-
-% Sets a dimen or skip variable, supplying a default unit of pt.
-\cs_new_protected:Npn \__fontscale_dim_set_with_default_unit:Nn #1#2
- { \@defaultunits #1 = \dimexpr #2 pt \relax \relax \@nnil }
-\cs_generate_variant:Nn \__fontscale_dim_set_with_default_unit:Nn { c }
-\cs_new_protected:Npn \__fontscale_skip_set_with_default_unit:Nn #1#2
- { \@defaultunits #1 = \glueexpr #2 pt \relax \@nnil }
-\cs_generate_variant:Nn \__fontscale_skip_set_with_default_unit:Nn { c }
-
-% MESSAGES
-
-\msg_new:nnn { fontscale } { key-font-scale-ignored }
- {
- Key~ #1 / scale~
- \msg_line_context: \c_space_tl
- ignored.~
- Setting~ the~ scale~ and~ size~ keys~ for~ the~ same~
- font~ size~ command~ ignores~ the~ scale~ key.
- }
-\msg_new:nnn { fontscale } { font-sizes-out-of-order }
- {
- The~ font~ sizes~
- \msg_line_context: \c_space_tl
- are~ not~ in~ the~ correct~ order.~
- The~ magnitude~ of~ the~ font~ sizes~ should~ be~ ordered~ from~
- \token_to_str:N \tiny \c_space_tl
- to~
- \token_to_str:N \normalsize \c_space_tl
- to~
- \token_to_str:N \Huge .
- }
-\msg_new:nnn { fontscale } { font-baselineskips-out-of-order }
- {
- The~ font~ baselineskips~
- \msg_line_context: \c_space_tl
- are~ not~ in~ the~ correct~ order.~
- The~ magnitude~ of~ the~ font~ baselineskips~ should~ be~ ordered~ from~
- \token_to_str:N \tiny \c_space_tl
- to~
- \token_to_str:N \normalsize \c_space_tl
- to~
- \token_to_str:N \Huge .
- }
-\msg_new:nnn { fontscale } { font-step-out-of-bounds }
- {
- The~ font~ step~
- \msg_line_context: \c_space_tl
- must~ be~ an~ integer~ from~ -4~ to~ 5,~
- unless~ the~ choice~ of~ typographic~ scale~ is~ modular~ or~ musical.
- }
-
-% DEFINE KEYS
-
-\keys_define:nn { fontscale }
- {
- reset .choices:nn = { initial , preamble }
- {
- \int_case:nn { \l_keys_choice_int }
- {
- { 1 } { \c__fontscale_keys_precompile_initial_tl }
- { 2 } { \l__fontscale_keys_precompile_preamble_tl }
- }
- }
- , reset .default:n = initial
-
- , ignore-order .bool_set:N = \l__fontscale_ignore_order_bool
- , ignore-order .default:n = true
-
- , baselineskip-size-ratio .fp_set:N =
- \l__fontscale_baselineskip_size_ratio_fp
- , baselineskip-size-ratio .value_required:n = true
-
- , typographic-scale .choices:nn =
- { classic-10pt , classic-11pt , classic-12pt , modular , musical }
- { \str_set:Nn \l__fontscale_typographic_scale_str {#1} }
- , typographic-scale .value_required:n = true
-
- , classic-10pt .meta:n = { typographic-scale = classic-10pt }
- , classic-10pt .value_forbidden:n = true
-
- , classic-11pt .meta:n = { typographic-scale = classic-11pt }
- , classic-11pt .value_forbidden:n = true
-
- , classic-12pt .meta:n = { typographic-scale = classic-12pt }
- , classic-12pt .value_forbidden:n = true
-
- , modular .meta:n = { typographic-scale = modular }
- , modular .value_forbidden:n = true
-
- , musical .meta:n = { typographic-scale = musical }
- , musical .value_forbidden:n = true
-
- , modular / ratio .fp_set:N = \l__fontscale_modular_ratio_fp
- , modular / ratio .value_required:n = true
- }
-\keys_define:nn { fontscale / musical }
- {
- ratio .fp_set:N = \l__fontscale_musical_ratio_fp
- , ratio .value_required:n = true
-
- , notes .int_set:N = \l__fontscale_musical_notes_int
- , notes .value_required:n = true
- }
-\keys_define:nn { fontscale / tiny }
- {
- scale .tl_set:N = \l__fontscale_tiny_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_tiny_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_tiny_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / scriptsize }
- {
- scale .tl_set:N = \l__fontscale_scriptsize_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_scriptsize_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_scriptsize_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / footnotesize }
- {
- scale .tl_set:N = \l__fontscale_footnotesize_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_footnotesize_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_footnotesize_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / small }
- {
- scale .tl_set:N = \l__fontscale_small_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_small_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_small_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / normalsize }
- {
- size .tl_set:N = \l__fontscale_normalsize_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_normalsize_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / large }
- {
- scale .tl_set:N = \l__fontscale_large_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_large_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_large_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / Large }
- {
- scale .tl_set:N = \l__fontscale_Large_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_Large_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_Large_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / LARGE }
- {
- scale .tl_set:N = \l__fontscale_LARGE_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_LARGE_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_LARGE_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / huge }
- {
- scale .tl_set:N = \l__fontscale_huge_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_huge_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_huge_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale / Huge }
- {
- scale .tl_set:N = \l__fontscale_Huge_scale_tl
- , scale .value_required:n = true
-
- , size .tl_set:N = \l__fontscale_Huge_size_tl
- , size .value_required:n = true
-
- , baselineskip .tl_set:N = \l__fontscale_Huge_baselineskip_tl
- , baselineskip .value_required:n = true
- }
-\keys_define:nn { fontscale }
- {
- tiny .code:n = \__fontscale_keys_name_code:n {#1}
- , tiny .value_required:n = true
-
- , scriptsize .code:n = \__fontscale_keys_name_code:n {#1}
- , scriptsize .value_required:n = true
-
- , footnotesize .code:n = \__fontscale_keys_name_code:n {#1}
- , footnotesize .value_required:n = true
-
- , small .code:n = \__fontscale_keys_name_code:n {#1}
- , small .value_required:n = true
-
- , normalsize .code:n = \__fontscale_keys_name_code:n {#1}
- , normalsize .value_required:n = true
-
- , large .code:n = \__fontscale_keys_name_code:n {#1}
- , large .value_required:n = true
-
- , Large .code:n = \__fontscale_keys_name_code:n {#1}
- , Large .value_required:n = true
-
- , LARGE .code:n = \__fontscale_keys_name_code:n {#1}
- , LARGE .value_required:n = true
-
- , huge .code:n = \__fontscale_keys_name_code:n {#1}
- , huge .value_required:n = true
-
- , Huge .code:n = \__fontscale_keys_name_code:n {#1}
- , Huge .value_required:n = true
- }
-\cs_new_protected:Npn \__fontscale_keys_name_code:n #1
- {
- \str_if_in:nnTF {#1} { / }
- { \__fontscale_keys_name_code_split:ww #1 \q_stop }
- { \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1} }
- }
-\cs_new_protected:Npn \__fontscale_keys_name_code_split:ww #1 / #2 \q_stop
- {
- \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1}
- \tl_set:cn { l__fontscale_ \l_keys_key_str _baselineskip_tl } {#2}
- }
-
-% PRE-COMPILE KEYS
-
-% Pre-compiles the keys with their initial values. The keys are pre-compiled
-% by hand for speed.
-\tl_const:Nn \c__fontscale_keys_precompile_initial_tl
- {
- \bool_set_false:N \l__fontscale_ignore_order_bool
- \fp_set:Nn \l__fontscale_baselineskip_size_ratio_fp { 1.2 }
- \str_set:Nn \l__fontscale_typographic_scale_str { classic-10pt }
- \fp_set:Nn \l__fontscale_modular_ratio_fp { 1.125 }
- \fp_set:Nn \l__fontscale_musical_ratio_fp { 2 }
- \int_set:Nn \l__fontscale_musical_notes_int { 5 }
-
- \tl_set:Nn \l__fontscale_tiny_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_scriptsize_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_footnotesize_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_small_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_large_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_Large_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_LARGE_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_huge_scale_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_Huge_scale_tl { \q_no_value }
-
- \tl_set:Nn \l__fontscale_tiny_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_scriptsize_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_footnotesize_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_small_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_normalsize_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_large_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_Large_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_LARGE_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_huge_size_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_Huge_size_tl { \q_no_value }
-
- \tl_set:Nn \l__fontscale_tiny_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_scriptsize_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_footnotesize_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_small_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_normalsize_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_large_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_Large_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_LARGE_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_huge_baselineskip_tl { \q_no_value }
- \tl_set:Nn \l__fontscale_Huge_baselineskip_tl { \q_no_value }
- }
-\c__fontscale_keys_precompile_initial_tl
-
-% Pre-compiles the keys with their values at the end of the preamble. The keys
-% are pre-compiled by hand for speed.
-\AddToHook { begindocument / before }
- { \__fontscale_keys_precompile_preamble: }
-\cs_new_protected:Npn \__fontscale_keys_precompile_preamble:
- {
- \tl_set:Ne \l__fontscale_keys_precompile_preamble_tl
- {
- \bool_if:NTF \l__fontscale_ignore_order_bool
- { \bool_set_true:N } { \bool_set_false:N }
- \l__fontscale_ignore_order_bool
- \fp_set:Nn \exp_not:N \l__fontscale_baselineskip_size_ratio_fp
- { \l__fontscale_baselineskip_size_ratio_fp }
- \str_set:Nn \exp_not:N \l__fontscale_typographic_scale_str
- { \l__fontscale_typographic_scale_str }
- \fp_set:Nn \exp_not:N \l__fontscale_modular_ratio_fp
- { \l__fontscale_modular_ratio_fp }
- \fp_set:Nn \exp_not:N \l__fontscale_musical_ratio_fp
- { \l__fontscale_musical_ratio_fp }
- \int_set:Nn \l__fontscale_musical_notes_int
- { \int_use:N \l__fontscale_musical_notes_int }
-
- \tl_set:Nn \exp_not:N \l__fontscale_tiny_scale_tl
- { \exp_not:o \l__fontscale_tiny_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_scale_tl
- { \exp_not:o \l__fontscale_scriptsize_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_scale_tl
- { \exp_not:o \l__fontscale_footnotesize_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_small_scale_tl
- { \exp_not:o \l__fontscale_small_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_large_scale_tl
- { \exp_not:o \l__fontscale_large_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_Large_scale_tl
- { \exp_not:o \l__fontscale_Large_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_LARGE_scale_tl
- { \exp_not:o \l__fontscale_LARGE_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_huge_scale_tl
- { \exp_not:o \l__fontscale_huge_scale_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_Huge_scale_tl
- { \exp_not:o \l__fontscale_Huge_scale_tl }
-
- \tl_set:Nn \exp_not:N \l__fontscale_tiny_size_tl
- { \exp_not:o \l__fontscale_tiny_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_size_tl
- { \exp_not:o \l__fontscale_scriptsize_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_size_tl
- { \exp_not:o \l__fontscale_footnotesize_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_small_size_tl
- { \exp_not:o \l__fontscale_small_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_normalsize_size_tl
- { \exp_not:o \l__fontscale_normalsize_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_large_size_tl
- { \exp_not:o \l__fontscale_large_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_Large_size_tl
- { \exp_not:o \l__fontscale_Large_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_LARGE_size_tl
- { \exp_not:o \l__fontscale_LARGE_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_huge_size_tl
- { \exp_not:o \l__fontscale_huge_size_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_Huge_size_tl
- { \exp_not:o \l__fontscale_Huge_size_tl }
-
- \tl_set:Nn \exp_not:N \l__fontscale_tiny_baselineskip_tl
- { \exp_not:o \l__fontscale_tiny_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_baselineskip_tl
- { \exp_not:o \l__fontscale_scriptsize_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_baselineskip_tl
- { \exp_not:o \l__fontscale_footnotesize_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_small_baselineskip_tl
- { \exp_not:o \l__fontscale_small_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_normalsize_baselineskip_tl
- { \exp_not:o \l__fontscale_normalsize_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_large_baselineskip_tl
- { \exp_not:o \l__fontscale_large_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_Large_baselineskip_tl
- { \exp_not:o \l__fontscale_Large_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_LARGE_baselineskip_tl
- { \exp_not:o \l__fontscale_LARGE_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_huge_baselineskip_tl
- { \exp_not:o \l__fontscale_huge_baselineskip_tl }
- \tl_set:Nn \exp_not:N \l__fontscale_Huge_baselineskip_tl
- { \exp_not:o \l__fontscale_Huge_baselineskip_tl }
- }
- }
-
-% PROCESS KEYS
-
-\NewDocumentCommand \fontscalesetup { m } { \__fontscale_keys_set:n {#1} }
-\cs_new_protected:Npn \__fontscale_keys_set:n #1
- {
- \keys_set:nn { fontscale } {#1}
- \__fontscale_keys_process:
- }
-\cs_new_protected:Npn \__fontscale_keys_process:
- {
- \__fontscale_keys_process_normalsize:
- \__fontscale_keys_process_other:
- \__fontscale_keys_process_other_props:
- \__fontscale_keys_process_check_order:
- }
-% Sets the size and baselineskip of \normalsize, stores them in a property
-% list, and uses \normalsize.
-\cs_new_protected:Npn \__fontscale_keys_process_normalsize:
- {
- \quark_if_no_value:NTF \l__fontscale_normalsize_size_tl
- {
- \dim_set:Nn \l_fontscale_normalsize_size_dim
- {
- \str_case:on \l__fontscale_typographic_scale_str
- {
- { classic-10pt } { 10pt }
- { classic-11pt } { 11pt }
- { classic-12pt } { 12pt }
- { modular } { 10pt }
- { musical } { 10pt }
- }
- }
- }
- {
- \__fontscale_dim_set_with_default_unit:Nn
- \l_fontscale_normalsize_size_dim { \l__fontscale_normalsize_size_tl }
- }
- \fp_set:Nn \l__fontscale_normalsize_size_fp
- { \l_fontscale_normalsize_size_dim }
- \quark_if_no_value:NTF \l__fontscale_normalsize_baselineskip_tl
- {
- \skip_set:Nn \l_fontscale_normalsize_baselineskip_skip
- {
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp
- * \l__fontscale_baselineskip_size_ratio_fp
- }
- }
- }
- {
- \__fontscale_skip_set_with_default_unit:Nn
- \l_fontscale_normalsize_baselineskip_skip
- { \l__fontscale_normalsize_baselineskip_tl }
- }
- \prop_put:Nno \l_fontscale_normalsize_prop { size }
- { \dim_use:N \l_fontscale_normalsize_size_dim }
- \prop_put:Nno \l_fontscale_normalsize_prop { baselineskip }
- { \skip_use:N \l_fontscale_normalsize_baselineskip_skip }
- \normalsize
- }
-% Sets the size, scale, and baselineskip of the other font size commands and
-% stores them in property lists. Issues a warning if the user sets both the
-% scale and size keys for the same font size command.
-\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xpt:n #1
- {
- \dim_set:cn { l_fontscale_#1_size_dim }
- {
- \str_case:nn {#1}
- {
- { tiny } { 6pt }
- { scriptsize } { 7pt }
- { footnotesize } { 8pt }
- { small } { 9pt }
- { large } { 11pt }
- { Large } { 12pt }
- { LARGE } { 14pt }
- { huge } { 16pt }
- { Huge } { 18pt }
- }
- }
- }
-\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xipt:n #1
- {
- \dim_set:cn { l_fontscale_#1_size_dim }
- {
- \str_case:nn {#1}
- {
- { tiny } { 7pt }
- { scriptsize } { 8pt }
- { footnotesize } { 9pt }
- { small } { 10pt }
- { large } { 12pt }
- { Large } { 14pt }
- { LARGE } { 16pt }
- { huge } { 18pt }
- { Huge } { 21pt }
- }
- }
- }
-\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xiipt:n #1
- {
- \dim_set:cn { l_fontscale_#1_size_dim }
- {
- \str_case:nn {#1}
- {
- { tiny } { 8pt }
- { scriptsize } { 9pt }
- { footnotesize } { 10pt }
- { small } { 11pt }
- { large } { 14pt }
- { Large } { 16pt }
- { LARGE } { 18pt }
- { huge } { 21pt }
- { Huge } { 24pt }
- }
- }
- }
-\cs_new_protected:Npn \__fontscale_keys_process_other_modular:n #1
- {
- \dim_set:cn { l_fontscale_#1_size_dim }
- {
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp * \l__fontscale_modular_ratio_fp
- ^ \use:c { c_fontscale_#1_step_fp }
- }
- }
- }
-\cs_new_protected:Npn \__fontscale_keys_process_other_musical:n #1
- {
- \dim_set:cn { l_fontscale_#1_size_dim }
- {
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp * \l__fontscale_musical_ratio_fp
- ^ ( \use:c { c_fontscale_#1_step_fp }
- / \l__fontscale_musical_notes_int )
- }
- }
- }
-\cs_new_protected:Npn \__fontscale_keys_process_other:
- {
- \cs_set_eq:Nc \__fontscale_keys_process_other_typographic_scale:n
- {
- \str_case:on \l__fontscale_typographic_scale_str
- {
- { classic-10pt } { __fontscale_keys_process_other_classic_xpt:n }
- { classic-11pt } { __fontscale_keys_process_other_classic_xipt:n }
- { classic-12pt } { __fontscale_keys_process_other_classic_xiipt:n }
- { modular } { __fontscale_keys_process_other_modular:n }
- { musical } { __fontscale_keys_process_other_musical:n }
- }
- }
- \seq_map_inline:Nn \c__fontscale_names_other_seq
- {
- \quark_if_no_value:cF { l__fontscale_##1_size_tl }
- {
- \__fontscale_dim_set_with_default_unit:cn
- { l_fontscale_##1_size_dim }
- { \use:c { l__fontscale_##1_size_tl } }
- \quark_if_no_value:cF { l__fontscale_##1_scale_tl }
- {
- \msg_warning:nnn { fontscale } { key-font-scale-ignored } {##1}
- }
- \prg_break:
- }
- \quark_if_no_value:cF { l__fontscale_##1_scale_tl }
- {
- \dim_set:cn { l_fontscale_##1_size_dim }
- {
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp
- * ( \use:c { l__fontscale_##1_scale_tl } )
- }
- }
- \prg_break:
- }
- \prg_break:n
- { \__fontscale_keys_process_other_typographic_scale:n {##1} }
- \prg_break_point:
- \fp_set:cn { l_fontscale_##1_scale_fp }
- {
- \use:c { l_fontscale_##1_size_dim }
- / \l__fontscale_normalsize_size_fp
- }
- \quark_if_no_value:cTF { l__fontscale_##1_baselineskip_tl }
- {
- \skip_set:cn { l_fontscale_##1_baselineskip_skip }
- {
- \fp_to_dim:n
- {
- \use:c { l_fontscale_##1_size_dim }
- * \l__fontscale_baselineskip_size_ratio_fp
- }
- }
- }
- {
- \__fontscale_skip_set_with_default_unit:cn
- { l_fontscale_##1_baselineskip_skip }
- { \use:c { l__fontscale_##1_baselineskip_tl } }
- }
- }
- }
-\cs_new_protected:Npn \__fontscale_keys_process_other_props:
- {
- \prop_put:Nne \l_fontscale_tiny_prop { scale }
- { \fp_use:N \l_fontscale_tiny_scale_fp }
- \prop_put:Nne \l_fontscale_scriptsize_prop { scale }
- { \fp_use:N \l_fontscale_scriptsize_scale_fp }
- \prop_put:Nne \l_fontscale_footnotesize_prop { scale }
- { \fp_use:N \l_fontscale_footnotesize_scale_fp }
- \prop_put:Nne \l_fontscale_small_prop { scale }
- { \fp_use:N \l_fontscale_small_scale_fp }
- \prop_put:Nne \l_fontscale_large_prop { scale }
- { \fp_use:N \l_fontscale_large_scale_fp }
- \prop_put:Nne \l_fontscale_Large_prop { scale }
- { \fp_use:N \l_fontscale_Large_scale_fp }
- \prop_put:Nne \l_fontscale_LARGE_prop { scale }
- { \fp_use:N \l_fontscale_LARGE_scale_fp }
- \prop_put:Nne \l_fontscale_huge_prop { scale }
- { \fp_use:N \l_fontscale_huge_scale_fp }
- \prop_put:Nne \l_fontscale_Huge_prop { scale }
- { \fp_use:N \l_fontscale_Huge_scale_fp }
-
- \prop_put:Nno \l_fontscale_tiny_prop { size }
- { \dim_use:N \l_fontscale_tiny_size_dim }
- \prop_put:Nno \l_fontscale_scriptsize_prop { size }
- { \dim_use:N \l_fontscale_scriptsize_size_dim }
- \prop_put:Nno \l_fontscale_footnotesize_prop { size }
- { \dim_use:N \l_fontscale_footnotesize_size_dim }
- \prop_put:Nno \l_fontscale_small_prop { size }
- { \dim_use:N \l_fontscale_small_size_dim }
- \prop_put:Nno \l_fontscale_large_prop { size }
- { \dim_use:N \l_fontscale_large_size_dim }
- \prop_put:Nno \l_fontscale_Large_prop { size }
- { \dim_use:N \l_fontscale_Large_size_dim }
- \prop_put:Nno \l_fontscale_LARGE_prop { size }
- { \dim_use:N \l_fontscale_LARGE_size_dim }
- \prop_put:Nno \l_fontscale_huge_prop { size }
- { \dim_use:N \l_fontscale_huge_size_dim }
- \prop_put:Nno \l_fontscale_Huge_prop { size }
- { \dim_use:N \l_fontscale_Huge_size_dim }
-
- \prop_put:Nno \l_fontscale_tiny_prop { baselineskip }
- { \skip_use:N \l_fontscale_tiny_baselineskip_skip }
- \prop_put:Nno \l_fontscale_scriptsize_prop { baselineskip }
- { \skip_use:N \l_fontscale_scriptsize_baselineskip_skip }
- \prop_put:Nno \l_fontscale_footnotesize_prop { baselineskip }
- { \skip_use:N \l_fontscale_footnotesize_baselineskip_skip }
- \prop_put:Nno \l_fontscale_small_prop { baselineskip }
- { \skip_use:N \l_fontscale_small_baselineskip_skip }
- \prop_put:Nno \l_fontscale_large_prop { baselineskip }
- { \skip_use:N \l_fontscale_large_baselineskip_skip }
- \prop_put:Nno \l_fontscale_Large_prop { baselineskip }
- { \skip_use:N \l_fontscale_Large_baselineskip_skip }
- \prop_put:Nno \l_fontscale_LARGE_prop { baselineskip }
- { \skip_use:N \l_fontscale_LARGE_baselineskip_skip }
- \prop_put:Nno \l_fontscale_huge_prop { baselineskip }
- { \skip_use:N \l_fontscale_huge_baselineskip_skip }
- \prop_put:Nno \l_fontscale_Huge_prop { baselineskip }
- { \skip_use:N \l_fontscale_Huge_baselineskip_skip }
- }
-% Issues a warning if the font sizes or font baselineskips are not in the
-% correct order.
-\cs_new_protected:Npn \__fontscale_keys_process_check_order:
- {
- \bool_if:NF \l__fontscale_ignore_order_bool
- {
- \dim_compare:nF
- {
- \l_fontscale_tiny_size_dim
- < \l_fontscale_scriptsize_size_dim
- < \l_fontscale_footnotesize_size_dim
- < \l_fontscale_small_size_dim
- < \l_fontscale_normalsize_size_dim
- < \l_fontscale_large_size_dim
- < \l_fontscale_Large_size_dim
- < \l_fontscale_LARGE_size_dim
- < \l_fontscale_huge_size_dim
- < \l_fontscale_Huge_size_dim
- }
- { \msg_warning:nn { fontscale } { font-sizes-out-of-order } }
- \dim_compare:nF
- {
- \l_fontscale_tiny_baselineskip_skip
- < \l_fontscale_scriptsize_baselineskip_skip
- < \l_fontscale_footnotesize_baselineskip_skip
- < \l_fontscale_small_baselineskip_skip
- < \l_fontscale_normalsize_baselineskip_skip
- < \l_fontscale_large_baselineskip_skip
- < \l_fontscale_Large_baselineskip_skip
- < \l_fontscale_LARGE_baselineskip_skip
- < \l_fontscale_huge_baselineskip_skip
- < \l_fontscale_Huge_baselineskip_skip
- }
- { \msg_warning:nn { fontscale } { font-baselineskips-out-of-order } }
- }
- }
-
-% DOCUMENT COMMANDS
-
-% The internal functions of each font size command are not used elsewhere in
-% the code for compatibility with user-defined hooks
-% (e.g. \AddToHook{cmd/normalsize/after}{<user-defined-function>}).
-% Need \dim_use:N for compatibility with the microtype package.
-\DeclareDocumentCommand \tiny { } { \__fontscale_tiny: }
-\cs_new_protected:Npn \__fontscale_tiny:
- {
- \@setfontsize \tiny { \dim_use:N \l_fontscale_tiny_size_dim }
- \l_fontscale_tiny_baselineskip_skip
- }
-\DeclareDocumentCommand \scriptsize { } { \__fontscale_scriptsize: }
-\cs_new_protected:Npn \__fontscale_scriptsize:
- {
- \@setfontsize \scriptsize { \dim_use:N \l_fontscale_scriptsize_size_dim }
- \l_fontscale_scriptsize_baselineskip_skip
- }
-\DeclareDocumentCommand \footnotesize { } { \__fontscale_footnotesize: }
-\cs_new_protected:Npn \__fontscale_footnotesize:
- {
- \@setfontsize \footnotesize
- { \dim_use:N \l_fontscale_footnotesize_size_dim }
- \l_fontscale_footnotesize_baselineskip_skip
- }
-\DeclareDocumentCommand \small { } { \__fontscale_small: }
-\cs_new_protected:Npn \__fontscale_small:
- {
- \@setfontsize \small { \dim_use:N \l_fontscale_small_size_dim }
- \l_fontscale_small_baselineskip_skip
- }
-\DeclareDocumentCommand \normalsize { } { \__fontscale_normalsize: }
-\cs_new_protected:Npn \__fontscale_normalsize:
- {
- \@setfontsize \normalsize { \dim_use:N \l_fontscale_normalsize_size_dim }
- \l_fontscale_normalsize_baselineskip_skip
- }
-\DeclareDocumentCommand \large { } { \__fontscale_large: }
-\cs_new_protected:Npn \__fontscale_large:
- {
- \@setfontsize \large { \dim_use:N \l_fontscale_large_size_dim }
- \l_fontscale_large_baselineskip_skip
- }
-\DeclareDocumentCommand \Large { } { \__fontscale_Large: }
-\cs_new_protected:Npn \__fontscale_Large:
- {
- \@setfontsize \Large { \dim_use:N \l_fontscale_Large_size_dim }
- \l_fontscale_Large_baselineskip_skip
- }
-\DeclareDocumentCommand \LARGE { } { \__fontscale_LARGE: }
-\cs_new_protected:Npn \__fontscale_LARGE:
- {
- \@setfontsize \LARGE { \dim_use:N \l_fontscale_LARGE_size_dim }
- \l_fontscale_LARGE_baselineskip_skip
- }
-\DeclareDocumentCommand \huge { } { \__fontscale_huge: }
-\cs_new_protected:Npn \__fontscale_huge:
- {
- \@setfontsize \huge { \dim_use:N \l_fontscale_huge_size_dim }
- \l_fontscale_huge_baselineskip_skip
- }
-\DeclareDocumentCommand \Huge { } { \__fontscale_Huge: }
-\cs_new_protected:Npn \__fontscale_Huge:
- {
- \@setfontsize \Huge { \dim_use:N \l_fontscale_Huge_size_dim }
- \l_fontscale_Huge_baselineskip_skip
- }
-% Initializes to \normalsize.
-\normalsize
-
-\NewExpandableDocumentCommand \CurrentFontStep { }
- { \__fontscale_current_font_step: }
-\cs_new:Npn \__fontscale_current_font_step:
- {
- \dim_case:nnF { \f@size pt }
- {
- { \l_fontscale_tiny_size_dim } { -4 }
- { \l_fontscale_scriptsize_size_dim } { -3 }
- { \l_fontscale_footnotesize_size_dim } { -2 }
- { \l_fontscale_small_size_dim } { -1 }
- { \l_fontscale_normalsize_size_dim } { 0 }
- { \l_fontscale_large_size_dim } { 1 }
- { \l_fontscale_Large_size_dim } { 2 }
- { \l_fontscale_LARGE_size_dim } { 3 }
- { \l_fontscale_huge_size_dim } { 4 }
- { \l_fontscale_Huge_size_dim } { 5 }
- }
- {
- \str_case:on \l__fontscale_typographic_scale_str
- {
- { modular }
- {
- \fp_eval:n
- {
- ln ( \f@size / \l__fontscale_normalsize_size_fp )
- / ln ( \l__fontscale_modular_ratio_fp )
- }
- }
- { musical }
- {
- \fp_eval:n
- {
- \l__fontscale_musical_notes_int
- * ln ( \f@size / \l__fontscale_normalsize_size_fp )
- / ln ( \l__fontscale_musical_ratio_fp )
- }
- }
- }
- }
- }
-
-\NewExpandableDocumentCommand \CurrentFontScale { }
- { \__fontscale_current_font_scale: }
-\cs_new:Npn \__fontscale_current_font_scale:
- { \fp_eval:n { \f@size / \l__fontscale_normalsize_size_fp } }
-
-\NewExpandableDocumentCommand \CurrentFontSize { }
- { \__fontscale_current_font_size: }
-\cs_new:Npn \__fontscale_current_font_size: { \f@size pt }
-
-\NewExpandableDocumentCommand \CurrentFontBaselineskip { }
- { \__fontscale_current_font_baselineskip: }
-\cs_new:Npn \__fontscale_current_font_baselineskip: { \f@baselineskip }
-
-\NewDocumentCommand \SetFontStep { s m }
- {
- \IfBooleanTF #1
- { \__fontscale_add_font_step:n {#2} }
- { \__fontscale_set_font_step:n {#2} }
- }
-\cs_new_protected:Npn \__fontscale_set_font_step:n #1
- {
- \fp_set:Nn \l__fontscale_step_fp {#1}
- \__fontscale_set_font_step_aux:N \l__fontscale_step_fp
- }
-\cs_new_protected:Npn \__fontscale_set_font_step_aux:N #1
- {
- \token_case_meaning:NnF #1
- {
- \c_fontscale_tiny_step_fp { \tiny }
- \c_fontscale_scriptsize_step_fp { \scriptsize }
- \c_fontscale_footnotesize_step_fp { \footnotesize }
- \c_fontscale_small_step_fp { \small }
- \c_fontscale_normalsize_step_fp { \normalsize }
- \c_fontscale_large_step_fp { \large }
- \c_fontscale_Large_step_fp { \Large }
- \c_fontscale_LARGE_step_fp { \LARGE }
- \c_fontscale_huge_step_fp { \huge }
- \c_fontscale_Huge_step_fp { \Huge }
- }
- {
- \str_case:onTF \l__fontscale_typographic_scale_str
- {
- { modular }
- {
- \fontsize
- {
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp
- * \l__fontscale_modular_ratio_fp ^ #1
- }
- }
- }
- { musical }
- {
- \fontsize
- {
- \fp_to_dim:n
- {
- \l__fontscale_normalsize_size_fp
- * \l__fontscale_musical_ratio_fp
- ^ ( #1 / \l__fontscale_musical_notes_int )
- }
- }
- }
- }
- {
- {
- \fp_to_dim:n
- { \f@size * \l__fontscale_baselineskip_size_ratio_fp }
- }
- \selectfont
- }
- { \msg_error:nn { fontscale } { font-step-out-of-bounds } }
- }
- }
-\cs_new_protected:Npn \__fontscale_add_font_step:n #1
- {
- \tl_set:Ne \l__fontscale_step_tl { \__fontscale_current_font_step: }
- \tl_if_empty:NTF \l__fontscale_step_tl
- { \msg_error:nn { fontscale } { font-step-out-of-bounds } }
- {
- \fp_set:Nn \l__fontscale_step_fp { (#1) + \l__fontscale_step_tl }
- \__fontscale_add_font_step_aux:N \l__fontscale_step_fp
- }
- }
-\cs_new_eq:NN \__fontscale_add_font_step_aux:N \__fontscale_set_font_step_aux:N
-
-\NewDocumentCommand \SetFontScale { s m }
- {
- \IfBooleanTF #1
- { \__fontscale_add_font_scale:n {#2} }
- { \__fontscale_set_font_scale:n {#2} }
- }
-\cs_new_protected:Npn \__fontscale_set_font_scale:n #1
- {
- \fontsize
- { \fp_to_dim:n { \l__fontscale_normalsize_size_fp * (#1) } }
- { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
- \selectfont
- }
-\cs_new_protected:Npn \__fontscale_add_font_scale:n #1
- {
- \fontsize
- { \fp_to_dim:n { \l__fontscale_normalsize_size_fp * (#1) + \f@size } }
- { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
- \selectfont
- }
-
-\NewDocumentCommand \SetFontSize { s m }
- {
- \IfBooleanTF #1
- { \__fontscale_add_font_size:n {#2} }
- { \__fontscale_set_font_size:n {#2} }
- }
-\cs_new_protected:Npn \__fontscale_set_font_size:n #1
- {
- \__fontscale_dim_set_with_default_unit:Nn \l__fontscale_size_dim {#1}
- \fontsize \l__fontscale_size_dim
- { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
- \selectfont
- }
-\cs_new_protected:Npn \__fontscale_add_font_size:n #1
- {
- \__fontscale_dim_set_with_default_unit:Nn \l__fontscale_size_dim {#1}
- \dim_add:Nn \l__fontscale_size_dim { \f@size pt }
- \fontsize \l__fontscale_size_dim
- { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
- \selectfont
- }
-
-\NewDocumentCommand \ScaleFont { m } { \__fontscale_scalefont:n {#1} }
-\cs_new_protected:Npn \__fontscale_scalefont:n #1
- {
- \fontsize
- { \fp_to_dim:n { \f@size * (#1) } }
- { \fp_to_dim:n { \dim_to_fp:n { \f@baselineskip } * (#1) } }
- \selectfont
- }
-
-\NewDocumentCommand \SetFontSizeBaselineskip { m m }
- { \__fontscale_set_font_size_baselineskip:nn {#1} {#2} }
-\cs_new_protected:Npn \__fontscale_set_font_size_baselineskip:nn #1#2
- {
- \__fontscale_dim_set_with_default_unit:Nn \l__fontscale_size_dim {#1}
- \__fontscale_skip_set_with_default_unit:Nn \l__fontscale_baselineskip_skip
- {#2}
- \fontsize \l__fontscale_size_dim \l__fontscale_baselineskip_skip
- \selectfont
- }
-
-\NewDocumentCommand \PrintFontParameters { }
- { \__fontscale_print_font_parameters: }
-\cs_new_protected:Npn \__fontscale_print_font_parameters:
- {
- step ~=~ \__fontscale_current_font_step: ,~
- scale ~=~ \__fontscale_current_font_scale: ,~
- size ~=~ \__fontscale_current_font_size: ,~
- baselineskip ~=~ \__fontscale_current_font_baselineskip:
- }
-
-\NewDocumentCommand \PrintAllFontParameters { }
- { \__fontscale_print_all_font_parameters: }
-\cs_new_protected:Npn \__fontscale_print_all_font_parameters:
- {
- \seq_map_inline:Nn \c__fontscale_names_seq
- {
- \prop_get:cnN { l_fontscale_##1_prop } { step } \l__fontscale_step_tl
- \prop_get:cnN { l_fontscale_##1_prop } { scale } \l__fontscale_scale_tl
- \token_to_str:c {##1} \@ \c_colon_str \c_space_tl
- step ~=~ \l__fontscale_step_tl ,~
- scale ~=~ \l__fontscale_scale_tl ,~
- size ~=~ \dim_use:c { l_fontscale_##1_size_dim } ,~
- baselineskip ~=~ \skip_use:c { l_fontscale_##1_baselineskip_skip }
- \str_if_eq:nnF {##1} { Huge } { \newline }
- }
- }
-
-\NewDocumentCommand \PrintSampleText
- { s O
- {
- The~ \texttt { fontscale }~ package \c_colon_str \c_space_tl
- A~ user~ interface~ for~ setting~ document~ font~ sizes
- }
- }
- {
- \IfBooleanTF #1
- { \__fontscale_print_sample_text_descending_order:n {#2} }
- { \__fontscale_print_sample_text_ascending_order:n {#2} }
- }
-\cs_new_protected:Npn \__fontscale_print_sample_text_ascending_order:n #1
- {
- { \tiny #1 \par }
- { \scriptsize #1 \par }
- { \footnotesize #1 \par }
- { \small #1 \par }
- { \normalsize #1 \par }
- { \large #1 \par }
- { \Large #1 \par }
- { \LARGE #1 \par }
- { \huge #1 \par }
- { \Huge #1 \par }
- }
-\cs_new_protected:Npn \__fontscale_print_sample_text_descending_order:n #1
- {
- { \Huge #1 \par }
- { \huge #1 \par }
- { \LARGE #1 \par }
- { \Large #1 \par }
- { \large #1 \par }
- { \normalsize #1 \par }
- { \small #1 \par }
- { \footnotesize #1 \par }
- { \scriptsize #1 \par }
- { \tiny #1 \par }
- }
-
-\NewDocumentCommand \PrintFontSizeCommand { } { \__fontscale_print_name: }
-\cs_new_protected:Npn \__fontscale_print_name:
- {
- \dim_case:nnF { \f@size pt }
- {
- { \l_fontscale_tiny_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_tiny_baselineskip_skip }
- { \token_to_str:N \tiny } { UNDEFINED \@ }
- }
- { \l_fontscale_scriptsize_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_scriptsize_baselineskip_skip }
- { \token_to_str:N \scriptsize } { UNDEFINED \@ }
- }
- { \l_fontscale_footnotesize_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_footnotesize_baselineskip_skip }
- { \token_to_str:N \footnotesize } { UNDEFINED \@ }
- }
- { \l_fontscale_small_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_small_baselineskip_skip }
- { \token_to_str:N \small } { UNDEFINED \@ }
- }
- { \l_fontscale_normalsize_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_normalsize_baselineskip_skip }
- { \token_to_str:N \normalsize } { UNDEFINED \@ }
- }
- { \l_fontscale_large_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_large_baselineskip_skip }
- { \token_to_str:N \large } { UNDEFINED \@ }
- }
- { \l_fontscale_Large_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_Large_baselineskip_skip }
- { \token_to_str:N \Large } { UNDEFINED \@ }
- }
- { \l_fontscale_LARGE_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_LARGE_baselineskip_skip }
- { \token_to_str:N \LARGE \@ } { UNDEFINED \@ }
- }
- { \l_fontscale_huge_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_huge_baselineskip_skip }
- { \token_to_str:N \huge } { UNDEFINED \@ }
- }
- { \l_fontscale_Huge_size_dim }
- {
- \skip_if_eq:nnTF { \f@baselineskip }
- { \l_fontscale_Huge_baselineskip_skip }
- { \token_to_str:N \Huge } { UNDEFINED \@ }
- }
- }
- { UNDEFINED \@ }
- }
-
-% TEXT PURIFY
-
-\cs_new:Npn \__fontscale_text_purify_equivalent:n #1
- {
- \bool_lazy_all:nT
- {
- { \tl_if_single_p:n {#1} }
- { \tl_if_single_token_p:n #1 }
- { \token_if_eq_meaning_p:NN #1 * }
- }
- { \use_none:n }
- }
-\text_declare_purify_equivalent:Nn \SetFontStep
- { \__fontscale_text_purify_equivalent:n }
-\text_declare_purify_equivalent:Nn \SetFontScale
- { \__fontscale_text_purify_equivalent:n }
-\text_declare_purify_equivalent:Nn \SetFontSize
- { \__fontscale_text_purify_equivalent:n }
-\text_declare_purify_equivalent:Nn \ScaleFont { \use_none:n }
+% Package : fontscale -- A user interface for setting document font sizes
+% Copyright : 2024 (c) Oliver Beery <beeryoliver@gmail.com>
+% CTAN : https://ctan.org/pkg/fontscale
+% Repository: https://github.com/beeryoliver/fontscale
+% License : The LaTeX Project Public License 1.3c
+
+% The 2022-06-01 LaTeX kernel update added \ProcessKeyOptions.
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
+\ProvidesExplPackage
+ {fontscale}
+ {2024-04-07}
+ {1.1.1}
+ {A user interface for setting document font sizes}
+
+% The 2023-10-10 l3kernel update added many 'e'-variants.
+\IfExplAtLeastTF { 2023-10-10 }
+ { }
+ {
+ \msg_new:nnn { fontscale } { expl3-out-of-date }
+ {
+ The~ package~ could~ not~ load.~
+ The~ fontscale~ package~ requires~
+ L3~ programming~ layer~ version~ 2023-10-10~ or~ later.
+ }
+ \msg_critical:nn { fontscale } { expl3-out-of-date }
+ }
+
+% SOME VARIABLES
+
+\fp_const:Nn \c_fontscale_tiny_step_fp { -4 }
+\fp_const:Nn \c_fontscale_scriptsize_step_fp { -3 }
+\fp_const:Nn \c_fontscale_footnotesize_step_fp { -2 }
+\fp_const:Nn \c_fontscale_small_step_fp { -1 }
+\fp_const:Nn \c_fontscale_normalsize_step_fp { 0 }
+\fp_const:Nn \c_fontscale_large_step_fp { 1 }
+\fp_const:Nn \c_fontscale_Large_step_fp { 2 }
+\fp_const:Nn \c_fontscale_LARGE_step_fp { 3 }
+\fp_const:Nn \c_fontscale_huge_step_fp { 4 }
+\fp_const:Nn \c_fontscale_Huge_step_fp { 5 }
+
+\fp_const:Nn \c_fontscale_normalsize_scale_fp { 1 }
+
+\tl_const:Nn \c__fontscale_names_tl
+ {
+ {tiny} {scriptsize} {footnotesize} {small} {normalsize}
+ {large} {Large} {LARGE} {huge} {Huge}
+ }
+\tl_const:Nn \c__fontscale_names_other_tl
+ {
+ {tiny} {scriptsize} {footnotesize} {small}
+ {large} {Large} {LARGE} {huge} {Huge}
+ }
+
+\prop_new:N \l_fontscale_tiny_prop
+\prop_new:N \l_fontscale_scriptsize_prop
+\prop_new:N \l_fontscale_footnotesize_prop
+\prop_new:N \l_fontscale_small_prop
+\prop_new:N \l_fontscale_normalsize_prop
+\prop_new:N \l_fontscale_large_prop
+\prop_new:N \l_fontscale_Large_prop
+\prop_new:N \l_fontscale_LARGE_prop
+\prop_new:N \l_fontscale_huge_prop
+\prop_new:N \l_fontscale_Huge_prop
+
+\prop_put:Nnn \l_fontscale_tiny_prop { step } { -4 }
+\prop_put:Nnn \l_fontscale_scriptsize_prop { step } { -3 }
+\prop_put:Nnn \l_fontscale_footnotesize_prop { step } { -2 }
+\prop_put:Nnn \l_fontscale_small_prop { step } { -1 }
+\prop_put:Nnn \l_fontscale_normalsize_prop { step } { 0 }
+\prop_put:Nnn \l_fontscale_large_prop { step } { 1 }
+\prop_put:Nnn \l_fontscale_Large_prop { step } { 2 }
+\prop_put:Nnn \l_fontscale_LARGE_prop { step } { 3 }
+\prop_put:Nnn \l_fontscale_huge_prop { step } { 4 }
+\prop_put:Nnn \l_fontscale_Huge_prop { step } { 5 }
+
+\prop_put:Nnn \l_fontscale_normalsize_prop { scale } { 1 }
+
+\fp_new:N \l_fontscale_tiny_scale_fp
+\fp_new:N \l_fontscale_scriptsize_scale_fp
+\fp_new:N \l_fontscale_footnotesize_scale_fp
+\fp_new:N \l_fontscale_small_scale_fp
+\fp_new:N \l_fontscale_large_scale_fp
+\fp_new:N \l_fontscale_Large_scale_fp
+\fp_new:N \l_fontscale_LARGE_scale_fp
+\fp_new:N \l_fontscale_huge_scale_fp
+\fp_new:N \l_fontscale_Huge_scale_fp
+
+\dim_new:N \l_fontscale_tiny_size_dim
+\dim_new:N \l_fontscale_scriptsize_size_dim
+\dim_new:N \l_fontscale_footnotesize_size_dim
+\dim_new:N \l_fontscale_small_size_dim
+\dim_new:N \l_fontscale_normalsize_size_dim
+\dim_new:N \l_fontscale_large_size_dim
+\dim_new:N \l_fontscale_Large_size_dim
+\dim_new:N \l_fontscale_LARGE_size_dim
+\dim_new:N \l_fontscale_huge_size_dim
+\dim_new:N \l_fontscale_Huge_size_dim
+
+\skip_new:N \l_fontscale_tiny_baselineskip_skip
+\skip_new:N \l_fontscale_scriptsize_baselineskip_skip
+\skip_new:N \l_fontscale_footnotesize_baselineskip_skip
+\skip_new:N \l_fontscale_small_baselineskip_skip
+\skip_new:N \l_fontscale_normalsize_baselineskip_skip
+\skip_new:N \l_fontscale_large_baselineskip_skip
+\skip_new:N \l_fontscale_Large_baselineskip_skip
+\skip_new:N \l_fontscale_LARGE_baselineskip_skip
+\skip_new:N \l_fontscale_huge_baselineskip_skip
+\skip_new:N \l_fontscale_Huge_baselineskip_skip
+
+\str_new:N \l__fontscale_typographic_scale_str
+\tl_new:N \l__fontscale_keys_precompile_preamble_tl
+
+% Used in floating point expressions for speed.
+\fp_new:N \l__fontscale_normalsize_size_fp
+\fp_new:N \l__fontscale_musical_notes_fp
+
+% Temporary variables
+\fp_new:N \l__fontscale_step_fp
+\tl_new:N \l__fontscale_step_tl
+\tl_new:N \l__fontscale_scale_tl
+\dim_new:N \l__fontscale_size_dim
+\skip_new:N \l__fontscale_baselineskip_skip
+
+% INITIAL FONT PARAMETERS
+
+\fp_set:Nn \l__fontscale_normalsize_size_fp { 10 }
+
+\dim_set:Nn \l_fontscale_tiny_size_dim { 6pt }
+\dim_set:Nn \l_fontscale_scriptsize_size_dim { 7pt }
+\dim_set:Nn \l_fontscale_footnotesize_size_dim { 8pt }
+\dim_set:Nn \l_fontscale_small_size_dim { 9pt }
+\dim_set:Nn \l_fontscale_normalsize_size_dim { 10pt }
+\dim_set:Nn \l_fontscale_large_size_dim { 11pt }
+\dim_set:Nn \l_fontscale_Large_size_dim { 12pt }
+\dim_set:Nn \l_fontscale_LARGE_size_dim { 14pt }
+\dim_set:Nn \l_fontscale_huge_size_dim { 16pt }
+\dim_set:Nn \l_fontscale_Huge_size_dim { 18pt }
+
+\fp_set:Nn \l_fontscale_tiny_scale_fp { 0.6 }
+\fp_set:Nn \l_fontscale_scriptsize_scale_fp { 0.7 }
+\fp_set:Nn \l_fontscale_footnotesize_scale_fp { 0.8 }
+\fp_set:Nn \l_fontscale_small_scale_fp { 0.9 }
+\fp_set:Nn \l_fontscale_large_scale_fp { 1.1 }
+\fp_set:Nn \l_fontscale_Large_scale_fp { 1.2 }
+\fp_set:Nn \l_fontscale_LARGE_scale_fp { 1.4 }
+\fp_set:Nn \l_fontscale_huge_scale_fp { 1.6 }
+\fp_set:Nn \l_fontscale_Huge_scale_fp { 1.8 }
+
+\skip_set:Nn \l_fontscale_tiny_baselineskip_skip { 7.2pt }
+\skip_set:Nn \l_fontscale_scriptsize_baselineskip_skip { 8.4pt }
+\skip_set:Nn \l_fontscale_footnotesize_baselineskip_skip { 9.6pt }
+\skip_set:Nn \l_fontscale_small_baselineskip_skip { 10.8pt }
+\skip_set:Nn \l_fontscale_normalsize_baselineskip_skip { 12 pt }
+\skip_set:Nn \l_fontscale_large_baselineskip_skip { 13.2pt }
+\skip_set:Nn \l_fontscale_Large_baselineskip_skip { 14.4pt }
+\skip_set:Nn \l_fontscale_LARGE_baselineskip_skip { 16.8pt }
+\skip_set:Nn \l_fontscale_huge_baselineskip_skip { 19.2pt }
+\skip_set:Nn \l_fontscale_Huge_baselineskip_skip { 21.6pt }
+
+\prop_put:Nnn \l_fontscale_tiny_prop { scale } { 0.6 }
+\prop_put:Nnn \l_fontscale_scriptsize_prop { scale } { 0.7 }
+\prop_put:Nnn \l_fontscale_footnotesize_prop { scale } { 0.8 }
+\prop_put:Nnn \l_fontscale_small_prop { scale } { 0.9 }
+\prop_put:Nnn \l_fontscale_large_prop { scale } { 1.1 }
+\prop_put:Nnn \l_fontscale_Large_prop { scale } { 1.2 }
+\prop_put:Nnn \l_fontscale_LARGE_prop { scale } { 1.4 }
+\prop_put:Nnn \l_fontscale_huge_prop { scale } { 1.6 }
+\prop_put:Nnn \l_fontscale_Huge_prop { scale } { 1.8 }
+
+\prop_put:Nnn \l_fontscale_tiny_prop { size } { 6pt }
+\prop_put:Nnn \l_fontscale_scriptsize_prop { size } { 7pt }
+\prop_put:Nnn \l_fontscale_footnotesize_prop { size } { 8pt }
+\prop_put:Nnn \l_fontscale_small_prop { size } { 9pt }
+\prop_put:Nnn \l_fontscale_normalsize_prop { size } { 10pt }
+\prop_put:Nnn \l_fontscale_large_prop { size } { 11pt }
+\prop_put:Nnn \l_fontscale_Large_prop { size } { 12pt }
+\prop_put:Nnn \l_fontscale_LARGE_prop { size } { 14pt }
+\prop_put:Nnn \l_fontscale_huge_prop { size } { 16pt }
+\prop_put:Nnn \l_fontscale_Huge_prop { size } { 18pt }
+
+\prop_put:Nnn \l_fontscale_tiny_prop { baselineskip } { 7.2pt }
+\prop_put:Nnn \l_fontscale_scriptsize_prop { baselineskip } { 8.4pt }
+\prop_put:Nnn \l_fontscale_footnotesize_prop { baselineskip } { 9.6pt }
+\prop_put:Nnn \l_fontscale_small_prop { baselineskip } { 10.8pt }
+\prop_put:Nnn \l_fontscale_normalsize_prop { baselineskip } { 12 pt }
+\prop_put:Nnn \l_fontscale_large_prop { baselineskip } { 13.2pt }
+\prop_put:Nnn \l_fontscale_Large_prop { baselineskip } { 14.4pt }
+\prop_put:Nnn \l_fontscale_LARGE_prop { baselineskip } { 16.8pt }
+\prop_put:Nnn \l_fontscale_huge_prop { baselineskip } { 19.2pt }
+\prop_put:Nnn \l_fontscale_Huge_prop { baselineskip } { 21.6pt }
+
+% SOME HELPER FUNCTIONS
+
+% Sets a dimen or skip variable, supplying a default unit of pt.
+\cs_new_protected:Npn \__fontscale_dim_set_with_default_unit:Nn #1#2
+ { \@defaultunits #1 = \dimexpr #2 pt \relax \relax \@nnil }
+\cs_generate_variant:Nn \__fontscale_dim_set_with_default_unit:Nn { c }
+\cs_new_protected:Npn \__fontscale_skip_set_with_default_unit:Nn #1#2
+ { \@defaultunits #1 = \glueexpr #2 pt \relax \@nnil }
+\cs_generate_variant:Nn \__fontscale_skip_set_with_default_unit:Nn { c }
+
+% MESSAGES
+
+\msg_new:nnn { fontscale } { key-font-scale-ignored }
+ {
+ Key~ #1 / scale~
+ \msg_line_context: \c_space_tl
+ ignored.~
+ Setting~ the~ scale~ and~ size~ keys~ for~ the~ same~
+ font~ size~ command~ ignores~ the~ scale~ key.
+ }
+\msg_new:nnn { fontscale } { font-sizes-out-of-order }
+ {
+ The~ font~ sizes~
+ \msg_line_context: \c_space_tl
+ are~ not~ in~ the~ correct~ order.~
+ The~ magnitude~ of~ the~ font~ sizes~ should~ be~ ordered~ from~
+ \token_to_str:N \tiny \c_space_tl
+ to~
+ \token_to_str:N \normalsize \c_space_tl
+ to~
+ \token_to_str:N \Huge .
+ }
+\msg_new:nnn { fontscale } { font-baselineskips-out-of-order }
+ {
+ The~ font~ baselineskips~
+ \msg_line_context: \c_space_tl
+ are~ not~ in~ the~ correct~ order.~
+ The~ magnitude~ of~ the~ font~ baselineskips~ should~ be~ ordered~ from~
+ \token_to_str:N \tiny \c_space_tl
+ to~
+ \token_to_str:N \normalsize \c_space_tl
+ to~
+ \token_to_str:N \Huge .
+ }
+\msg_new:nnn { fontscale } { font-step-out-of-bounds }
+ {
+ The~ font~ step~
+ \msg_line_context: \c_space_tl
+ must~ be~ an~ integer~ from~ -4~ to~ 5,~
+ unless~ the~ choice~ of~ typographic~ scale~ is~ modular~ or~ musical.
+ }
+
+% DEFINE KEYS
+
+\keys_define:nn { fontscale }
+ {
+ reset .choices:nn = { initial , preamble }
+ {
+ \int_case:nn { \l_keys_choice_int }
+ {
+ { 1 } { \c__fontscale_keys_precompile_initial_tl }
+ { 2 } { \l__fontscale_keys_precompile_preamble_tl }
+ }
+ }
+ , reset .default:n = initial
+
+ , ignore-order .bool_set:N = \l__fontscale_ignore_order_bool
+ , ignore-order .default:n = true
+
+ , baselineskip-size-ratio .fp_set:N =
+ \l__fontscale_baselineskip_size_ratio_fp
+ , baselineskip-size-ratio .value_required:n = true
+
+ , typographic-scale .choices:nn =
+ { classic-10pt , classic-11pt , classic-12pt , modular , musical }
+ { \str_set:Nn \l__fontscale_typographic_scale_str {#1} }
+ , typographic-scale .value_required:n = true
+
+ , classic-10pt .meta:n = { typographic-scale = classic-10pt }
+ , classic-10pt .value_forbidden:n = true
+
+ , classic-11pt .meta:n = { typographic-scale = classic-11pt }
+ , classic-11pt .value_forbidden:n = true
+
+ , classic-12pt .meta:n = { typographic-scale = classic-12pt }
+ , classic-12pt .value_forbidden:n = true
+
+ , modular .meta:n = { typographic-scale = modular }
+ , modular .value_forbidden:n = true
+
+ , musical .meta:n = { typographic-scale = musical }
+ , musical .value_forbidden:n = true
+
+ , modular / ratio .fp_set:N = \l__fontscale_modular_ratio_fp
+ , modular / ratio .value_required:n = true
+ }
+\keys_define:nn { fontscale / musical }
+ {
+ ratio .fp_set:N = \l__fontscale_musical_ratio_fp
+ , ratio .value_required:n = true
+
+ , notes .int_set:N = \l__fontscale_musical_notes_int
+ , notes .value_required:n = true
+ }
+\keys_define:nn { fontscale / tiny }
+ {
+ scale .tl_set:N = \l__fontscale_tiny_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_tiny_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_tiny_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / scriptsize }
+ {
+ scale .tl_set:N = \l__fontscale_scriptsize_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_scriptsize_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_scriptsize_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / footnotesize }
+ {
+ scale .tl_set:N = \l__fontscale_footnotesize_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_footnotesize_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_footnotesize_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / small }
+ {
+ scale .tl_set:N = \l__fontscale_small_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_small_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_small_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / normalsize }
+ {
+ size .tl_set:N = \l__fontscale_normalsize_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_normalsize_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / large }
+ {
+ scale .tl_set:N = \l__fontscale_large_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_large_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_large_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / Large }
+ {
+ scale .tl_set:N = \l__fontscale_Large_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_Large_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_Large_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / LARGE }
+ {
+ scale .tl_set:N = \l__fontscale_LARGE_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_LARGE_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_LARGE_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / huge }
+ {
+ scale .tl_set:N = \l__fontscale_huge_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_huge_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_huge_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale / Huge }
+ {
+ scale .tl_set:N = \l__fontscale_Huge_scale_tl
+ , scale .value_required:n = true
+
+ , size .tl_set:N = \l__fontscale_Huge_size_tl
+ , size .value_required:n = true
+
+ , baselineskip .tl_set:N = \l__fontscale_Huge_baselineskip_tl
+ , baselineskip .value_required:n = true
+ }
+\keys_define:nn { fontscale }
+ {
+ tiny .code:n = \__fontscale_keys_name_code:n {#1}
+ , tiny .value_required:n = true
+
+ , scriptsize .code:n = \__fontscale_keys_name_code:n {#1}
+ , scriptsize .value_required:n = true
+
+ , footnotesize .code:n = \__fontscale_keys_name_code:n {#1}
+ , footnotesize .value_required:n = true
+
+ , small .code:n = \__fontscale_keys_name_code:n {#1}
+ , small .value_required:n = true
+
+ , normalsize .code:n = \__fontscale_keys_name_code:n {#1}
+ , normalsize .value_required:n = true
+
+ , large .code:n = \__fontscale_keys_name_code:n {#1}
+ , large .value_required:n = true
+
+ , Large .code:n = \__fontscale_keys_name_code:n {#1}
+ , Large .value_required:n = true
+
+ , LARGE .code:n = \__fontscale_keys_name_code:n {#1}
+ , LARGE .value_required:n = true
+
+ , huge .code:n = \__fontscale_keys_name_code:n {#1}
+ , huge .value_required:n = true
+
+ , Huge .code:n = \__fontscale_keys_name_code:n {#1}
+ , Huge .value_required:n = true
+ }
+\cs_new_protected:Npn \__fontscale_keys_name_code:n #1
+ {
+ \str_if_in:nnTF {#1} { / }
+ { \__fontscale_keys_name_code_split:ww #1 \q_stop }
+ { \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1} }
+ }
+\cs_new_protected:Npn \__fontscale_keys_name_code_split:ww #1 / #2 \q_stop
+ {
+ \tl_set:cn { l__fontscale_ \l_keys_key_str _size_tl } {#1}
+ \tl_set:cn { l__fontscale_ \l_keys_key_str _baselineskip_tl } {#2}
+ }
+
+% PRE-COMPILE KEYS
+
+% Pre-compiles the keys with their initial values. The keys are pre-compiled
+% by hand for speed.
+\tl_const:Nn \c__fontscale_keys_precompile_initial_tl
+ {
+ \bool_set_false:N \l__fontscale_ignore_order_bool
+ \fp_set:Nn \l__fontscale_baselineskip_size_ratio_fp { 1.2 }
+ \str_set:Nn \l__fontscale_typographic_scale_str { classic-10pt }
+ \fp_set:Nn \l__fontscale_modular_ratio_fp { 1.125 }
+ \fp_set:Nn \l__fontscale_musical_ratio_fp { 2 }
+ \int_set:Nn \l__fontscale_musical_notes_int { 5 }
+
+ \tl_set:Nn \l__fontscale_tiny_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_scriptsize_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_footnotesize_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_small_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_large_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_Large_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_LARGE_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_huge_scale_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_Huge_scale_tl { \q_no_value }
+
+ \tl_set:Nn \l__fontscale_tiny_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_scriptsize_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_footnotesize_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_small_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_normalsize_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_large_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_Large_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_LARGE_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_huge_size_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_Huge_size_tl { \q_no_value }
+
+ \tl_set:Nn \l__fontscale_tiny_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_scriptsize_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_footnotesize_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_small_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_normalsize_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_large_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_Large_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_LARGE_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_huge_baselineskip_tl { \q_no_value }
+ \tl_set:Nn \l__fontscale_Huge_baselineskip_tl { \q_no_value }
+ }
+\c__fontscale_keys_precompile_initial_tl
+
+% Pre-compiles the keys with their values at the end of the preamble. The keys
+% are pre-compiled by hand for speed.
+\AddToHook { begindocument / before }
+ { \__fontscale_keys_precompile_preamble: }
+\cs_new_protected:Npn \__fontscale_keys_precompile_preamble:
+ {
+ \tl_set:Ne \l__fontscale_keys_precompile_preamble_tl
+ {
+ \bool_if:NTF \l__fontscale_ignore_order_bool
+ { \bool_set_true:N } { \bool_set_false:N }
+ \l__fontscale_ignore_order_bool
+ \fp_set:Nn \exp_not:N \l__fontscale_baselineskip_size_ratio_fp
+ { \l__fontscale_baselineskip_size_ratio_fp }
+ \str_set:Nn \exp_not:N \l__fontscale_typographic_scale_str
+ { \l__fontscale_typographic_scale_str }
+ \fp_set:Nn \exp_not:N \l__fontscale_modular_ratio_fp
+ { \l__fontscale_modular_ratio_fp }
+ \fp_set:Nn \exp_not:N \l__fontscale_musical_ratio_fp
+ { \l__fontscale_musical_ratio_fp }
+ \int_set:Nn \l__fontscale_musical_notes_int
+ { \int_use:N \l__fontscale_musical_notes_int }
+
+ \tl_set:Nn \exp_not:N \l__fontscale_tiny_scale_tl
+ { \exp_not:o \l__fontscale_tiny_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_scale_tl
+ { \exp_not:o \l__fontscale_scriptsize_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_scale_tl
+ { \exp_not:o \l__fontscale_footnotesize_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_small_scale_tl
+ { \exp_not:o \l__fontscale_small_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_large_scale_tl
+ { \exp_not:o \l__fontscale_large_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_Large_scale_tl
+ { \exp_not:o \l__fontscale_Large_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_LARGE_scale_tl
+ { \exp_not:o \l__fontscale_LARGE_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_huge_scale_tl
+ { \exp_not:o \l__fontscale_huge_scale_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_Huge_scale_tl
+ { \exp_not:o \l__fontscale_Huge_scale_tl }
+
+ \tl_set:Nn \exp_not:N \l__fontscale_tiny_size_tl
+ { \exp_not:o \l__fontscale_tiny_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_size_tl
+ { \exp_not:o \l__fontscale_scriptsize_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_size_tl
+ { \exp_not:o \l__fontscale_footnotesize_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_small_size_tl
+ { \exp_not:o \l__fontscale_small_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_normalsize_size_tl
+ { \exp_not:o \l__fontscale_normalsize_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_large_size_tl
+ { \exp_not:o \l__fontscale_large_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_Large_size_tl
+ { \exp_not:o \l__fontscale_Large_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_LARGE_size_tl
+ { \exp_not:o \l__fontscale_LARGE_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_huge_size_tl
+ { \exp_not:o \l__fontscale_huge_size_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_Huge_size_tl
+ { \exp_not:o \l__fontscale_Huge_size_tl }
+
+ \tl_set:Nn \exp_not:N \l__fontscale_tiny_baselineskip_tl
+ { \exp_not:o \l__fontscale_tiny_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_scriptsize_baselineskip_tl
+ { \exp_not:o \l__fontscale_scriptsize_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_footnotesize_baselineskip_tl
+ { \exp_not:o \l__fontscale_footnotesize_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_small_baselineskip_tl
+ { \exp_not:o \l__fontscale_small_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_normalsize_baselineskip_tl
+ { \exp_not:o \l__fontscale_normalsize_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_large_baselineskip_tl
+ { \exp_not:o \l__fontscale_large_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_Large_baselineskip_tl
+ { \exp_not:o \l__fontscale_Large_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_LARGE_baselineskip_tl
+ { \exp_not:o \l__fontscale_LARGE_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_huge_baselineskip_tl
+ { \exp_not:o \l__fontscale_huge_baselineskip_tl }
+ \tl_set:Nn \exp_not:N \l__fontscale_Huge_baselineskip_tl
+ { \exp_not:o \l__fontscale_Huge_baselineskip_tl }
+ }
+ }
+
+% PROCESS KEYS
+
+\NewDocumentCommand \fontscalesetup { m } { \__fontscale_keys_set:n {#1} }
+\cs_new_protected:Npn \__fontscale_keys_set:n #1
+ {
+ \keys_set:nn { fontscale } {#1}
+ \__fontscale_keys_process:
+ }
+\cs_new_protected:Npn \__fontscale_keys_process:
+ {
+ \__fontscale_keys_process_normalsize:
+ \__fontscale_keys_process_other:
+ \__fontscale_keys_process_other_props:
+ \__fontscale_keys_process_check_order:
+ }
+% Sets the size and baselineskip of \normalsize, stores them in a property
+% list, and uses \normalsize.
+\cs_new_protected:Npn \__fontscale_keys_process_normalsize:
+ {
+ \quark_if_no_value:NTF \l__fontscale_normalsize_size_tl
+ {
+ \dim_set:Nn \l_fontscale_normalsize_size_dim
+ {
+ \str_case:on \l__fontscale_typographic_scale_str
+ {
+ { classic-10pt } { 10pt }
+ { classic-11pt } { 11pt }
+ { classic-12pt } { 12pt }
+ { modular } { 10pt }
+ { musical } { 10pt }
+ }
+ }
+ }
+ {
+ \__fontscale_dim_set_with_default_unit:Nn
+ \l_fontscale_normalsize_size_dim { \l__fontscale_normalsize_size_tl }
+ }
+ \fp_set:Nn \l__fontscale_normalsize_size_fp
+ { \l_fontscale_normalsize_size_dim }
+ \quark_if_no_value:NTF \l__fontscale_normalsize_baselineskip_tl
+ {
+ \skip_set:Nn \l_fontscale_normalsize_baselineskip_skip
+ {
+ \fp_to_dim:n
+ {
+ \l__fontscale_normalsize_size_fp
+ * \l__fontscale_baselineskip_size_ratio_fp
+ }
+ }
+ }
+ {
+ \__fontscale_skip_set_with_default_unit:Nn
+ \l_fontscale_normalsize_baselineskip_skip
+ { \l__fontscale_normalsize_baselineskip_tl }
+ }
+ \prop_put:Nno \l_fontscale_normalsize_prop { size }
+ { \dim_use:N \l_fontscale_normalsize_size_dim }
+ \prop_put:Nno \l_fontscale_normalsize_prop { baselineskip }
+ { \skip_use:N \l_fontscale_normalsize_baselineskip_skip }
+ \normalsize
+ }
+% Sets the size, scale, and baselineskip of the other font size commands.
+% Issues a warning if the user sets both the scale and size keys for the same
+% font size command.
+\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xpt:n #1
+ {
+ \dim_set:cn { l_fontscale_#1_size_dim }
+ {
+ \str_case:nn {#1}
+ {
+ { tiny } { 6pt }
+ { scriptsize } { 7pt }
+ { footnotesize } { 8pt }
+ { small } { 9pt }
+ { large } { 11pt }
+ { Large } { 12pt }
+ { LARGE } { 14pt }
+ { huge } { 16pt }
+ { Huge } { 18pt }
+ }
+ }
+ }
+\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xipt:n #1
+ {
+ \dim_set:cn { l_fontscale_#1_size_dim }
+ {
+ \str_case:nn {#1}
+ {
+ { tiny } { 7pt }
+ { scriptsize } { 8pt }
+ { footnotesize } { 9pt }
+ { small } { 10pt }
+ { large } { 12pt }
+ { Large } { 14pt }
+ { LARGE } { 16pt }
+ { huge } { 18pt }
+ { Huge } { 21pt }
+ }
+ }
+ }
+\cs_new_protected:Npn \__fontscale_keys_process_other_classic_xiipt:n #1
+ {
+ \dim_set:cn { l_fontscale_#1_size_dim }
+ {
+ \str_case:nn {#1}
+ {
+ { tiny } { 8pt }
+ { scriptsize } { 9pt }
+ { footnotesize } { 10pt }
+ { small } { 11pt }
+ { large } { 14pt }
+ { Large } { 16pt }
+ { LARGE } { 18pt }
+ { huge } { 21pt }
+ { Huge } { 24pt }
+ }
+ }
+ }
+\cs_new_protected:Npn \__fontscale_keys_process_other_modular:n #1
+ {
+ \dim_set:cn { l_fontscale_#1_size_dim }
+ {
+ \fp_to_dim:n
+ {
+ \l__fontscale_normalsize_size_fp * \l__fontscale_modular_ratio_fp
+ ^ \use:c { c_fontscale_#1_step_fp }
+ }
+ }
+ }
+\cs_new_protected:Npn \__fontscale_keys_process_other_musical:n #1
+ {
+ \dim_set:cn { l_fontscale_#1_size_dim }
+ {
+ \fp_to_dim:n
+ {
+ \l__fontscale_normalsize_size_fp * \l__fontscale_musical_ratio_fp
+ ^ ( \use:c { c_fontscale_#1_step_fp }
+ / \l__fontscale_musical_notes_fp )
+ }
+ }
+ }
+\cs_new_protected:Npn \__fontscale_keys_process_other:
+ {
+ \str_case:on \l__fontscale_typographic_scale_str
+ {
+ { classic-10pt }
+ {
+ \cs_set_eq:NN \__fontscale_keys_process_other_typographic_scale:n
+ \__fontscale_keys_process_other_classic_xpt:n
+ }
+ { classic-11pt }
+ {
+ \cs_set_eq:NN \__fontscale_keys_process_other_typographic_scale:n
+ \__fontscale_keys_process_other_classic_xipt:n
+ }
+ { classic-12pt }
+ {
+ \cs_set_eq:NN \__fontscale_keys_process_other_typographic_scale:n
+ \__fontscale_keys_process_other_classic_xiipt:n
+ }
+ { modular }
+ {
+ \cs_set_eq:NN \__fontscale_keys_process_other_typographic_scale:n
+ \__fontscale_keys_process_other_modular:n
+ }
+ { musical }
+ {
+ \cs_set_eq:NN \__fontscale_keys_process_other_typographic_scale:n
+ \__fontscale_keys_process_other_musical:n
+ \fp_set:Nn \l__fontscale_musical_notes_fp
+ { \l__fontscale_musical_notes_int }
+ }
+ }
+ \tl_map_function:NN \c__fontscale_names_other_tl
+ \__fontscale_keys_process_other_aux:n
+ }
+\cs_new_protected:Npn \__fontscale_keys_process_other_aux:n #1
+ {
+ \quark_if_no_value:cF { l__fontscale_#1_size_tl }
+ {
+ \__fontscale_dim_set_with_default_unit:cn { l_fontscale_#1_size_dim }
+ { \use:c { l__fontscale_#1_size_tl } }
+ \quark_if_no_value:cF { l__fontscale_#1_scale_tl }
+ { \msg_warning:nnn { fontscale } { key-font-scale-ignored } {#1} }
+ \prg_break:
+ }
+ \quark_if_no_value:cF { l__fontscale_#1_scale_tl }
+ {
+ \dim_set:cn { l_fontscale_#1_size_dim }
+ {
+ \fp_to_dim:n
+ {
+ \l__fontscale_normalsize_size_fp
+ * ( \use:c { l__fontscale_#1_scale_tl } )
+ }
+ }
+ \prg_break:
+ }
+ \prg_break:n { \__fontscale_keys_process_other_typographic_scale:n {#1} }
+ \prg_break_point:
+ \fp_set:cn { l_fontscale_#1_scale_fp }
+ { \use:c { l_fontscale_#1_size_dim } / \l__fontscale_normalsize_size_fp }
+ \quark_if_no_value:cTF { l__fontscale_#1_baselineskip_tl }
+ {
+ \skip_set:cn { l_fontscale_#1_baselineskip_skip }
+ {
+ \fp_to_dim:n
+ {
+ \use:c { l_fontscale_#1_size_dim }
+ * \l__fontscale_baselineskip_size_ratio_fp
+ }
+ }
+ }
+ {
+ \__fontscale_skip_set_with_default_unit:cn
+ { l_fontscale_#1_baselineskip_skip }
+ { \use:c { l__fontscale_#1_baselineskip_tl } }
+ }
+ }
+% Puts the scale, size, and baselineskip of the other font size commands in
+% property lists.
+\cs_new_protected:Npn \__fontscale_keys_process_other_props:
+ {
+ \prop_put:Nne \l_fontscale_tiny_prop { scale }
+ { \fp_use:N \l_fontscale_tiny_scale_fp }
+ \prop_put:Nne \l_fontscale_scriptsize_prop { scale }
+ { \fp_use:N \l_fontscale_scriptsize_scale_fp }
+ \prop_put:Nne \l_fontscale_footnotesize_prop { scale }
+ { \fp_use:N \l_fontscale_footnotesize_scale_fp }
+ \prop_put:Nne \l_fontscale_small_prop { scale }
+ { \fp_use:N \l_fontscale_small_scale_fp }
+ \prop_put:Nne \l_fontscale_large_prop { scale }
+ { \fp_use:N \l_fontscale_large_scale_fp }
+ \prop_put:Nne \l_fontscale_Large_prop { scale }
+ { \fp_use:N \l_fontscale_Large_scale_fp }
+ \prop_put:Nne \l_fontscale_LARGE_prop { scale }
+ { \fp_use:N \l_fontscale_LARGE_scale_fp }
+ \prop_put:Nne \l_fontscale_huge_prop { scale }
+ { \fp_use:N \l_fontscale_huge_scale_fp }
+ \prop_put:Nne \l_fontscale_Huge_prop { scale }
+ { \fp_use:N \l_fontscale_Huge_scale_fp }
+
+ \prop_put:Nno \l_fontscale_tiny_prop { size }
+ { \dim_use:N \l_fontscale_tiny_size_dim }
+ \prop_put:Nno \l_fontscale_scriptsize_prop { size }
+ { \dim_use:N \l_fontscale_scriptsize_size_dim }
+ \prop_put:Nno \l_fontscale_footnotesize_prop { size }
+ { \dim_use:N \l_fontscale_footnotesize_size_dim }
+ \prop_put:Nno \l_fontscale_small_prop { size }
+ { \dim_use:N \l_fontscale_small_size_dim }
+ \prop_put:Nno \l_fontscale_large_prop { size }
+ { \dim_use:N \l_fontscale_large_size_dim }
+ \prop_put:Nno \l_fontscale_Large_prop { size }
+ { \dim_use:N \l_fontscale_Large_size_dim }
+ \prop_put:Nno \l_fontscale_LARGE_prop { size }
+ { \dim_use:N \l_fontscale_LARGE_size_dim }
+ \prop_put:Nno \l_fontscale_huge_prop { size }
+ { \dim_use:N \l_fontscale_huge_size_dim }
+ \prop_put:Nno \l_fontscale_Huge_prop { size }
+ { \dim_use:N \l_fontscale_Huge_size_dim }
+
+ \prop_put:Nno \l_fontscale_tiny_prop { baselineskip }
+ { \skip_use:N \l_fontscale_tiny_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_scriptsize_prop { baselineskip }
+ { \skip_use:N \l_fontscale_scriptsize_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_footnotesize_prop { baselineskip }
+ { \skip_use:N \l_fontscale_footnotesize_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_small_prop { baselineskip }
+ { \skip_use:N \l_fontscale_small_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_large_prop { baselineskip }
+ { \skip_use:N \l_fontscale_large_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_Large_prop { baselineskip }
+ { \skip_use:N \l_fontscale_Large_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_LARGE_prop { baselineskip }
+ { \skip_use:N \l_fontscale_LARGE_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_huge_prop { baselineskip }
+ { \skip_use:N \l_fontscale_huge_baselineskip_skip }
+ \prop_put:Nno \l_fontscale_Huge_prop { baselineskip }
+ { \skip_use:N \l_fontscale_Huge_baselineskip_skip }
+ }
+% Issues a warning if the font sizes or font baselineskips are not in the
+% correct order.
+\cs_new_protected:Npn \__fontscale_keys_process_check_order:
+ {
+ \bool_if:NF \l__fontscale_ignore_order_bool
+ {
+ \dim_compare:nF
+ {
+ \l_fontscale_tiny_size_dim
+ < \l_fontscale_scriptsize_size_dim
+ < \l_fontscale_footnotesize_size_dim
+ < \l_fontscale_small_size_dim
+ < \l_fontscale_normalsize_size_dim
+ < \l_fontscale_large_size_dim
+ < \l_fontscale_Large_size_dim
+ < \l_fontscale_LARGE_size_dim
+ < \l_fontscale_huge_size_dim
+ < \l_fontscale_Huge_size_dim
+ }
+ { \msg_warning:nn { fontscale } { font-sizes-out-of-order } }
+ \dim_compare:nF
+ {
+ \l_fontscale_tiny_baselineskip_skip
+ < \l_fontscale_scriptsize_baselineskip_skip
+ < \l_fontscale_footnotesize_baselineskip_skip
+ < \l_fontscale_small_baselineskip_skip
+ < \l_fontscale_normalsize_baselineskip_skip
+ < \l_fontscale_large_baselineskip_skip
+ < \l_fontscale_Large_baselineskip_skip
+ < \l_fontscale_LARGE_baselineskip_skip
+ < \l_fontscale_huge_baselineskip_skip
+ < \l_fontscale_Huge_baselineskip_skip
+ }
+ { \msg_warning:nn { fontscale } { font-baselineskips-out-of-order } }
+ }
+ }
+
+% DOCUMENT COMMANDS
+
+% The internal functions of each font size command are not used elsewhere in
+% the code for compatibility with user-defined hooks
+% (e.g. \AddToHook{cmd/normalsize/after}{<user-defined-function>}).
+% Need \dim_use:N for compatibility with the microtype package.
+\DeclareDocumentCommand \tiny { } { \__fontscale_tiny: }
+\cs_new_protected:Npn \__fontscale_tiny:
+ {
+ \@setfontsize \tiny { \dim_use:N \l_fontscale_tiny_size_dim }
+ \l_fontscale_tiny_baselineskip_skip
+ }
+\DeclareDocumentCommand \scriptsize { } { \__fontscale_scriptsize: }
+\cs_new_protected:Npn \__fontscale_scriptsize:
+ {
+ \@setfontsize \scriptsize { \dim_use:N \l_fontscale_scriptsize_size_dim }
+ \l_fontscale_scriptsize_baselineskip_skip
+ }
+\DeclareDocumentCommand \footnotesize { } { \__fontscale_footnotesize: }
+\cs_new_protected:Npn \__fontscale_footnotesize:
+ {
+ \@setfontsize \footnotesize
+ { \dim_use:N \l_fontscale_footnotesize_size_dim }
+ \l_fontscale_footnotesize_baselineskip_skip
+ }
+\DeclareDocumentCommand \small { } { \__fontscale_small: }
+\cs_new_protected:Npn \__fontscale_small:
+ {
+ \@setfontsize \small { \dim_use:N \l_fontscale_small_size_dim }
+ \l_fontscale_small_baselineskip_skip
+ }
+\DeclareDocumentCommand \normalsize { } { \__fontscale_normalsize: }
+\cs_new_protected:Npn \__fontscale_normalsize:
+ {
+ \@setfontsize \normalsize { \dim_use:N \l_fontscale_normalsize_size_dim }
+ \l_fontscale_normalsize_baselineskip_skip
+ }
+\DeclareDocumentCommand \large { } { \__fontscale_large: }
+\cs_new_protected:Npn \__fontscale_large:
+ {
+ \@setfontsize \large { \dim_use:N \l_fontscale_large_size_dim }
+ \l_fontscale_large_baselineskip_skip
+ }
+\DeclareDocumentCommand \Large { } { \__fontscale_Large: }
+\cs_new_protected:Npn \__fontscale_Large:
+ {
+ \@setfontsize \Large { \dim_use:N \l_fontscale_Large_size_dim }
+ \l_fontscale_Large_baselineskip_skip
+ }
+\DeclareDocumentCommand \LARGE { } { \__fontscale_LARGE: }
+\cs_new_protected:Npn \__fontscale_LARGE:
+ {
+ \@setfontsize \LARGE { \dim_use:N \l_fontscale_LARGE_size_dim }
+ \l_fontscale_LARGE_baselineskip_skip
+ }
+\DeclareDocumentCommand \huge { } { \__fontscale_huge: }
+\cs_new_protected:Npn \__fontscale_huge:
+ {
+ \@setfontsize \huge { \dim_use:N \l_fontscale_huge_size_dim }
+ \l_fontscale_huge_baselineskip_skip
+ }
+\DeclareDocumentCommand \Huge { } { \__fontscale_Huge: }
+\cs_new_protected:Npn \__fontscale_Huge:
+ {
+ \@setfontsize \Huge { \dim_use:N \l_fontscale_Huge_size_dim }
+ \l_fontscale_Huge_baselineskip_skip
+ }
+% Initializes to \normalsize.
+\normalsize
+
+\NewExpandableDocumentCommand \CurrentFontStep { }
+ { \__fontscale_current_font_step: }
+\cs_new:Npn \__fontscale_current_font_step:
+ {
+ \dim_case:nnF { \f@size pt }
+ {
+ { \l_fontscale_tiny_size_dim } { -4 }
+ { \l_fontscale_scriptsize_size_dim } { -3 }
+ { \l_fontscale_footnotesize_size_dim } { -2 }
+ { \l_fontscale_small_size_dim } { -1 }
+ { \l_fontscale_normalsize_size_dim } { 0 }
+ { \l_fontscale_large_size_dim } { 1 }
+ { \l_fontscale_Large_size_dim } { 2 }
+ { \l_fontscale_LARGE_size_dim } { 3 }
+ { \l_fontscale_huge_size_dim } { 4 }
+ { \l_fontscale_Huge_size_dim } { 5 }
+ }
+ {
+ \str_case:on \l__fontscale_typographic_scale_str
+ {
+ { modular }
+ {
+ \fp_eval:n
+ {
+ ln ( \f@size / \l__fontscale_normalsize_size_fp )
+ / ln ( \l__fontscale_modular_ratio_fp )
+ }
+ }
+ { musical }
+ {
+ \fp_eval:n
+ {
+ \l__fontscale_musical_notes_fp
+ * ln ( \f@size / \l__fontscale_normalsize_size_fp )
+ / ln ( \l__fontscale_musical_ratio_fp )
+ }
+ }
+ }
+ }
+ }
+
+\NewExpandableDocumentCommand \CurrentFontScale { }
+ { \__fontscale_current_font_scale: }
+\cs_new:Npn \__fontscale_current_font_scale:
+ { \fp_eval:n { \f@size / \l__fontscale_normalsize_size_fp } }
+
+\NewExpandableDocumentCommand \CurrentFontSize { }
+ { \__fontscale_current_font_size: }
+\cs_new:Npn \__fontscale_current_font_size: { \f@size pt }
+
+\NewExpandableDocumentCommand \CurrentFontBaselineskip { }
+ { \__fontscale_current_font_baselineskip: }
+\cs_new:Npn \__fontscale_current_font_baselineskip: { \f@baselineskip }
+
+\NewDocumentCommand \SetFontStep { s m }
+ {
+ \IfBooleanTF #1
+ { \__fontscale_add_font_step:n {#2} }
+ { \__fontscale_set_font_step:n {#2} }
+ }
+\cs_new_protected:Npn \__fontscale_set_font_step:n #1
+ {
+ \fp_set:Nn \l__fontscale_step_fp {#1}
+ \__fontscale_set_font_step_aux:N \l__fontscale_step_fp
+ }
+\cs_new_protected:Npn \__fontscale_set_font_step_aux:N #1
+ {
+ \token_case_meaning:NnF #1
+ {
+ \c_fontscale_tiny_step_fp { \tiny }
+ \c_fontscale_scriptsize_step_fp { \scriptsize }
+ \c_fontscale_footnotesize_step_fp { \footnotesize }
+ \c_fontscale_small_step_fp { \small }
+ \c_fontscale_normalsize_step_fp { \normalsize }
+ \c_fontscale_large_step_fp { \large }
+ \c_fontscale_Large_step_fp { \Large }
+ \c_fontscale_LARGE_step_fp { \LARGE }
+ \c_fontscale_huge_step_fp { \huge }
+ \c_fontscale_Huge_step_fp { \Huge }
+ }
+ {
+ \str_case:onF \l__fontscale_typographic_scale_str
+ {
+ { modular }
+ {
+ \fontsize
+ {
+ \fp_to_dim:n
+ {
+ \l__fontscale_normalsize_size_fp
+ * \l__fontscale_modular_ratio_fp ^ #1
+ }
+ }
+ {
+ \fp_to_dim:n
+ { \f@size * \l__fontscale_baselineskip_size_ratio_fp }
+ }
+ \selectfont
+ }
+ { musical }
+ {
+ \fontsize
+ {
+ \fp_to_dim:n
+ {
+ \l__fontscale_normalsize_size_fp
+ * \l__fontscale_musical_ratio_fp
+ ^ ( #1 / \l__fontscale_musical_notes_fp )
+ }
+ }
+ {
+ \fp_to_dim:n
+ { \f@size * \l__fontscale_baselineskip_size_ratio_fp }
+ }
+ \selectfont
+ }
+ }
+ { \msg_error:nn { fontscale } { font-step-out-of-bounds } }
+ }
+ }
+\cs_new_protected:Npn \__fontscale_add_font_step:n #1
+ {
+ \tl_set:Ne \l__fontscale_step_tl { \__fontscale_current_font_step: }
+ \tl_if_empty:NTF \l__fontscale_step_tl
+ { \msg_error:nn { fontscale } { font-step-out-of-bounds } }
+ {
+ \fp_set:Nn \l__fontscale_step_fp { (#1) + \l__fontscale_step_tl }
+ \__fontscale_add_font_step_aux:N \l__fontscale_step_fp
+ }
+ }
+\cs_new_eq:NN \__fontscale_add_font_step_aux:N \__fontscale_set_font_step_aux:N
+
+\NewDocumentCommand \SetFontScale { s m }
+ {
+ \IfBooleanTF #1
+ { \__fontscale_add_font_scale:n {#2} }
+ { \__fontscale_set_font_scale:n {#2} }
+ }
+\cs_new_protected:Npn \__fontscale_set_font_scale:n #1
+ {
+ \fontsize
+ { \fp_to_dim:n { \l__fontscale_normalsize_size_fp * (#1) } }
+ { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
+ \selectfont
+ }
+\cs_new_protected:Npn \__fontscale_add_font_scale:n #1
+ {
+ \fontsize
+ { \fp_to_dim:n { \l__fontscale_normalsize_size_fp * (#1) + \f@size } }
+ { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
+ \selectfont
+ }
+
+\NewDocumentCommand \SetFontSize { s m }
+ {
+ \IfBooleanTF #1
+ { \__fontscale_add_font_size:n {#2} }
+ { \__fontscale_set_font_size:n {#2} }
+ }
+\cs_new_protected:Npn \__fontscale_set_font_size:n #1
+ {
+ \__fontscale_dim_set_with_default_unit:Nn \l__fontscale_size_dim {#1}
+ \fontsize \l__fontscale_size_dim
+ { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
+ \selectfont
+ }
+\cs_new_protected:Npn \__fontscale_add_font_size:n #1
+ {
+ \__fontscale_dim_set_with_default_unit:Nn \l__fontscale_size_dim {#1}
+ \dim_add:Nn \l__fontscale_size_dim { \f@size pt }
+ \fontsize \l__fontscale_size_dim
+ { \fp_to_dim:n { \f@size * \l__fontscale_baselineskip_size_ratio_fp } }
+ \selectfont
+ }
+
+\NewDocumentCommand \ScaleFont { m } { \__fontscale_scalefont:n {#1} }
+\cs_new_protected:Npn \__fontscale_scalefont:n #1
+ {
+ \fontsize
+ { \fp_to_dim:n { \f@size * (#1) } }
+ { \fp_to_dim:n { \dim_to_fp:n { \f@baselineskip } * (#1) } }
+ \selectfont
+ }
+
+\NewDocumentCommand \SetFontSizeBaselineskip { m m }
+ { \__fontscale_set_font_size_baselineskip:nn {#1} {#2} }
+\cs_new_protected:Npn \__fontscale_set_font_size_baselineskip:nn #1#2
+ {
+ \__fontscale_dim_set_with_default_unit:Nn \l__fontscale_size_dim {#1}
+ \__fontscale_skip_set_with_default_unit:Nn \l__fontscale_baselineskip_skip
+ {#2}
+ \fontsize \l__fontscale_size_dim \l__fontscale_baselineskip_skip
+ \selectfont
+ }
+
+\NewDocumentCommand \PrintFontParameters { }
+ { \__fontscale_print_font_parameters: }
+\cs_new_protected:Npn \__fontscale_print_font_parameters:
+ {
+ step ~=~ \__fontscale_current_font_step: ,~
+ scale ~=~ \__fontscale_current_font_scale: ,~
+ size ~=~ \__fontscale_current_font_size: ,~
+ baselineskip ~=~ \__fontscale_current_font_baselineskip:
+ }
+
+\NewDocumentCommand \PrintAllFontParameters { }
+ { \__fontscale_print_all_font_parameters: }
+\cs_new_protected:Npn \__fontscale_print_all_font_parameters:
+ {
+ \tl_map_inline:Nn \c__fontscale_names_tl
+ {
+ \prop_get:cnN { l_fontscale_##1_prop } { step } \l__fontscale_step_tl
+ \prop_get:cnN { l_fontscale_##1_prop } { scale } \l__fontscale_scale_tl
+ \token_to_str:c {##1} \@ \c_colon_str \c_space_tl
+ step ~=~ \l__fontscale_step_tl ,~
+ scale ~=~ \l__fontscale_scale_tl ,~
+ size ~=~ \dim_use:c { l_fontscale_##1_size_dim } ,~
+ baselineskip ~=~ \skip_use:c { l_fontscale_##1_baselineskip_skip }
+ \str_if_eq:nnF {##1} { Huge } { \newline }
+ }
+ }
+
+\NewDocumentCommand \PrintSampleText
+ { s O
+ {
+ The~ \texttt { fontscale }~ package \c_colon_str \c_space_tl
+ A~ user~ interface~ for~ setting~ document~ font~ sizes
+ }
+ }
+ {
+ \IfBooleanTF #1
+ { \__fontscale_print_sample_text_descending_order:n {#2} }
+ { \__fontscale_print_sample_text_ascending_order:n {#2} }
+ }
+\cs_new_protected:Npn \__fontscale_print_sample_text_ascending_order:n #1
+ {
+ { \tiny #1 \par }
+ { \scriptsize #1 \par }
+ { \footnotesize #1 \par }
+ { \small #1 \par }
+ { \normalsize #1 \par }
+ { \large #1 \par }
+ { \Large #1 \par }
+ { \LARGE #1 \par }
+ { \huge #1 \par }
+ { \Huge #1 \par }
+ }
+\cs_new_protected:Npn \__fontscale_print_sample_text_descending_order:n #1
+ {
+ { \Huge #1 \par }
+ { \huge #1 \par }
+ { \LARGE #1 \par }
+ { \Large #1 \par }
+ { \large #1 \par }
+ { \normalsize #1 \par }
+ { \small #1 \par }
+ { \footnotesize #1 \par }
+ { \scriptsize #1 \par }
+ { \tiny #1 \par }
+ }
+
+\NewDocumentCommand \PrintFontSizeCommand { } { \__fontscale_print_name: }
+\cs_new_protected:Npn \__fontscale_print_name:
+ {
+ \dim_case:nnF { \f@size pt }
+ {
+ { \l_fontscale_tiny_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_tiny_baselineskip_skip }
+ { \token_to_str:N \tiny } { UNDEFINED \@ }
+ }
+ { \l_fontscale_scriptsize_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_scriptsize_baselineskip_skip }
+ { \token_to_str:N \scriptsize } { UNDEFINED \@ }
+ }
+ { \l_fontscale_footnotesize_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_footnotesize_baselineskip_skip }
+ { \token_to_str:N \footnotesize } { UNDEFINED \@ }
+ }
+ { \l_fontscale_small_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_small_baselineskip_skip }
+ { \token_to_str:N \small } { UNDEFINED \@ }
+ }
+ { \l_fontscale_normalsize_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_normalsize_baselineskip_skip }
+ { \token_to_str:N \normalsize } { UNDEFINED \@ }
+ }
+ { \l_fontscale_large_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_large_baselineskip_skip }
+ { \token_to_str:N \large } { UNDEFINED \@ }
+ }
+ { \l_fontscale_Large_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_Large_baselineskip_skip }
+ { \token_to_str:N \Large } { UNDEFINED \@ }
+ }
+ { \l_fontscale_LARGE_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_LARGE_baselineskip_skip }
+ { \token_to_str:N \LARGE \@ } { UNDEFINED \@ }
+ }
+ { \l_fontscale_huge_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_huge_baselineskip_skip }
+ { \token_to_str:N \huge } { UNDEFINED \@ }
+ }
+ { \l_fontscale_Huge_size_dim }
+ {
+ \skip_if_eq:nnTF { \f@baselineskip }
+ { \l_fontscale_Huge_baselineskip_skip }
+ { \token_to_str:N \Huge } { UNDEFINED \@ }
+ }
+ }
+ { UNDEFINED \@ }
+ }
+
+% TEXT PURIFY
+
+\cs_new:Npn \__fontscale_text_purify_equivalent:n #1
+ {
+ \bool_lazy_all:nT
+ {
+ { \tl_if_single_p:n {#1} }
+ { \tl_if_single_token_p:n #1 }
+ { \token_if_eq_meaning_p:NN #1 * }
+ }
+ { \use_none:n }
+ }
+\text_declare_purify_equivalent:Nn \SetFontStep
+ { \__fontscale_text_purify_equivalent:n }
+\text_declare_purify_equivalent:Nn \SetFontScale
+ { \__fontscale_text_purify_equivalent:n }
+\text_declare_purify_equivalent:Nn \SetFontSize
+ { \__fontscale_text_purify_equivalent:n }
+\text_declare_purify_equivalent:Nn \ScaleFont { \use_none:n }
\text_declare_purify_equivalent:Nn \SetFontSizeBaselineskip { \use_none:nn } \ No newline at end of file
diff --git a/macros/latex/contrib/hulipsum/README b/macros/latex/contrib/hulipsum/README
index e336e94b2f..8ff9548c26 100644
--- a/macros/latex/contrib/hulipsum/README
+++ b/macros/latex/contrib/hulipsum/README
@@ -1,6 +1,6 @@
hulipsum.sty package
-Copyright 2018-2020 by Tibor Tomacs
+Copyright 2018-2024 by Tibor Tomacs
Hungarian dummy text (Lorum ipse) for demonstrating the textual elements of a document template
All paragraphs are taken with permission from http://www.lorumipse.hu/.
diff --git a/macros/latex/contrib/hulipsum/hulipsum.dtx b/macros/latex/contrib/hulipsum/hulipsum.dtx
index ce3527588b..02d257e3a9 100644
--- a/macros/latex/contrib/hulipsum/hulipsum.dtx
+++ b/macros/latex/contrib/hulipsum/hulipsum.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright 2018-2020 by Tibor Tomacs
+% Copyright 2018-2024 by Tibor Tomacs
%
% Hungarian dummy text (Lorum ipse) for demonstrating the textual elements of a document template
% All paragraphs are taken with permission from http://www.lorumipse.hu/.
@@ -24,15 +24,14 @@
%<*driver>
\ProvidesFile{hulipsum.dtx}
%</driver>
-%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<package>\ProvidesPackage{hulipsum}[2020/11/03 v1.1 Hungarian dummy text (Lorum ipse)]
+%<package>\NeedsTeXFormat{LaTeX2e}[2022/06/20]
+%<package>\ProvidesPackage{hulipsum}[2024/04/07 v1.2 Hungarian dummy text (Lorum ipse)]
%
%<*driver>
\documentclass{ltxdoc}
\OnlyDescription
+\AddToHook{begindocument/before}[doc/hyperref]{\hypersetup{pdfstartview=FitH,colorlinks,allcolors=black}}
\usepackage[a4paper,margin=25mm]{geometry}
-\usepackage[pdfstartview=FitH,colorlinks,allcolors=black]{hyperref}
-\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{listings,xcolor}
@@ -60,8 +59,8 @@ keepspaces]}
%
% \GetFileInfo{hulipsum.sty}
%
-% \title{The {\bfseries\sffamily hulipsum} package\\{\large v1.1 (2020/11/03)}}
-% \author{Tibor Tómács\\{\normalsize\url{tomacs.tibor@uni-eszterhazy.hu}}}
+% \title{The {\bfseries\sffamily hulipsum} package\\{\large v1.2 (2024/04/07)}}
+% \author{Tibor Tómács\\{\normalsize\url{tomacs.tibor@gmail.com}}}
% \date{}
% \maketitle
% \thispagestyle{empty}
@@ -104,13 +103,32 @@ keepspaces]}
%
% \verbinline|\hulipsumsave*[!<num1>!-!<num2>!]\hulipsumexp| is equivalent to \verbinline|\hulipsum*[!<num1>!-!<num2>!]|.
%
-% \item\commandinline|\hulipsumdocument|\\
-% It creates a blind document with title, author, date, table of contents, chapter, section, subsection, subsubsection, paragraph, subparagraph, figure, lists and bibliography.
-%
-% \item\commandinline|\hulipsumdocument[part]|\\
-% It works like \verbinline|\hulipsumdocument|, but it creates a part before the chapter and section.
-% \end{description}
+% \item\commandinline|\hulipsumdocument[!<options>!]|\\
+% It creates a blind document with title, author, date, table of contents, part, chapter, section, subsection, subsubsection, paragraph, subparagraph, figure, lists, equations and bibliography.
+%
+% The \commandinline|!<options>!| are:
+%
+% \begin{description}
+% \item \commandinline|maketitle=!<boolean>!| \hfill (default: \texttt{true})\\
+% Adds \verbinline|\maketitle| if the \commandinline|!<boolean>!| is \texttt{true}.
+%
+% \item \commandinline|tableofcontents=!<boolean>!| \hfill (default: \texttt{true})\\
+% Adds \verbinline|\tableofcontents| if the \commandinline|!<boolean>!| is \texttt{true}.
+%
+% \item \commandinline|part=!<boolean>!| \hfill (default: \texttt{false})\\
+% Adds \verbinline|\part{...}| before the chapter and section, if the \commandinline|!<boolean>!| is \texttt{true}.
%
+% \item \commandinline|abstract=!<boolean>!| \hfill (default: \texttt{true})\\
+% Adds an \texttt{abstract} environment if the \commandinline|!<boolean>!| is \texttt{true}.
+%
+% \item \commandinline|math=!<boolean>!| \hfill (default: \texttt{true})\\
+% Adds a mathematical equation if the \commandinline|!<boolean>!| is \texttt{true}.
+%
+% \item \commandinline|bibliography=!<boolean>!| \hfill (default: \texttt{true})\\
+% Adds \texttt{thebibliography} environment if the \commandinline|!<boolean>!| is \texttt{true}.
+% \end{description}
+% The \texttt{=true} can be omitted in the options. For example \verbinline|\hulipsumdocument[part,math=false]|.
+% \end{description}
% \StopEventually
%
% \begin{macrocode}
@@ -210,19 +228,29 @@ keepspaces]}
\newif\if@hulipsum@firstexpand@
\@hulipsum@firstexpand@true
-\newcommand{\hulipsumdocument}[1][]{%
+\newcommand{\hulipsumdocument}[1][]{
\if@hulipsum@firstexpand@
-\global\@hulipsum@firstexpand@false%
-\def\hulipsum@part{#1}%
-\def\hulipsum@partcheck{part}%
+\global\@hulipsum@firstexpand@false
+\begingroup
+\DeclareKeys{
+ maketitle.if=@hulipsum@maketitle,
+ tableofcontents.if=@hulipsum@tableofcontents,
+ part.if=@hulipsum@part,
+ abstract.if=@hulipsum@abstract,
+ math.if=@hulipsum@math,
+ bibliography.if=@hulipsum@bibliography}
+\SetKeys{maketitle,part=false,abstract,tableofcontents,math,bibliography,#1}
+\if@hulipsum@maketitle
\@ifundefined{title}{}{\title{L\'{o}rum ipse}}
\@ifundefined{author}{}{\author{Nyomasek Bob\'{o}}}
+\@ifundefined{supervisor}{}{\supervisor{Szel\'{e}s Gerg\H{o}\\ egyetemi docens}\author{Nyomasek Bob\'{o}\\ matematika szak}}
+\@ifundefined{institute}{}{\institute{Matematikai és Informatikai Intézet}}
+\@ifundefined{city}{}{\city{Eger}}
\@ifundefined{maketitle}{}{\maketitle}
-\@ifundefined{tableofcontents}{}{\tableofcontents}
-\@ifundefined{abstract}{}{\begin{abstract}\hulipsum[1]\end{abstract}}
-\ifx\hulipsum@part\hulipsum@partcheck%
-\@ifundefined{part}{}{\part{Borzaszt\'{o}an cog\'{a}lis pat\'{a}s}}
\fi
+\if@hulipsum@tableofcontents\@ifundefined{tableofcontents}{}{\tableofcontents}\fi
+\if@hulipsum@abstract\@ifundefined{abstract}{}{\begin{abstract}\hulipsum[1]\end{abstract}}\fi
+\if@hulipsum@part\@ifundefined{part}{}{\part{Borzaszt\'{o}an cog\'{a}lis pat\'{a}s}}\fi
\@ifundefined{chapter}{}{\chapter{Fog\'{a}s n\'{e}lk\"{u}l nem vark\'{a}l}}
\@ifundefined{section}{}{\section{A vandoba h\'{e}t matlan}}
\hulipsum[1-2]
@@ -274,12 +302,19 @@ keepspaces]}
\end{description}
\end{description}
\end{description}}
+\if@hulipsum@math
+$\mathrm{e}^x=\sum_{n=0}^\infty\frac{x^n}{n!}$ minden val\'{o}s $x$ eset\'{e}n.
+\[\mathrm{e}^x=\sum_{n=0}^\infty\frac{x^n}{n!}\quad\forall x\in\mathbf{R}.\]
+\fi
+\if@hulipsum@bibliography
\@ifundefined{thebibliography}{}{%
\begin{thebibliography}{1}
\bibitem{a} \textsc{Nyomasek Bob\'{o}}, \emph{L\'{o}rum ipse}, Handana Kiad\'{o}, 1980.
\bibitem{b} \textsc{Szel\'{e}s Gerg\H{o}}, \emph{A griszt\'{a}s talt\'{a}s kirg\'{e}szei}, \"{U}d\"{o}sv\'{e}ny Kiad\'{o}, 2010.
\end{thebibliography}}
\fi
+\endgroup
+\fi
}
\def\hulipsum@i{\g@addto@macro\hulipsumexp{L\'{o}rum ipse olyan borzaszt\'{o}an cog\'{a}lis pat\'{a}s, ami fog\'{a}s n\'{e}lk\"{u}l nem vark\'{a}l megfelel\H{o}en. A vandoba h\'{e}t matlan talmatos ferodika, amelynek kap\'{a}r\'{a}s\'{a}t az izma mig\'{a}lja. A vandoba bul\'{a}i k\"{o}z\"{u}l zsibulja meg az izm\'{a}t, a porn\'{a}t, valamint a m\H{u}v\'{e}st \'{e}s v\'{a}tog a vandoba bul\'{a}inak v\'{o}k\'{a}ir\'{o}l. V\'{o}k\'{a}ja a raktil proz\'{a}sa k\'{e}t emen k\"{o}z\"{o}tt. \'{E}vente legal\'{a}bb egyszer csetnyi pipecs\'{e}lnie az ement, azon fongnia a l\'{a}ltos kap\'{a}r\'{a}sr\'{o}l \'{e}s a ny\'{a}kuum b\"{o}ll\'{e}s\'{e}r\H{o}l. A vandoba ninti \'{e}s az emen el\'{e} red\H{o}zi a szamlan radalmakan \'{e}rv\'{e}st. Az ement az izma bamz\'{a}sban, a has\'{a}s szegeszk\'{e}j\'{e}vel log\'{a}lja \"{o}ssze, legal\'{a}bb 15 nappal annak poz\'{a}sa el\H{o}tt. Az ement \"{o}ssze kell log\'{a}lnia akkor is, ha azt az \'{o}d\'{a}s legal\'{a}bb egyes bamz\'{a}sban, a reszt\H{o} billet\'{e}vel h\'{a}sodja.}}
diff --git a/macros/latex/contrib/hulipsum/hulipsum.ins b/macros/latex/contrib/hulipsum/hulipsum.ins
index 749df0cfb5..eedd7fb45b 100644
--- a/macros/latex/contrib/hulipsum/hulipsum.ins
+++ b/macros/latex/contrib/hulipsum/hulipsum.ins
@@ -1,5 +1,5 @@
-% Copyright 2018-2020 by Tibor Tomacs
+% Copyright 2018-2024 by Tibor Tomacs
%
% Hungarian dummy text (Lorum ipse) for demonstrating the textual elements of a document template
% All paragraphs are taken with permission from http://www.lorumipse.hu/.
@@ -23,7 +23,7 @@
\preamble
This is a generated file.
-Copyright 2018-2020 by Tibor Tomacs
+Copyright 2018-2024 by Tibor Tomacs
Hungarian dummy text (Lorum ipse) for demonstrating the textual elements of a document template
All paragraphs are taken with permission from http://www.lorumipse.hu/.
diff --git a/macros/latex/contrib/hulipsum/hulipsum.pdf b/macros/latex/contrib/hulipsum/hulipsum.pdf
index 2a621923b4..c44bf76cb9 100644
--- a/macros/latex/contrib/hulipsum/hulipsum.pdf
+++ b/macros/latex/contrib/hulipsum/hulipsum.pdf
Binary files differ