texlive[71811] Master/texmf-dist: passopt (15jul24)
commits+karl at tug.org
commits+karl at tug.org
Mon Jul 15 23:37:38 CEST 2024
Revision: 71811
https://tug.org/svn/texlive?view=revision&revision=71811
Author: karl
Date: 2024-07-15 23:37:37 +0200 (Mon, 15 Jul 2024)
Log Message:
-----------
passopt (15jul24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/passopt/README.md
trunk/Master/texmf-dist/doc/latex/passopt/passopt.pdf
trunk/Master/texmf-dist/doc/latex/passopt/passopt.tex
trunk/Master/texmf-dist/tex/latex/passopt/passopt.sty
Modified: trunk/Master/texmf-dist/doc/latex/passopt/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/passopt/README.md 2024-07-15 21:37:23 UTC (rev 71810)
+++ trunk/Master/texmf-dist/doc/latex/passopt/README.md 2024-07-15 21:37:37 UTC (rev 71811)
@@ -1,5 +1,5 @@
# The `passopt` package
-Passing options to packages or classes (v1.00b)
+Passing options to packages or classes (v1.01)
## Abstract
`passopt` allow reset the global options of a loaded macro package or document class, or to change the position of the pre-passed options in the list to the right.
@@ -11,5 +11,8 @@
| [Gitee](https://gitee.com/texno3/passopt) | [Github](https://github.com/texno3/passopt) | [CTAN](https://ctan.org/pkg/passopt) |
## Maintainer
-QuYi<br/>
-Email: toquyi at 163.com
\ No newline at end of file
+Qu Yi<br/>
+Email: toquyi at 163.com
+
+## Contributor
+Jonathan P. Spratte
\ No newline at end of file
Modified: trunk/Master/texmf-dist/doc/latex/passopt/passopt.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/passopt/passopt.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/passopt/passopt.tex 2024-07-15 21:37:23 UTC (rev 71810)
+++ trunk/Master/texmf-dist/doc/latex/passopt/passopt.tex 2024-07-15 21:37:37 UTC (rev 71811)
@@ -5,8 +5,8 @@
\setcnltx
{
package = passopt,
- version = v1.00b,
- date = 2024/07/11,
+ version = v1.01,
+ date = 2024/07/15,
authors = Qu Yi,
info = Passing options to packages or classes,
email = toquyi at 163.com,
@@ -42,6 +42,7 @@
\setlist{nosep,topsep = \smallskipamount}
\setlist[description,1]{leftmargin = \parindent}
\setlist[itemize,1]{leftmargin = *}
+\deffootnote{2em}{1em}{\llap{\color{red}\thefootnotemark.\space}}
\makeatother
\begin{document}
@@ -59,6 +60,7 @@
In the example above, the list of options that the \pkg*{mypackage} macro package ends up executing is \fbox{\code{opt1,opt2=A,opt3}}. If you wish to \textcolor{red}{disable} the pre-enabled options or place the newly enabled options to the \textcolor{red}{right} of the list (last executed), then you need to modify the code of the load command in the package or class file, but this is not recommended for public sharing. Therefore, this macro package provides commands to reset the options and change the order of the new options.
\section{User commands}
+Four commands are provided to set the options to be passed later, all of which are \textcolor{red}{locally} assigned.
\begin{commands}
\command{SetOptionsToPackage}[\sarg\marg{options list}\marg{package}]
Passes options to the macro package, the location of the passed options is to the right of the options used when loading the macro package. If an asterisk parameter is used, only the passed options were ultimately retained.
@@ -87,7 +89,16 @@
Similar to the previous command, but passing options for the document class.
\end{commands}
+\section{Acknowledgment}
+Thanks Jonathan P. Spratte for the improvement suggestions.
+
\appendix
+\begin{changelog}[simple]
+ \begin{version}[v = 1.01,date = 2024/07/15]
+ \item Synchronization modifier for lists of \code{@raw at opt@} and \code{opt@}.
+ \item Options that are set are expanded once rather than fully expanded.
+ \end{version}
+\end{changelog}
\nocite{*}
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/passopt/passopt.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/passopt/passopt.sty 2024-07-15 21:37:23 UTC (rev 71810)
+++ trunk/Master/texmf-dist/tex/latex/passopt/passopt.sty 2024-07-15 21:37:37 UTC (rev 71811)
@@ -8,53 +8,49 @@
% The latest version of this license is in
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2021/11/15]
-\ProvidesExplPackage{passopt}{2024/07/11}{1.00b}
+\ProvidesExplPackage{passopt}{2024/07/15}{1.01}
{Passing options to packages or classes}
-\cs_generate_variant:Nn \tl_if_blank:nF { v }
-\cs_new:Npn \po_save_option_list:n #1 { #1 }
-\cs_new:Npn \po_add_before_hook:nnn #1#2
- { \AddToHook{#1/#2/before}[passopt] }
-\NewDocumentCommand{\SetOptionsToPackage}{smm}
+\cs_generate_variant:Nn \tl_if_blank:nTF { v }
+\cs_new_protected:Npn \po_add_before_hook:nnn #1#2
+ { \hook_gput_code:nnn { #1/#2/before } { passopt } }
+\cs_new_protected:Npn \po_set_options_list:nnnnn #1#2#3#4#5
{
- \po_add_before_hook:nnn { package } {#3}
+ \po_add_before_hook:nnn {#1} {#5}
{
- \cs_gset:cpx { @raw at opt@#3.sty }
+ \cs_set:cpx { @raw at opt@#5.#2 }
{
- \IfBooleanF{#1}
+ \IfBooleanTF{#3}
+ {\exp_not:o {#4}}
{
- \tl_if_blank:vF { opt@#3.sty }
- { \use:c { opt@#3.sty }, }
+ \tl_if_blank:vTF { @raw at opt@#5.#2 }
+ { \exp_not:o {#4} }
+ { \exp_not:v { @raw at opt@#5.#2 },\exp_not:o {#4} }
}
- \po_save_option_list:n {#2}
}
+ \exp_args:Nc \protected at edef { opt@#5.#2 }
+ {
+ \exp_last_unbraced:Nv
+ \zap at space { @raw at opt@#5.#2 }~\@empty
+ }
}
}
-\NewDocumentCommand{\SetOptionsToClass}{smm}
+\cs_new_protected:Npn \po_clear_options_list:nnn #1#2#3
{
- \po_add_before_hook:nnn { class } {#3}
+ \po_add_before_hook:nnn {#1} {#3}
{
- \cs_gset:cpx { @raw at opt@#3.cls }
- {
- \IfBooleanF{#1}
- {
- \tl_if_blank:vF { opt@#3.cls }
- { \use:c { opt@#3.cls }, }
- }
- \po_save_option_list:n {#2}
- }
+ \tl_clear:c { @raw at opt@#3.#2 }
+ \tl_clear:c { opt@#3.#2 }
}
}
+\NewDocumentCommand{\SetOptionsToPackage}{smm}
+ {\po_set_options_list:nnnnn { package } { sty } {#1} {#2} {#3}}
+\NewDocumentCommand{\SetOptionsToClass}{smm}
+ {\po_set_options_list:nnnnn { class } { cls } {#1} {#2} {#3}}
\cs_new_protected:Npn \ClearPackageOptions #1
- {
- \po_add_before_hook:nnn { package } {#1}
- { \tl_clear:c { opt@#1.sty } }
- }
+ { \po_clear_options_list:nnn { package } { sty } {#1} }
\cs_new_protected:Npn \ClearClassOptions #1
- {
- \po_add_before_hook:nnn { class } {#1}
- { \tl_clear:c { opt@#1.cls } }
- }
+ { \po_clear_options_list:nnn { class } { cls } {#1} }
\endinput
%
% End of file `passopt.sty'.
\ No newline at end of file
More information about the tex-live-commits
mailing list.