texlive[72024] Master/texmf-dist: fontscale (13aug24)

commits+karl at tug.org commits+karl at tug.org
Tue Aug 13 22:04:17 CEST 2024


Revision: 72024
          https://tug.org/svn/texlive?view=revision&revision=72024
Author:   karl
Date:     2024-08-13 22:04:17 +0200 (Tue, 13 Aug 2024)
Log Message:
-----------
fontscale (13aug24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
    trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
    trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md	2024-08-13 17:34:09 UTC (rev 72023)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/CHANGELOG.md	2024-08-13 20:04:17 UTC (rev 72024)
@@ -7,6 +7,14 @@
 
 ## [Unreleased]
 
+## [v2.1.0] - 2024-08-12
+
+### Changed
+- Documentation improvements.
+
+### Added
+- `\CurrentFontSizeCommand`
+
 ## [v2.0.0] - 2024-08-02
 
 ### Changed

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls	2024-08-13 17:34:09 UTC (rev 72023)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/beery.cls	2024-08-13 20:04:17 UTC (rev 72024)
@@ -4,7 +4,7 @@
 \NeedsTeXFormat{LaTeX2e}[2023-11-01]
 \ProvidesExplClass
   {beery}
-  {2024-08-02}
+  {2024-08-12}
   {}
   {}
 
@@ -23,7 +23,8 @@
 
 % CUSTOM MACROS
 
-\NewExpandableDocumentCommand \alphabet { } { abcdefghijklmnopqrstuvwxyz }
+\tl_const:Nn \c_beery_alphabet_tl { abcdefghijklmnopqrstuvwxyz }
+\NewExpandableDocumentCommand \alphabet { } { \c_beery_alphabet_tl }
 \NewDocumentCommand \Key { m o o }
   {
     \mode_leave_vertical:
@@ -73,7 +74,7 @@
 
 % PAGE STYLE
 
-\hbox_set:Nn \l__beery_tmp_box { abcdefghijklmnopqrstuvwxyz }
+\hbox_set:Nn \l__beery_tmp_box { \c_beery_alphabet_tl }
 \dim_const:Nn \c_beery_alphabet_dim { \box_wd:N \l__beery_tmp_box }
 \dim_log:N \c_beery_alphabet_dim
 
@@ -126,7 +127,8 @@
 
 \nonfrenchspacing
 \linespread { 1 }
-\RequirePackage [ skip = \c_beery_medium_skip ] { parskip }
+\skip_set_eq:NN \parskip \c_beery_medium_skip
+\dim_zero:N \parindent
 \RequirePackage [ raggedrightboxes ] { ragged2e }
 \skip_set:Nn \RaggedRightRightskip { 0pt plus 0.5 \linewidth }
 \dim_zero:N \RaggedRightParindent
@@ -150,19 +152,21 @@
 \titlespacing* \section % section
   { 0pt } % indent
   {
-    \c_beery_big_dim
+    - \parskip
+    + \c_beery_big_dim
     plus  \fp_eval:n { 1 / 2 * 4 } \c_beery_big_dim
     minus \fp_eval:n { 1 / 3 / 4 } \c_beery_big_dim
   } % before
-  { \c_beery_medium_skip } % after
+  { - \parskip + \c_beery_medium_skip } % after
 \titlespacing* \subsection
   { 0pt }
   {
-    \fp_eval:n { 4 / 3 } \c_beery_medium_dim
+    - \parskip
+    + \fp_eval:n { 4 / 3 } \c_beery_medium_dim
     plus  \fp_eval:n { 1 / 2 * 4 } \c_beery_medium_dim
     minus \fp_eval:n { 1 / 3 / 4 } \c_beery_medium_dim
   }
-  { \c_beery_medium_skip }
+  { - \parskip + \c_beery_medium_skip }
 
 \titleformat \section % section
   [ block ] % shape
@@ -202,7 +206,10 @@
   {
     \par
     \IfBooleanTF #1
-      { \int_compare:nNnT { \prevgraf } = { 1 } { \nobreak \@afterheading } }
+      {
+        \int_compare:nNnT { \prevgraf } = { 1 }
+          { \nobreak \@afterheading }
+      }
       { \nobreak \@afterheading }
   }
 \NewDocumentCommand \listheading { m }
@@ -210,7 +217,8 @@
     \par
     #1
     \par
-    \int_compare:nNnT { \prevgraf } = { 1 } { \nobreak \@afterheading }
+    \int_compare:nNnT { \prevgraf } = { 1 }
+      { \nobreak \@afterheading }
     \vspace { \skip_eval:n { \c_beery_small_skip - \parskip } }
   }
 

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex	2024-08-13 17:34:09 UTC (rev 72023)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-classic.tex	2024-08-13 20:04:17 UTC (rev 72024)
@@ -1,6 +1,6 @@
 \ProvidesFile
   {fontscale-table-classic.tex}
-  [2024-08-02]
+  [2024-08-12]
 
 \begin{table}
   \centering

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex	2024-08-13 17:34:09 UTC (rev 72023)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-font-steps.tex	2024-08-13 20:04:17 UTC (rev 72024)
@@ -1,6 +1,6 @@
 \ProvidesFile
   {fontscale-table-font-steps.tex}
-  [2024-08-02]
+  [2024-08-12]
 
 \begin{table}
   \centering

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex	2024-08-13 17:34:09 UTC (rev 72023)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale-table-musical.tex	2024-08-13 20:04:17 UTC (rev 72024)
@@ -1,6 +1,6 @@
 \ProvidesFile
   {fontscale-table-musical.tex}
-  [2024-08-02]
+  [2024-08-12]
 
 \begin{table}
   \centering

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex	2024-08-13 17:34:09 UTC (rev 72023)
+++ trunk/Master/texmf-dist/doc/latex/fontscale/fontscale.tex	2024-08-13 20:04:17 UTC (rev 72024)
@@ -14,7 +14,7 @@
 
 Oliver Beery
 
-Version 2.0.0\quad{}2 August 2024
+Version 2.1.0\quad{}12 August 2024
 
 
 \section{Introduction}
@@ -32,9 +32,9 @@
   \item
   Set the font sizes and font baselineskips of the standard \LaTeX{} font size commands mid\-/document or within a local group (\S\ref{subsec:fontscalesetup}).
   \item
-  Provides expandable commands that expand to the current font step, font scale, font size, or font baselineskip (\S\ref{subsec:expandable}).
+  Provides expandable commands that expand to the current font step, font scale, font size, font baselineskip, or font size command (\S\ref{subsec:expandable}).
   \item
-  Provides additional font size commands, including setting the font size by setting the font step or font scale and setting the font size relative to the current font size using more powerful tools than the \pkg{relsize} package (\S\ref{subsec:fontsize}).
+  Provides additional font size commands, including setting the font size by setting the font step or font scale and setting the font size relative to the current font size using more powerful tools than the \pkg{scalefnt} and \pkg{relsize} packages (\S\ref{subsec:fontsize}).
   \item
   For \LaTeX3 programmers, this package defines public \pkg{expl3} variables that store the font step, font scale, font size, and font baselineskip of each font size command from \cs{tiny} to \cs{Huge} (\S\ref{sec:programming}).
 \end{itemize}
@@ -42,7 +42,7 @@
 \subsection{Loading the package}
 \label{subsec:loading}
 
-\listheading{The \pkg{fontscale} package requires:}
+\listheading{Requirements:}
 \begin{itemize}
   \item \LaTeXe{} version 2023-11-01 or newer
   \item \pkg{l3kernel} version 2023-10-10 or newer
@@ -58,6 +58,8 @@
 The \pkg{fontscale} package has no package options.
 Instead, this package provides the command \cs{fontscalesetup}\marg{key\-/value list} (\S\ref{subsec:fontscalesetup}) which sets the package keys (\S\ref{sec:keys}).
 
+When loaded, this package uses \cs{normalsize} after defining and initializing the font size commands from \cs{tiny} to \cs{Huge}.
+
 Many \LaTeX{} document classes have a font size option (e.g.\@ \Key{10pt}, \Key{11pt}, \Key{12pt}) 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 font size of \cs{normalsize} set by this package.
 
@@ -73,8 +75,6 @@
 Unlike the standard \LaTeX{} document classes, the font size commands from \cs{tiny} to \cs{Huge} defined 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 use hooks, which are documented in the \LaTeXe{} kernel.
 
-When loaded, this package uses \cs{normalsize} after initializing the font size commands from \cs{tiny} to \cs{Huge}.
-
 \subsection{The font size parameters}
 \label{subsec:fontsizeparameters}
 
@@ -180,9 +180,9 @@
 \Key{baselineskip-size-ratio}[\meta{floating point expression}][1.2]
 \KeepNextPar*
 
-Sets the ratio of the font baselineskip to the font size to the result of computing the \meta{floating point expression}.
-The font baselineskip of each font size command equals its font size times this number.
-The value of this key must be at least \num{1}.
+Sets the font baselineskip of each font size command from \cs{tiny} to \cs{Huge} equal to its font size \texttimes{} the result of computing the \meta{floating point expression}.
+Sets the font baselineskip set by \cs{SetFontStep}, \cs{SetFontScale}, and \cs{SetFontSize} (\S\ref{subsec:fontsize}) equal to the new font size \texttimes{} the result of computing the \meta{floating point expression}.
+The font baselineskip must be greater than or equal to the font size.
 
 
 \subsection{Overwriting the previous keys}
@@ -210,7 +210,7 @@
 \KeepNextPar*
 
 Sets the font baselineskip of \meta{font size command} to the value of \meta{skip expression}, appending a default unit of \unit{pt}.
-The font baselineskip of \meta{font size command} must be greater than or equal to its font size.
+The font baselineskip must be greater than or equal to the font size.
 Overwrites the font baselineskip set by the key \Key{baselineskip\-/size\-/ratio}.
 
 \Key{\meta{font size command}}[\meta{dimen expression}]
@@ -234,13 +234,14 @@
 \KeepNextPar*
 
 Sets and processes the \pkg{fontscale} package keys (\S\ref{sec:keys}) in \meta{key\-/value list} and then uses \cs{normalsize}.
-Adding the optional star first resets the keys to their initial values.
+Adding the optional star first resets all the \pkg{fontscale} package keys to their initial values.
+The order of the keys in \meta{key\-/value list} does not matter.
 Can be used mid\-/document.
 The effect is local to the current group.
 Does nothing, except issue a warning, if used in math mode.
 \cs{fontscalesetup} should typically be used only once in the preamble or omitted if the user is satisfied with the initial font sizes and font baselineskips.
 
-\subsection{Expandable font size parameters}
+\subsection{Expandable commands}
 \label{subsec:expandable}
 
 \cs{CurrentFontStep}
@@ -266,6 +267,15 @@
 This means that, if used in \meta{skip}, \cs{CurrentFontStep}, \cs{CurrentFontScale}, and \cs{CurrentFontSize} will expand to the new value\---unless they are first expanded.
 This package provides \cs{SetFontSizeBaselineskip} as an alternative to \cs{fontsize} + \cs{selectfont} that avoids this issue (\S\ref{subsec:fontsize}).
 
+\cs{CurrentFontSizeCommand}
+\KeepNextPar*
+
+Tests if the current font size and current font baselineskip equal the font size and font baselineskip, respectively, of any font size command from \cs{tiny} to \cs{Huge}.
+If so, expands to the name of that font size command.
+This omits the backslash character and leaves only letters with catcode \num{11}.
+If not, expands to nothing.
+This package also provides a similar command \cs{PrintFontSizeCommand} (\S\ref{subsec:debug}), which is not expandable and includes the backslash character.
+
 \subsection{More font size commands}
 \label{subsec:fontsize}
 
@@ -282,10 +292,10 @@
 \listheading{Three exceptions:}
 \begin{itemize}
   \item
-  The font step must equal an integer from \num{-4} to \num{5} unless the value of the key \Key{typographic\-/scale} is \Value{musical}.
+  The font step must equal the font step of any font size command from \cs{tiny} to \cs{Huge} (Table~\ref{table:fontsteps}) unless the value of the key \Key{typographic\-/scale} is \Value{musical}.
   \cs{SetFontStep} will issue an error if the font step is undefined (as explained for \cs{CurrentFontStep} in \S\ref{subsec:expandable}).
   \item
-  If the font step equals the font step of any font size command from \cs{tiny} to \cs{Huge} (Table~\ref{table:fontsteps}), then that font size command will be used directly.
+  If the font step equals the font step of any font size command from \cs{tiny} to \cs{Huge}, then that font size command will be used directly.
   \item
   Does nothing, except issue a warning, if used in math mode.
 \end{itemize}
@@ -353,12 +363,13 @@
 Tests if the current font size and current font baselineskip equal the font size and font baselineskip, respectively, of any font size command from \cs{tiny} to \cs{Huge}.
 If so, prints the name of that font size command, including the backslash character.
 If not, prints \enquote{\string\undefined}.
+This package also provides a similar command \cs{CurrentFontSizeCommand} (\S\ref{subsec:expandable}), which is expandable and omits the backslash character.
 
 
 \section{Programming}
 \label{sec:programming}
 
-This section is for \LaTeX3 programmers.
+This section documents the \pkg{expl3} programming support provided by the \pkg{fontscale} package.
 
 \subsection
   {%

Modified: trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty	2024-08-13 17:34:09 UTC (rev 72023)
+++ trunk/Master/texmf-dist/tex/latex/fontscale/fontscale.sty	2024-08-13 20:04:17 UTC (rev 72024)
@@ -8,8 +8,8 @@
 \NeedsTeXFormat{LaTeX2e}[2023-11-01]
 \ProvidesExplPackage
   {fontscale}
-  {2024-08-02}
-  {2.0.0}
+  {2024-08-12}
+  {2.1.0}
   {A flexible interface for setting font sizes}
 
 % l3kernel version 2023-10-10 added many 'e'-variants.
@@ -117,6 +117,7 @@
 
 % Scratch variables
 \tl_new:N  \l__fontscale_tmp_tl
+\str_new:N \l__fontscale_tmp_str
 \dim_new:N \l__fontscale_tmp_dim
 \fp_new:N  \l__fontscale_tmp_fp
 
@@ -284,7 +285,8 @@
     The~ font~ step~
     \msg_line_context: \c_space_tl
     must~ equal~ an~ integer~ from~ -4~ to~ 5,~
-    unless~ the~ value~ of~ the~ key~ 'typographic-scale'~ is~ 'musical'.
+    unless~ the~ value~ of~ the~ key~ 'typographic-scale'~ is~ 'musical'.~
+    \msg_see_documentation_text:n { fontscale }
   }
 \msg_new:nnn { fontscale } { current-font-step-out-of-bounds }
   {
@@ -940,6 +942,65 @@
   { \__fontscale_baselineskip: }
 \cs_new:Npn \__fontscale_baselineskip: { \f at baselineskip }
 
+\NewExpandableDocumentCommand \CurrentFontSizeCommand { }
+  { \__fontscale_name: }
+\cs_new:Npn \__fontscale_name:
+  {
+    \dim_case:nn { \f at size pt }
+      {
+        { \l_fontscale_tiny_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_tiny_baselineskip_skip }
+            { \f at baselineskip } { tiny }
+        }
+        { \l_fontscale_scriptsize_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_scriptsize_baselineskip_skip }
+            { \f at baselineskip } { scriptsize }
+        }
+        { \l_fontscale_footnotesize_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_footnotesize_baselineskip_skip }
+            { \f at baselineskip } { footnotesize }
+        }
+        { \l_fontscale_small_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_small_baselineskip_skip }
+            { \f at baselineskip } { small }
+        }
+        { \l_fontscale_normalsize_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_normalsize_baselineskip_skip }
+            { \f at baselineskip } { normalsize }
+        }
+        { \l_fontscale_large_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_large_baselineskip_skip }
+            { \f at baselineskip } { large }
+        }
+        { \l_fontscale_Large_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_Large_baselineskip_skip }
+            { \f at baselineskip } { Large }
+        }
+        { \l_fontscale_LARGE_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_LARGE_baselineskip_skip }
+            { \f at baselineskip } { LARGE }
+        }
+        { \l_fontscale_huge_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_huge_baselineskip_skip }
+            { \f at baselineskip } { huge }
+        }
+        { \l_fontscale_Huge_size_dim }
+        {
+          \skip_if_eq:nnT { \l_fontscale_Huge_baselineskip_skip }
+            { \f at baselineskip } { Huge }
+        }
+      }
+  }
+
 \NewDocumentCommand \SetFontStep { s m }
   {
     \mode_if_math:TF
@@ -1204,72 +1265,10 @@
   }
 \cs_new_protected:Npn \__fontscale_print_name:
   {
-    \dim_case:nn { \f at size pt }
-      {
-        { \l_fontscale_tiny_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_tiny_baselineskip_skip }
-            { \token_to_str:N \tiny \prg_break: }
-        }
-        { \l_fontscale_scriptsize_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_scriptsize_baselineskip_skip }
-            { \token_to_str:N \scriptsize \prg_break: }
-        }
-        { \l_fontscale_footnotesize_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_footnotesize_baselineskip_skip }
-            { \token_to_str:N \footnotesize \prg_break: }
-        }
-        { \l_fontscale_small_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_small_baselineskip_skip }
-            { \token_to_str:N \small \prg_break: }
-        }
-        { \l_fontscale_normalsize_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_normalsize_baselineskip_skip }
-            { \token_to_str:N \normalsize \prg_break: }
-        }
-        { \l_fontscale_large_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_large_baselineskip_skip }
-            { \token_to_str:N \large \prg_break: }
-        }
-        { \l_fontscale_Large_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_Large_baselineskip_skip }
-            { \token_to_str:N \Large \prg_break: }
-        }
-        { \l_fontscale_LARGE_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_LARGE_baselineskip_skip }
-            { \token_to_str:N \LARGE \@ \prg_break: }
-        }
-        { \l_fontscale_huge_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_huge_baselineskip_skip }
-            { \token_to_str:N \huge \prg_break: }
-        }
-        { \l_fontscale_Huge_size_dim }
-        {
-          \skip_if_eq:nnT { \f at baselineskip }
-            { \l_fontscale_Huge_baselineskip_skip }
-            { \token_to_str:N \Huge \prg_break: }
-        }
-      }
-    \token_to_str:N \undefined
-    \prg_break:
-    \prg_break_point:
+    \str_set:Ne \l__fontscale_tmp_str { \__fontscale_name: }
+    \str_if_empty:NTF \l__fontscale_tmp_str
+      { \token_to_str:N \undefined }
+      { \c_backslash_str \l__fontscale_tmp_str \@ }
   }
 
 % TEXT PURIFY



More information about the tex-live-commits mailing list.