texlive[72852] Master/texmf-dist: setspaceenhanced (14nov24)
commits+karl at tug.org
commits+karl at tug.org
Thu Nov 14 21:42:30 CET 2024
Revision: 72852
https://tug.org/svn/texlive?view=revision&revision=72852
Author: karl
Date: 2024-11-14 21:42:30 +0100 (Thu, 14 Nov 2024)
Log Message:
-----------
setspaceenhanced (14nov24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/setspaceenhanced/README.md
trunk/Master/texmf-dist/doc/latex/setspaceenhanced/setspaceenhanced.pdf
trunk/Master/texmf-dist/source/latex/setspaceenhanced/setspaceenhanced.dtx
trunk/Master/texmf-dist/tex/latex/setspaceenhanced/setspaceenhanced.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/setspaceenhanced/announcement.txt
Modified: trunk/Master/texmf-dist/doc/latex/setspaceenhanced/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/setspaceenhanced/README.md 2024-11-14 20:42:15 UTC (rev 72851)
+++ trunk/Master/texmf-dist/doc/latex/setspaceenhanced/README.md 2024-11-14 20:42:30 UTC (rev 72852)
@@ -2,7 +2,7 @@
Copyright © 2008–2024 Markus Kohm
-Release: 2024-11-05 v1.03
+Release: 2024-11-12 v1.04
License: LPPL 1.3c
Added: trunk/Master/texmf-dist/doc/latex/setspaceenhanced/announcement.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/setspaceenhanced/announcement.txt (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/setspaceenhanced/announcement.txt 2024-11-14 20:42:30 UTC (rev 72852)
@@ -0,0 +1,13 @@
+setspaceenhanced is based on the setspace package whose functionality
+it extends and improves. Changes in version 1.04 are:
+
+
+- Fixed an initialization error when using option byselectfont → Issue #3.
+
+
+- Implementation of the little-known setspace option nodispayskipstretch
+ for compatibility reasons → Issue #4.
+
+
+- Automatic adoption of the options of a previously loaded setspace for
+ the initialization of own options.
Property changes on: trunk/Master/texmf-dist/doc/latex/setspaceenhanced/announcement.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/setspaceenhanced/setspaceenhanced.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/setspaceenhanced/setspaceenhanced.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/setspaceenhanced/setspaceenhanced.dtx 2024-11-14 20:42:15 UTC (rev 72851)
+++ trunk/Master/texmf-dist/source/latex/setspaceenhanced/setspaceenhanced.dtx 2024-11-14 20:42:30 UTC (rev 72852)
@@ -32,7 +32,7 @@
%</dtx>
%<*dtx|package>
%<package>\ProvidesExplPackage{setspaceenhanced}
- {2024-11-05}{1.03}
+ {2024-11-12}{1.04}
{%
%<*dtx>
sources and unpack driver of
@@ -284,8 +284,8 @@
\end{verbatim}
If you want you can alternatively also load both packages explicitly, either
-\pkg{setspace} before \pkg{setspaceenhanced} or---if you
-want---\pkg{setspaceenhanced} before \pkg{setspace}. In this case, you should
+\pkg{setspace} before \pkg*{setspaceenhanced} or---if you
+want---\pkg*{setspaceenhanced} before \pkg{setspace}. In this case, you should
use the same options for both package.
This is also useful, if you use a package, that uses \pkg{setspace} itself. In
@@ -314,6 +314,40 @@
same optional argument for \cs{RequirePackage}, that is used for loading
\pkg{setspace}.
+\leavevmode\marginpar{\raggedleft\footnotesize\textcolor{black}{(added 2024-11-12)}}%
+Note: If package \pkg{setspace} has been loaded \emph{before} package
+\pkg*{setspaceenhanced}, \pkg*{setspaceenhanced} uses the options to
+package \pkg{setspace} for the initialization. But you can overwrite the
+initialization by loading \pkg*{setspaceenhancded} with options or passing
+options to \pkg*{setspaceenhanced}. On the other hand, package \pkg{setspace}
+\emph{should never} be loaded with options after loading
+\pkg*{setspaceenhanced}. So
+\begin{verbatim}
+ \usepackage[doublespacing]{setspace}
+ \usepackage{setspaceenhanced}
+\end{verbatim}
+would be the same like
+\begin{verbatim}
+ \usepackage{setspace}
+ \usepackage[doublespacing]{setspaceenhanced}
+\end{verbatim}
+or like
+\begin{verbatim}
+ \usepackage[doublespacing]{setspaceenhanced}
+ \usepackage{setspace}
+\end{verbatim}
+or like
+\begin{verbatim}
+ \usepackage[doublespacing]{setspaceenhanced}
+\end{verbatim}
+But
+\begin{verbatim}
+ \usepackage{setspaceenhanced}
+ \usepackage[doublespacing]{setspace}
+\end{verbatim}
+would fail with an option clash error, because \pkg*{setspaceenhanced} already
+loaded \pkg{setspace} without options.
+
Package \pkg*{setspaceenhanced} provides all options and commands of the user
interface of \pkg{setspace}, see \autocite{pkg:setspace:manual}. Following we
document only the differences and enhancements.
@@ -355,6 +389,14 @@
my opinion using a baselineskip less than the font size never makes
sense. But \LaTeX{} itself uses baselineskip 0 inside the definition of
\cs{LaTeX}.}
+
+ Please note:\marginpar{\raggedleft\raisebox{\dimexpr\ht\strutbox-\height\relax}{\Huge\textcolor{red}{!}}}
+ The capabilities of this option are unfortunately limited.
+ Among other things, it is dependent on the internal function of
+ \cs{selectfont}. It can therefore lead to undesirable effects in some cases.
+ In this case, you should disable the option either locally or globally
+ via |\spacesetup{byselectfont=false}| or directly when loading
+ \pkg*{setspaceenhanced}.
\item[doublespacing=\meta{real}]%
\DescribeOption{onehalfspacing}%
\hfill initial=\texttt{nan}, default=\emph{empty}\\
@@ -406,6 +448,11 @@
would activate the calculation of the factor depending on the font size and
the baseline skip set for the font size. It is recommended to use the option
always without value!
+\item[nodispayskipstretch]%
+ \DescribeOption{nodisplayskipstretch}%
+ \marginpar{\raggedleft\footnotesize (added 2024-11-12)}%
+ Same as with \pkg{setspace}. The option turns off the stretching of the
+ space before and after displays using |\setdisplayskipstretch{1.0}|.
\end{description}
\subsubsection*{Compatibility Notes:}
@@ -447,7 +494,7 @@
because this would need a baseline skip of 18\,pt. So what is it? It is using
the stretch factor of 12\,pt for the 10.95\,pt of \cs{small}.
-With \pkg{setspaceenhanced}:
+With \pkg*{setspaceenhanced}:
\begin{verbatim}
\documentclass[12pt]{article}
\usepackage{setspaceenhanced}
@@ -684,25 +731,54 @@
% \changes{v1.01}{2023/09/19}{option \opt{fontsize} renamed to
% \opt{keepfontsize} because of incompatibility (issue
% \href{https://github.com/komascript/third-party-enhancements/issues/1}
-% {\#1})}
+% {\#1})%
+% }
+% \changes{v1.04}{2024/11/12}{changed order for correct initialization before
+% executing code}
+% \changes{v1.04}{2024/11/12}{initialize \opt{singlespacing} (issue
+% \href{https://github.com/komascript/third-party-enhancements/issues/3}
+% {\#3})%
+% }
+% \changes{v1.04}{2024/11/12}{options \opt{displayskipstretch} and
+% \opt{nodisplayskipstretch} added%
+% }
% \begin{macrocode}
\DeclareKeys{%
+ byselectfont .bool_set:N = \g_@@_byselectfont_bool,
+ byselectfont .default:n = true,
+ byselectfont .initial:n = false,
+ byselectfont .usage = general,
+ keepfontsize .bool_set:N = \g_@@_fontsize_bool,
+ keepfontsize .default:n = true,
+ keepfontsize .initial:n = false,
+ keepfontsize .usage = general,
singlespacing .code = \@@_set_spacing:nn {#1} {single},
singlespacing .usage = general,
+ singlespacing .initial:n = ,
onehalfspacing .code = \@@_set_spacing:nn {#1} {onehalf},
onehalfspacing .usage = general,
doublespacing .code = \@@_set_spacing:nn {#1} {double},
doublespacing .usage = general,
- byselectfont .bool_set:N = \g_@@_byselectfont_bool,
- byselectfont .default:n = true,
- byselectfont .initial:n = false,
- keepfontsize .bool_set:N = \g_@@_fontsize_bool,
- keepfontsize .default:n = true,
- keepfontsize .initial:n = false,
+ nodisplayskipstretch .code = \setdisplayskipstretch{1.0},
+ nodisplayskipstretch .usage = general,
}
% \end{macrocode}
-% And process them:
+% \changes{v1.04}{2024/11/12}{extended initialization by \pkg{setspace}
+% options
+% }
+% Now, test for the options used by \pkg{setspace} and use them also for
+% the initialization of the keys above. We do it option by option instead
+% of processing all \pkg{setspace} options, because we want to process only
+% those options \pkg*{setspaceenhanced} also knows.
% \begin{macrocode}
+\clist_map_inline:nn
+ { nodisplayskipstretch, singlespacing, onehalfspacing, doublespacing }
+ {
+ \@ifpackagewith {setspace} {#1} {\SetKeys{#1}} { }
+ }
+% \end{macrocode}
+% Last but not least process the package options:
+% \begin{macrocode}
\ProcessKeyOptions\relax
% \end{macrocode}
%
Modified: trunk/Master/texmf-dist/tex/latex/setspaceenhanced/setspaceenhanced.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/setspaceenhanced/setspaceenhanced.sty 2024-11-14 20:42:15 UTC (rev 72851)
+++ trunk/Master/texmf-dist/tex/latex/setspaceenhanced/setspaceenhanced.sty 2024-11-14 20:42:30 UTC (rev 72852)
@@ -21,7 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\ProvidesExplPackage{setspaceenhanced}
- {2024-11-05}{1.03}
+ {2024-11-12}{1.04}
{%
improved setspace package%
}
@@ -111,19 +111,29 @@
}
}
\DeclareKeys{%
+ byselectfont .bool_set:N = \g__setspaceenhanced_byselectfont_bool,
+ byselectfont .default:n = true,
+ byselectfont .initial:n = false,
+ byselectfont .usage = general,
+ keepfontsize .bool_set:N = \g__setspaceenhanced_fontsize_bool,
+ keepfontsize .default:n = true,
+ keepfontsize .initial:n = false,
+ keepfontsize .usage = general,
singlespacing .code = \__setspaceenhanced_set_spacing:nn {#1} {single},
singlespacing .usage = general,
+ singlespacing .initial:n = ,
onehalfspacing .code = \__setspaceenhanced_set_spacing:nn {#1} {onehalf},
onehalfspacing .usage = general,
doublespacing .code = \__setspaceenhanced_set_spacing:nn {#1} {double},
doublespacing .usage = general,
- byselectfont .bool_set:N = \g__setspaceenhanced_byselectfont_bool,
- byselectfont .default:n = true,
- byselectfont .initial:n = false,
- keepfontsize .bool_set:N = \g__setspaceenhanced_fontsize_bool,
- keepfontsize .default:n = true,
- keepfontsize .initial:n = false,
+ nodisplayskipstretch .code = \setdisplayskipstretch{1.0},
+ nodisplayskipstretch .usage = general,
}
+\clist_map_inline:nn
+ { nodisplayskipstretch, singlespacing, onehalfspacing, doublespacing }
+ {
+ \@ifpackagewith {setspace} {#1} {\SetKeys{#1}} { }
+ }
\ProcessKeyOptions\relax
\renewcommand*{\singlespacing}{
\__setspaceenhanced_set_spacing:nn {} {single}
More information about the tex-live-commits
mailing list.