texlive[75012] Master/texmf-dist: scontents (24apr25)
commits+karl at tug.org
commits+karl at tug.org
Thu Apr 24 22:25:52 CEST 2025
Revision: 75012
https://tug.org/svn/texlive?view=revision&revision=75012
Author: karl
Date: 2025-04-24 22:25:51 +0200 (Thu, 24 Apr 2025)
Log Message:
-----------
scontents (24apr25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/scontents/README.md
trunk/Master/texmf-dist/doc/latex/scontents/scontents.pdf
trunk/Master/texmf-dist/source/latex/scontents/scontents.dtx
trunk/Master/texmf-dist/source/latex/scontents/scontents.ins
trunk/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv
trunk/Master/texmf-dist/tex/generic/scontents/scontents-code.tex
trunk/Master/texmf-dist/tex/generic/scontents/scontents.tex
trunk/Master/texmf-dist/tex/latex/scontents/scontents.sty
Modified: trunk/Master/texmf-dist/doc/latex/scontents/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/scontents/README.md 2025-04-23 23:44:15 UTC (rev 75011)
+++ trunk/Master/texmf-dist/doc/latex/scontents/README.md 2025-04-24 20:25:51 UTC (rev 75012)
@@ -1,6 +1,6 @@
## scontents — Stores LaTeX contents in memory or files
-Release v2.2 \[2025-03-26\]
+Release v2.3 \[2025-04-23\]
## Description
@@ -11,9 +11,7 @@
## Requirements
-The package loads and depends on updated versions of:
-- [expl3](https://ctan.org/pkg/expl3)
-- [latex-base](https://www.ctan.org/pkg/latex-base)
+The package need a minimun `LaTeX` release 2024-11-01.
## Installation
Modified: trunk/Master/texmf-dist/doc/latex/scontents/scontents.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/scontents/scontents.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/scontents/scontents.dtx 2025-04-23 23:44:15 UTC (rev 75011)
+++ trunk/Master/texmf-dist/source/latex/scontents/scontents.dtx 2025-04-24 20:25:51 UTC (rev 75012)
@@ -458,7 +458,7 @@
keywordstyle = [4]{\color{pkgcolor}},%
keywords = [4]{scontents,Scontents,getstored,typestored,verbatimsc, mergesc, %
endverbatimsc,countsc,meaningsc,foreachsc,macros,newenvsc,
- endscontents,startscontents,stopscontents,scontents.tex},%
+ endverbatim, endscontents,startscontents,stopscontents,scontents.tex},%
% Reserved words 5 (in red)
keywordstyle = [5]{\color{red}},%
keywords = [5]{makeatletter,makeatother,let,verb, at undefined,makebox,def,%
@@ -655,10 +655,6 @@
%
% \tableofcontents
%
-% \begin{important}
-% The next update removes compatibility with versions prior to 2024.
-% \end{important}
-%
% \setlength{\parskip}{3pt}
%
% \section{Description of the package}
@@ -703,6 +699,12 @@
% \item \href{https://tex.stackexchange.com/q/373647/7832}{Collect contents of an environment (that contains verbatim content)}
% \end{enumerate}
%
+% \begin{important}*
+% Starting with version 2.3 the \mypkg*{scontents} package is fully
+% compatible with \emph{tagged} \texttt{PDF} and will have \LaTeX{}
+% release 2024-11-01 (\TeX{} Live 2024) as a minimum requirement.
+% \end{important}
+%
% \thispagestyle{plain}
% \newpage
% \pagestyle{myheader}
@@ -717,7 +719,7 @@
%
% The The \mypkg*{scontents} package is written (mostly) using
% \mypkg{expl3}, it requires an updated version of \LaTeX{} to work
-% (minimum version 2022-06-01). This package can be used with "plain",
+% (minimum required to \LaTeX{} release 2024-11-01). This package can be used with "plain",
% "context", "xelatex", "lualatex", "pdflatex" and the classical workflow
% §latex>dvips>ps2pdf§.
%
@@ -1327,7 +1329,8 @@
% One consideration to keep in mind is that this is a \enquote{\emph{representation}}
% of the \mymeta{stored content} in a \enquote{\emph{verbatim}} environment.
%
-% The \myenv*{verbatimsc} environment can be customized in the
+% The internal \myenv*{verbatimsc} environment is compatible with
+% \emph{tagged} \texttt{PDF} and can be customized in the
% following ways after loading the \mypkg*{scontents} package:
%
% Using the package \mypkg{fancyvrb}:
@@ -1387,6 +1390,12 @@
%</example>
% \fi
%
+% \begin{important}*
+% At the moment, the \mypkg{fancyhdr}, \mypkg{listings}, and
+% \mypkg{minted} packages are not compatible with \emph{tagged}
+% \texttt{PDF}.
+% \end{important}
+%
% \section{Other commands provided}
%
% \subsection{The command \cs{meaningsc}}
@@ -2043,9 +2052,41 @@
%</example>
% \fi
% The command §\mergesc§ in action, adapted from Denis Bitouzé request at \url{https://github.com/pablgonz/scontents/issues/2}
-% \textattachfile[color=linkcolor,print=false]{scexamp9.ltx}{\faFile*[regular]}.
+% \textattachfile[color=linkcolor,print=false]{scexamp10.ltx}{\faFile*[regular]}.
% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp10.ltx}
%
+% \subsection{The tagged PDF example}
+%
+% \iffalse
+%<*example>
+% \fi
+\begin{scontents}[write-out=scexamp11.ltx]
+% arara: lualatex
+% arara: clean: { extensions: [ aux, log] }
+\DocumentMetadata{lang = en-US, pdfversion = 2.0, pdfstandard = ua-2,testphase=latest}
+\documentclass{article}
+\usepackage{scontents,unicode-math,hyperref}
+\hypersetup{pdftitle = {Test scontents package},}
+\begin{document}
+% environment
+\begin{scontents}[print-env=true]
+ First code \verb|\foo|
+
+ And more code \verb|\baz|
+\end{scontents}
+
+% \typestored
+\typestored[1]{contents}
+\end{document}
+\end{scontents}
+% \iffalse
+%</example>
+% \fi
+%
+% A verification test for the §\typestored§ command and the §verbatimsc§ environment compatible with \emph{tagged} \texttt{PDF}
+% \textattachfile[color=linkcolor,print=false]{scexamp11.ltx}{\faFile*[regular]}.
+% \lstinputlisting[language=scontents-doc,numbers=left]{scexamp11.ltx}
+%
% \newpage
%
% \section{Change history}
@@ -2064,6 +2105,12 @@
% \begin{description}[font=\small\sffamily,wide=0pt,style=multiline,leftmargin=\descrwidth,nosep,noitemsep]
% \item [\fileversion{} (ctan), \filedate]
% \begin{itemize}
+% \item Adapting the |verbatimsc| environment for \emph{tagged} \texttt{PDF}.
+% \item Update minimum required to \LaTeX{} release 2024-11-01.
+% \item Safer code for replacement |\obeyedline|.
+% \end{itemize}
+% \item [v2.2 (ctan), 2025-03-26]
+% \begin{itemize}
% \item Fix internal definition for some functions.
% \item Replace |\peek_charcode_ignore_spaces:NTF| by |\peek_charcode:NTF|.
% \item Set correct code for |\obeyedline| implement in \LaTeX{} release 2024-06-01.
@@ -2223,27 +2270,22 @@
%
% Now we define some common macros to hold the package date and version:
% \begin{macrocode}
-%<loader>\def\ScontentsFileDate{2025-03-26}%
-%<core>\def\ScontentsCoreFileDate{2025-03-26}%
+%<loader>\def\ScontentsFileDate{2025-04-23}%
+%<core>\def\ScontentsCoreFileDate{2025-04-23}%
%<*loader>
-\def\ScontentsFileVersion{2.2}%
+\def\ScontentsFileVersion{2.3}%
\def\ScontentsFileDescription{Stores LaTeX contents in memory or files}%
% \end{macrocode}
%
-% The \LaTeX{} loader is fairly simple: just load the dependencies, load the
-% core code, and then set interfaces up.
+% The \LaTeX{} loader is quite simple, we just need to make sure of the
+% minimum version for correct operation and then set interfaces up.
+% The choice of \LaTeX{} release 2024-11-01 is the latest available in
+% \TeX{} Live 2024 (frozen) and is necessary to be able to implement
+% the package's full compatibility with \emph{tagged} \texttt{PDF}.
%
% \begin{macrocode}
%<*latex>
-\IfFormatAtLeastTF { 2022-06-01 }
- { }
- {
- \RequirePackage{l3keys2e}[2020/02/08]
- \PackageWarning { scontents }
- {
- The next update removes compatibility with versions prior to 2024.
- }
- }
+\NeedsTeXFormat{LaTeX2e}[2024-11-01]
\ProvidesExplPackage
{scontents} {\ScontentsFileDate} {\ScontentsFileVersion} {\ScontentsFileDescription}
%</latex>
@@ -2261,9 +2303,9 @@
%<context>\unprotect
\input expl3-generic.tex
\ExplSyntaxOn
-\tl_gset:cx { ver @ scontents . sty } { \ScontentsFileDate\space
+\tl_gset:ce { ver @ scontents . sty } { \ScontentsFileDate\space
v\ScontentsFileVersion\space \ScontentsFileDescription }
-\iow_log:x { Package: ~ scontents ~ \use:c { ver @ scontents . sty } }
+\iow_log:e { Package: ~ scontents ~ \use:c { ver @ scontents . sty } }
%</!latex>
% \end{macrocode}
%
@@ -2314,7 +2356,7 @@
%
% \begin{macrocode}
\tl_new:N \l_@@_env_name_tl
-\tl_const:Nx \c_@@_end_env_tl
+\tl_const:Ne \c_@@_end_env_tl
{
\c_backslash_str
%<latex|plain> end
@@ -2474,16 +2516,11 @@
%<plain|context> { verb-font .initial:n = \tt }
% \end{macrocode}
%
-% In \LaTeX{} mode we load \mypkg{l3keys2e} process the \mymeta{keys}
-% as options passed on to the package, the package \pkg{l3keys2e} will
-% verify the \mymeta{keys} and will return an error when they are
+% In \LaTeX{} mode process the \mymeta{keys} as options passed on to the
+% package and will return an error when they are.
% \begin{macrocode}
%<*latex>
-\IfFormatAtLeastTF { 2022-06-01 }
- {
- \ProcessKeyOptions [ scontents ]
- }
- { \ProcessKeysOptions { scontents } }
+\ProcessKeyOptions [ scontents ]
%</latex>
%<*core>
% \end{macrocode}
@@ -2584,7 +2621,7 @@
% in |seq| when the key §force-eol§ is false.
%
% \begin{macrocode}
-\str_const:Nx \c_@@_hidden_space_str
+\str_const:Ne \c_@@_hidden_space_str
{ \c_percent_str \c_circumflex_str \c_circumflex_str A scheol \c_percent_str }
% \end{macrocode}
% \end{macro}
@@ -2649,19 +2686,14 @@
% Control sequences to replace tab (§^^I§) and form feed (§^^L§) characters.
%
% \begin{macrocode}
-\cs_new:Npx \@@_tab: { \c_space_tl }
+\cs_new:Npe \@@_tab: { \c_space_tl }
\cs_new:Npn \@@_par: { ^^J ^^J }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\tl_remove_once:NV,\tl_replace_all:Nxx,
-% \tl_replace_all:Nxn,\tl_replace_all:Nnx,\tl_if_empty:fTF}
-% Some nonstandard kernel variants.
-%
+% \begin{macro}[int]{\tl_if_empty:fTF}
+% Some nonstandard kernel variant.
% \begin{macrocode}
-\cs_generate_variant:Nn \tl_remove_once:Nn { NV }
-\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx, Nxx, Nnx }
-\cs_generate_variant:Nn \msg_error:nnnn { nnx }
\prg_generate_conditional_variant:Nnn \tl_if_empty:n { f } { p, TF }
% \end{macrocode}
% \end{macro}
@@ -2910,7 +2942,7 @@
\@@_tl_if_head_is_q_mark:nTF {#2}
{
\tl_if_empty:fTF { \int_to_roman:n { -0 #1 } }
- { \seq_put_right:Nx \l_@@_seq_item_seq { \int_eval:n {#1} } }
+ { \seq_put_right:Ne \l_@@_seq_item_seq { \int_eval:n {#1} } }
{ #3 {#1} }
}
{
@@ -2999,7 +3031,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_lastfrom_seq:n #1
{
- \tl_gset:Nx \g_@@_temp_tl { \seq_item:cn { g_@@_name_#1_seq } {-1} }
+ \tl_gset:Ne \g_@@_temp_tl { \seq_item:cn { g_@@_name_#1_seq } {-1} }
\group_insert_after:N \@@_rescan_tokens:V
\group_insert_after:N \g_@@_temp_tl
\group_insert_after:N \tl_gclear:N
@@ -3465,7 +3497,7 @@
\cs_new_protected:Npn \@@_analyse_nesting_generic:nn #1 #2
{
\@@_define_generic_nesting_function:n {#1}
- \use:x
+ \use:e
{
\exp_not:N \@@_analyse_nesting_generic:w #2
\c_backslash_str #1 \tl_use:N \l_@@_env_name_tl
@@ -3506,7 +3538,7 @@
\bool_if:NT \l_@@_storing_bool
{
\bool_if:NF \l_@@_forced_eol_bool
- { \tl_put_right:Nx #1 { \c_@@_hidden_space_str } }
+ { \tl_put_right:Ne #1 { \c_@@_hidden_space_str } }
\@@_store_to_seq:NN #1 #2
\bool_if:NT #3 { \@@_lastfrom_seq:V #2 }
}
@@ -3515,7 +3547,7 @@
% \end{macrocode}
% \end{macro}
%
-% \subsection{The environment \env{verbatimsc}}
+% \subsection{Code for plain \TeX{} off \texttt{verbatimsc}}
%
% \begin{macro}[int]{\verbatimsc,\endverbatimsc,\@@_verbatimsc_aux:,
% \@@_vobeyspaces:,\@@_xverb:,\@@_nolig_list:,\@@_xobeysp:}
@@ -3698,9 +3730,11 @@
% \@@_file_write_cmd:VV,
% }
%
-% The function \cs{@@_verb_arg_internal:n} replace all §\^^M§ and
+% The function \cs{@@_verb_arg_internal:n} replace all §\^^M§ and
% §\obeyedline§ added by §+v§ argument added in \hologo{LaTeX} release 2024-06-01 by
-% §\^^J§ then adds it to the |seq| variable.
+% §\^^J§ then adds it to the |seq| variable. Here we will apply §\RenewDocumentCommand§
+% since §\obeyedline§ can be modified by the user and if so the code
+% would return a low-level error.
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_verb_arg_internal:n #1
@@ -3708,9 +3742,10 @@
\tl_set:Nn \l_@@_temp_tl {#1}
\cs_if_exist:NT \obeyedline
{
- \tl_replace_all:Nxx \l_@@_temp_tl { \obeyedline } { \iow_char:N \^^M }
+ \RenewDocumentCommand \obeyedline { } { \iow_char:N \^^M }
+ \tl_replace_all:Nee \l_@@_temp_tl { \obeyedline } { \iow_char:N \^^M }
}
- \tl_replace_all:Nxx \l_@@_temp_tl { \iow_char:N \^^M } { \iow_char:N \^^J }
+ \tl_replace_all:Nee \l_@@_temp_tl { \iow_char:N \^^M } { \iow_char:N \^^J }
\@@_Scontents_finish:
}
\cs_new_protected:Npn \@@_Scontents_finish:
@@ -3744,16 +3779,16 @@
{
\bool_if:NTF \l_@@_overwrite_bool
{
- \msg_warning:nnx { scontents } { overwrite-file } {#1}
+ \msg_warning:nne { scontents } { overwrite-file } {#1}
\prg_return_true:
}
{
- \msg_warning:nnx { scontents } { not-writing } {#1}
+ \msg_warning:nne { scontents } { not-writing } {#1}
\prg_return_false:
}
}
{
- \msg_warning:nnx { scontents } { writing-file } {#1}
+ \msg_warning:nne { scontents } { writing-file } {#1}
\prg_return_true:
}
}
@@ -3785,6 +3820,7 @@
\@@_getfrom_seq:nn {#1} {#2}
}
}
+%</core>
% \end{macrocode}
% \end{macro}
%
@@ -3794,7 +3830,6 @@
% User command §\foreachsc§ to loop over \mymeta{stored content} in |seq|.
%
% \begin{macrocode}
-%</core>
%<*loader>
\NewDocumentCommand \foreachsc { o m }
{ \@@_foreachsc_internal:nn {#1} {#2} }
@@ -3816,7 +3851,7 @@
{ \l_@@_foreach_step_int }
{ \l_@@_foreach_stop_int }
\@@_foreach_add_body:n
- \tl_gset:Nx \g_@@_temp_tl
+ \tl_gset:Ne \g_@@_temp_tl
{
\exp_args:NNV \seq_use:Nn
\l_@@_foreach_print_seq \l_@@_foreach_sep_tl
@@ -3828,7 +3863,7 @@
}
\cs_new_protected:Npn \@@_foreach_add_body:n #1
{
- \seq_put_right:Nx \l_@@_foreach_print_seq
+ \seq_put_right:Ne \l_@@_foreach_print_seq
{
\bool_if:NT \l_@@_foreach_before_bool
{ \exp_not:V \l_@@_foreach_before_tl }
@@ -3840,6 +3875,7 @@
{ \exp_not:V \l_@@_foreach_after_tl }
}
}
+%</core>
% \end{macrocode}
% \end{macro}
%
@@ -3851,7 +3887,6 @@
% to the log file, and then calls \cs{@@_verb_print:N}.
%
% \begin{macrocode}
-%</core>
%<*loader>
\NewDocumentCommand \typestored { o m }
{ \@@_typestored_internal:nn {#1} {#2} }
@@ -3862,11 +3897,11 @@
\@@_bsphack:
\group_begin:
\seq_clear:N \l_@@_seq_item_seq
- \str_set:Nx \l_@@_cur_seq_name_str {#2}
+ \str_set:Ne \l_@@_cur_seq_name_str {#2}
\tl_if_novalue:nF {#1} { \keys_set:nn { scontents / typemeaning } {#1} }
\seq_if_empty:NT \l_@@_seq_item_seq
{ \seq_set_from_clist:Nn \l_@@_seq_item_seq { 1 } }
- \tl_set:Nx \l_@@_temp_tl
+ \tl_set:Ne \l_@@_temp_tl
{ \@@_getfrom_seq:Nn \l_@@_seq_item_seq {#2} }
\@@_remove_trailing_eol:N \l_@@_temp_tl
\tl_replace_all:Nxn \l_@@_temp_tl \c_@@_hidden_space_str { ^^J }
@@ -3879,7 +3914,7 @@
}
}
\@@_file_write_cmd:VV \l_@@_fname_out_tl \l_@@_temp_tl
- \use:x
+ \use:e
{
\group_end:
\bool_if:NF \l_@@_print_aux_bool { \@@_esphack: }
@@ -3991,7 +4026,7 @@
\cs_new_protected:Npn \exp_not:N \@@_remove_trailing_eol:w #1
\c_@@_hidden_space_str \s_@@_stop #2 \s_@@_mark #3
} {
- \tl_set:Nx #3
+ \tl_set:Ne #3
{
\tl_if_empty:nTF {#2}
{ \exp_not:o { \@@_use_delimit_by_s_stop:nw #1 } }
@@ -4014,7 +4049,7 @@
{ \@@_parse_mergesc_range:nw {#1} ##1 - \q_@@_mark - \s_@@_mark }
\seq_map_inline:Nn \l_@@_seq_item_seq
{
- \seq_gput_right:cx { g_@@_name_sc!internal_seq }
+ \seq_gput_right:ce { g_@@_name_sc!internal_seq }
{ \seq_item:cn { g_@@_name_#1_seq } {##1} }
}
\@@_use_none_delimit_by_s_stop:w
@@ -4023,7 +4058,7 @@
{
\cs_set_protected:Npn \@@_tmp:w ##1
{
- \msg_error:nnxxx { scontents } { index-out-of-range }
+ \msg_error:nneee { scontents } { index-out-of-range }
{##1} {#1} { \seq_count:c { g_@@_name_#1_seq } }
}
\@@_range_parser:nnxn {#2} {#3}
@@ -4034,37 +4069,82 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{verbatimsc,\startverbatimsc,\stopverbatimsc}
-% Finally the \hologo{LaTeX} and \hologo{ConTeXt} version of
+% \subsection{The \TeX{}, \LaTeX{} and \hologo{ConTeXt} \env{verbatimsc}}\label{env:verbatimsc}
+%
+% \begin{macro}[int]{\endverbatimsc,\end{verbatimsc},\stopverbatimsc,\startverbatimsc,}
+% Finally the \hologo{TeX}, \hologo{LaTeX} and \hologo{ConTeXt} version of
% §verbatimsc§ environment is defined.
-%
-% The macro §\endverbatim§ in the second argument of the §verbatimsc§
-% environment is only needed for compatibility with the \pkg{verbatim}
-% package.
-%
% \begin{macrocode}
%<*loader>
%<*!context>
-\use:x
+\use:e
{
\cs_new_protected:Npn \exp_not:N \@@_xverb:w
- ##1 \g_@@_end_verbatimsc_tl
-%<latex> { ##1 \exp_not:N \end{verbatimsc} }
-%<plain> { ##1 \exp_not:N \endverbatimsc }
-%<context> { ##1 \exp_not:N \stopverbatimsc }
+ #1 \g_@@_end_verbatimsc_tl
+%<latex> { #1 \exp_not:N \end{verbatimsc} }
+%<plain> { #1 \exp_not:N \endverbatimsc }
+%<context> { #1 \exp_not:N \stopverbatimsc }
}
%</!context>
+% \end{macrocode}
+% In \hologo{ConTeXt} we use our own tool §\definetyping§.
+% \begin{macrocode}
+%<context>\definetyping[verbatimsc]
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_declare_instance:,verbatimsc}
+% To be compatible with \emph{tagged} \texttt{PDF} we must define the
+% environment §verbatimsc§ in terms of the \texttt{xtemplate} module integrated
+% into the \LaTeX{} kernel, this code is adapted directly from Mrs. Ulrike
+% Fischer's answer to \href{https://tex.stackexchange.com/a/741178/7832}{New verbatim environment with block code (tagged-pdf)}.
+% \begin{macrocode}
%<*latex>
+\cs_new_protected:Nn \@@_declare_instance:
+ {
+ \DeclareInstance{blockenv}{verbatimsc}{display}
+ {
+ env-name = verbatimsc,
+ tag-name = verbatim,
+ tag-class = ,
+ tagging-recipe = standard,
+ inner-level-counter = ,
+ level-increase = false,
+ setup-code = ,
+ block-instance = displayblock,
+ inner-instance = ,
+ final-code = \legacyverbatimsetup \tag_tool:n {paratag=codeline},
+ para-flattened = true
+ }
+ }
\NewDocumentEnvironment { verbatimsc } { }
{
- \cs_set_eq:cN { @xverbatim } \@@_xverb:
- \verbatim
+ \IfDocumentMetadataTF
+ {
+ \@@_declare_instance:
+ \UseInstance{blockenv}{verbatimsc}{}
+ \@setupverbinvisiblespace\frenchspacing\@vobeyspaces %% <--??
+ \@@_xverb:
+ }
+ {
+ \cs_set_eq:cN { @xverbatim } \@@_xverb:
+ \verbatim
+ }
}
- { \endverbatim }
+% \end{macrocode}
+% The macro §\endverbatim§ in the second argument of the §verbatimsc§
+% environment is only needed for compatibility with the \pkg{verbatim}
+% package.
+% \begin{macrocode}
+ {
+ \IfDocumentMetadataTF
+ {
+ \endblockenv
+ }
+ { \endverbatim }
+ }
%</latex>
-%<context>\definetyping[verbatimsc]
%</loader>
-%<*core>
% \end{macrocode}
% \end{macro}
%
@@ -4076,6 +4156,7 @@
% the §width-tab§ key was set to.
%
% \begin{macrocode}
+%<*core>
\cs_new:Npn \@@_tabs_to_spaces:
{ \prg_replicate:nn { \l_@@_tab_width_int } { ~ } }
% \end{macrocode}
@@ -4093,7 +4174,7 @@
\cs_new_protected:Npn \@@_do_noligs:N #1
{
\char_set_catcode_active:N #1
- \cs_set:cpx { @@_active_char_ \token_to_str:N #1 : }
+ \cs_set:cpe { @@_active_char_ \token_to_str:N #1 : }
{
\mode_leave_vertical:
\tex_kern:D \c_zero_dim
@@ -4111,7 +4192,8 @@
{ T, F, TF }
{
\exp_after:wN \if_meaning:w
- \exp_after:wN \q_@@_mark \@@_use_i_delimit_by_s_stop:nw #1 ? \s_@@_stop
+ \exp_after:wN
+ \q_@@_mark \@@_use_i_delimit_by_s_stop:nw #1 ? \s_@@_stop
\prg_return_true:
\else:
\prg_return_false:
@@ -4160,6 +4242,7 @@
\@@_set_active_eq:NN \^^M \@@_ret:w
}
\group_end:
+%</core>
% \end{macrocode}
% \end{macro}
%
@@ -4171,12 +4254,9 @@
% A user-level wrapper for \cs{keys_set:nn}§{ scontents }§.
%
% \begin{macrocode}
-%</core>
%<*loader>
\NewDocumentCommand \setupsc { +m }
{ \keys_set:nn { scontents } {#1} }
-%</loader>
-%<*core>
% \end{macrocode}
% \end{macro}
%
@@ -4186,8 +4266,6 @@
% User command §\meaningsc§ to see content stored in |seq|.
%
% \begin{macrocode}
-%</core>
-%<*loader>
\NewDocumentCommand \meaningsc { o m }
{ \@@_meaningsc_internal:nn {#1} {#2} }
%</loader>
@@ -4217,6 +4295,7 @@
\cs_replacement_spec:N \l_@@_temp_tl
}
\group_end:
+%</core>
% \end{macrocode}
% \end{macro}
%
@@ -4226,12 +4305,9 @@
% User command §\countsc§ to count number of contents stored in |seq|.
%
% \begin{macrocode}
-%</core>
%<*loader>
\NewExpandableDocumentCommand \countsc { m }
{ \seq_count:c { g_@@_name_#1_seq } }
-%</loader>
-%<*core>
% \end{macrocode}
% \end{macro}
%
@@ -4242,12 +4318,9 @@
% A user command §\cleanseqsc§ to clear (remove) a defined |seq|.
%
% \begin{macrocode}
-%</core>
-%<*loader>
\NewDocumentCommand \cleanseqsc { m }
{ \seq_gclear_new:c { g_@@_name_#1_seq } }
%</loader>
-%<*core>
% \end{macrocode}
% \end{macro}
%
@@ -4256,6 +4329,7 @@
% Warning and error messages used throughout the package.
%
% \begin{macrocode}
+%<*core>
\msg_new:nnn { scontents } { junk-after-begin }
{
Junk~characters~#1~\msg_line_context: :
Modified: trunk/Master/texmf-dist/source/latex/scontents/scontents.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/scontents/scontents.ins 2025-04-23 23:44:15 UTC (rev 75011)
+++ trunk/Master/texmf-dist/source/latex/scontents/scontents.ins 2025-04-24 20:25:51 UTC (rev 75012)
@@ -33,11 +33,11 @@
\declarepreamble\context
\string\module
[ file=t-scontents,
- version=2.2,
+ version=2.3,
title=\string\CONTEXT\ User Module,
subtitle=Storing Contents,
author=Pablo González,
- date=2025-03-26,
+ date=2025-04-23,
copyright=Pablo González,
email=pablgonz at educarchile.cl,
license=LPPL]
Modified: trunk/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv 2025-04-23 23:44:15 UTC (rev 75011)
+++ trunk/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv 2025-04-24 20:25:51 UTC (rev 75012)
@@ -33,24 +33,24 @@
%% scontents.dtx (with options: `loader,context')
%D \module
%D [ file=t-scontents,
-%D version=2.2,
+%D version=2.3,
%D title=\CONTEXT\ User Module,
%D subtitle=Storing Contents,
%D author=Pablo González,
-%D date=2025-03-26,
+%D date=2025-04-23,
%D copyright=Pablo González,
%D email=pablgonz at educarchile.cl,
%D license=LPPL]
-\def\ScontentsFileDate{2025-03-26}%
-\def\ScontentsFileVersion{2.2}%
+\def\ScontentsFileDate{2025-04-23}%
+\def\ScontentsFileVersion{2.3}%
\def\ScontentsFileDescription{Stores LaTeX contents in memory or files}%
\writestatus{loading}{User Module scontents v\ScontentsFileVersion}
\unprotect
\input expl3-generic.tex
\ExplSyntaxOn
-\tl_gset:cx { ver @ scontents . sty } { \ScontentsFileDate\space
+\tl_gset:ce { ver @ scontents . sty } { \ScontentsFileDate\space
v\ScontentsFileVersion\space \ScontentsFileDescription }
-\iow_log:x { Package: ~ scontents ~ \use:c { ver @ scontents . sty } }
+\iow_log:e { Package: ~ scontents ~ \use:c { ver @ scontents . sty } }
\tl_new:N \g__scontents_end_verbatimsc_tl
\tl_gset_rescan:Nnn \g__scontents_end_verbatimsc_tl
{
@@ -58,7 +58,7 @@
}
{ \stopverbatimsc }
\tl_new:N \l__scontents_env_name_tl
-\tl_const:Nx \c__scontents_end_env_tl
+\tl_const:Ne \c__scontents_end_env_tl
{
\c_backslash_str
stop
Modified: trunk/Master/texmf-dist/tex/generic/scontents/scontents-code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/scontents/scontents-code.tex 2025-04-23 23:44:15 UTC (rev 75011)
+++ trunk/Master/texmf-dist/tex/generic/scontents/scontents-code.tex 2025-04-24 20:25:51 UTC (rev 75012)
@@ -27,7 +27,7 @@
%% t-scontents.mkiv and
%% scontents-code.tex.
%%
-\def\ScontentsCoreFileDate{2025-03-26}%
+\def\ScontentsCoreFileDate{2025-04-23}%
\begingroup
\catcode32=10
\endlinechar=32
@@ -130,7 +130,7 @@
\bool_set_false:N \l__scontents_foreach_wrapper_bool
\seq_new:N \l__scontents_foreach_print_seq
\seq_new:c { g__scontents_name_sc!internal_seq }
-\str_const:Nx \c__scontents_hidden_space_str
+\str_const:Ne \c__scontents_hidden_space_str
{ \c_percent_str \c_circumflex_str \c_circumflex_str A scheol \c_percent_str }
\quark_new:N \q__scontents_stop
\quark_new:N \q__scontents_mark
@@ -144,11 +144,8 @@
\skip_new:N \l__scontents_save_skip
\cs_new_protected:Npn \__scontents_rescan_tokens:n #1 { \tex_scantokens:D {#1} }
\cs_generate_variant:Nn \__scontents_rescan_tokens:n { V, x }
-\cs_new:Npx \__scontents_tab: { \c_space_tl }
+\cs_new:Npe \__scontents_tab: { \c_space_tl }
\cs_new:Npn \__scontents_par: { ^^J ^^J }
-\cs_generate_variant:Nn \tl_remove_once:Nn { NV }
-\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx, Nxx, Nnx }
-\cs_generate_variant:Nn \msg_error:nnnn { nnx }
\prg_generate_conditional_variant:Nnn \tl_if_empty:n { f } { p, TF }
\keys_define:nn { scontents / scontents }
{
@@ -293,7 +290,7 @@
\__scontents_tl_if_head_is_q_mark:nTF {#2}
{
\tl_if_empty:fTF { \int_to_roman:n { -0 #1 } }
- { \seq_put_right:Nx \l__scontents_seq_item_seq { \int_eval:n {#1} } }
+ { \seq_put_right:Ne \l__scontents_seq_item_seq { \int_eval:n {#1} } }
{ #3 {#1} }
}
{
@@ -351,7 +348,7 @@
}
\cs_new_protected:Npn \__scontents_lastfrom_seq:n #1
{
- \tl_gset:Nx \g__scontents_temp_tl { \seq_item:cn { g__scontents_name_#1_seq } {-1} }
+ \tl_gset:Ne \g__scontents_temp_tl { \seq_item:cn { g__scontents_name_#1_seq } {-1} }
\group_insert_after:N \__scontents_rescan_tokens:V
\group_insert_after:N \g__scontents_temp_tl
\group_insert_after:N \tl_gclear:N
@@ -616,7 +613,7 @@
\cs_new_protected:Npn \__scontents_analyse_nesting_generic:nn #1 #2
{
\__scontents_define_generic_nesting_function:n {#1}
- \use:x
+ \use:e
{
\exp_not:N \__scontents_analyse_nesting_generic:w #2
\c_backslash_str #1 \tl_use:N \l__scontents_env_name_tl
@@ -637,7 +634,7 @@
\bool_if:NT \l__scontents_storing_bool
{
\bool_if:NF \l__scontents_forced_eol_bool
- { \tl_put_right:Nx #1 { \c__scontents_hidden_space_str } }
+ { \tl_put_right:Ne #1 { \c__scontents_hidden_space_str } }
\__scontents_store_to_seq:NN #1 #2
\bool_if:NT #3 { \__scontents_lastfrom_seq:V #2 }
}
@@ -694,9 +691,10 @@
\tl_set:Nn \l__scontents_temp_tl {#1}
\cs_if_exist:NT \obeyedline
{
- \tl_replace_all:Nxx \l__scontents_temp_tl { \obeyedline } { \iow_char:N \^^M }
+ \RenewDocumentCommand \obeyedline { } { \iow_char:N \^^M }
+ \tl_replace_all:Nee \l__scontents_temp_tl { \obeyedline } { \iow_char:N \^^M }
}
- \tl_replace_all:Nxx \l__scontents_temp_tl { \iow_char:N \^^M } { \iow_char:N \^^J }
+ \tl_replace_all:Nee \l__scontents_temp_tl { \iow_char:N \^^M } { \iow_char:N \^^J }
\__scontents_Scontents_finish:
}
\cs_new_protected:Npn \__scontents_Scontents_finish:
@@ -730,16 +728,16 @@
{
\bool_if:NTF \l__scontents_overwrite_bool
{
- \msg_warning:nnx { scontents } { overwrite-file } {#1}
+ \msg_warning:nne { scontents } { overwrite-file } {#1}
\prg_return_true:
}
{
- \msg_warning:nnx { scontents } { not-writing } {#1}
+ \msg_warning:nne { scontents } { not-writing } {#1}
\prg_return_false:
}
}
{
- \msg_warning:nnx { scontents } { writing-file } {#1}
+ \msg_warning:nne { scontents } { writing-file } {#1}
\prg_return_true:
}
}
@@ -771,7 +769,7 @@
{ \l__scontents_foreach_step_int }
{ \l__scontents_foreach_stop_int }
\__scontents_foreach_add_body:n
- \tl_gset:Nx \g__scontents_temp_tl
+ \tl_gset:Ne \g__scontents_temp_tl
{
\exp_args:NNV \seq_use:Nn
\l__scontents_foreach_print_seq \l__scontents_foreach_sep_tl
@@ -783,7 +781,7 @@
}
\cs_new_protected:Npn \__scontents_foreach_add_body:n #1
{
- \seq_put_right:Nx \l__scontents_foreach_print_seq
+ \seq_put_right:Ne \l__scontents_foreach_print_seq
{
\bool_if:NT \l__scontents_foreach_before_bool
{ \exp_not:V \l__scontents_foreach_before_tl }
@@ -800,11 +798,11 @@
\__scontents_bsphack:
\group_begin:
\seq_clear:N \l__scontents_seq_item_seq
- \str_set:Nx \l__scontents_cur_seq_name_str {#2}
+ \str_set:Ne \l__scontents_cur_seq_name_str {#2}
\tl_if_novalue:nF {#1} { \keys_set:nn { scontents / typemeaning } {#1} }
\seq_if_empty:NT \l__scontents_seq_item_seq
{ \seq_set_from_clist:Nn \l__scontents_seq_item_seq { 1 } }
- \tl_set:Nx \l__scontents_temp_tl
+ \tl_set:Ne \l__scontents_temp_tl
{ \__scontents_getfrom_seq:Nn \l__scontents_seq_item_seq {#2} }
\__scontents_remove_trailing_eol:N \l__scontents_temp_tl
\tl_replace_all:Nxn \l__scontents_temp_tl \c__scontents_hidden_space_str { ^^J }
@@ -817,7 +815,7 @@
}
}
\__scontents_file_write_cmd:VV \l__scontents_fname_out_tl \l__scontents_temp_tl
- \use:x
+ \use:e
{
\group_end:
\bool_if:NF \l__scontents_print_aux_bool { \__scontents_esphack: }
@@ -901,7 +899,7 @@
\cs_new_protected:Npn \exp_not:N \__scontents_remove_trailing_eol:w #1
\c__scontents_hidden_space_str \s__scontents_stop #2 \s__scontents_mark #3
} {
- \tl_set:Nx #3
+ \tl_set:Ne #3
{
\tl_if_empty:nTF {#2}
{ \exp_not:o { \__scontents_use_delimit_by_s_stop:nw #1 } }
@@ -924,7 +922,7 @@
{ \__scontents_parse_mergesc_range:nw {#1} ##1 - \q__scontents_mark - \s__scontents_mark }
\seq_map_inline:Nn \l__scontents_seq_item_seq
{
- \seq_gput_right:cx { g__scontents_name_sc!internal_seq }
+ \seq_gput_right:ce { g__scontents_name_sc!internal_seq }
{ \seq_item:cn { g__scontents_name_#1_seq } {##1} }
}
\__scontents_use_none_delimit_by_s_stop:w
@@ -933,7 +931,7 @@
{
\cs_set_protected:Npn \__scontents_tmp:w ##1
{
- \msg_error:nnxxx { scontents } { index-out-of-range }
+ \msg_error:nneee { scontents } { index-out-of-range }
{##1} {#1} { \seq_count:c { g__scontents_name_#1_seq } }
}
\__scontents_range_parser:nnxn {#2} {#3}
@@ -945,7 +943,7 @@
\cs_new_protected:Npn \__scontents_do_noligs:N #1
{
\char_set_catcode_active:N #1
- \cs_set:cpx { __scontents_active_char_ \token_to_str:N #1 : }
+ \cs_set:cpe { __scontents_active_char_ \token_to_str:N #1 : }
{
\mode_leave_vertical:
\tex_kern:D \c_zero_dim
@@ -957,7 +955,8 @@
{ T, F, TF }
{
\exp_after:wN \if_meaning:w
- \exp_after:wN \q__scontents_mark \__scontents_use_i_delimit_by_s_stop:nw #1 ? \s__scontents_stop
+ \exp_after:wN
+ \q__scontents_mark \__scontents_use_i_delimit_by_s_stop:nw #1 ? \s__scontents_stop
\prg_return_true:
\else:
\prg_return_false:
Modified: trunk/Master/texmf-dist/tex/generic/scontents/scontents.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/scontents/scontents.tex 2025-04-23 23:44:15 UTC (rev 75011)
+++ trunk/Master/texmf-dist/tex/generic/scontents/scontents.tex 2025-04-24 20:25:51 UTC (rev 75012)
@@ -27,14 +27,14 @@
%% t-scontents.mkiv and
%% scontents-code.tex.
%%
-\def\ScontentsFileDate{2025-03-26}%
-\def\ScontentsFileVersion{2.2}%
+\def\ScontentsFileDate{2025-04-23}%
+\def\ScontentsFileVersion{2.3}%
\def\ScontentsFileDescription{Stores LaTeX contents in memory or files}%
\input expl3-generic.tex
\ExplSyntaxOn
-\tl_gset:cx { ver @ scontents . sty } { \ScontentsFileDate\space
+\tl_gset:ce { ver @ scontents . sty } { \ScontentsFileDate\space
v\ScontentsFileVersion\space \ScontentsFileDescription }
-\iow_log:x { Package: ~ scontents ~ \use:c { ver @ scontents . sty } }
+\iow_log:e { Package: ~ scontents ~ \use:c { ver @ scontents . sty } }
\msg_set:nnn { scontents } { already-loaded }
{ The~'scontents'~package~is~already~loaded.~Aborting~input~\msg_line_context:. }
\cs_if_exist:NT \__scontents_rescan_tokens:n
@@ -50,7 +50,7 @@
}
{ \endverbatimsc }
\tl_new:N \l__scontents_env_name_tl
-\tl_const:Nx \c__scontents_end_env_tl
+\tl_const:Ne \c__scontents_end_env_tl
{
\c_backslash_str
end
@@ -150,11 +150,11 @@
{ \__scontents_typestored_internal:nn {#1} {#2} }
\NewDocumentCommand \mergesc { o m }
{ \__scontents_mergesc_internal:nn {#1} {#2} }
-\use:x
+\use:e
{
\cs_new_protected:Npn \exp_not:N \__scontents_xverb:w
- ##1 \g__scontents_end_verbatimsc_tl
- { ##1 \exp_not:N \endverbatimsc }
+ #1 \g__scontents_end_verbatimsc_tl
+ { #1 \exp_not:N \endverbatimsc }
}
\group_begin:
\char_set_catcode_active:n { `\* }
Modified: trunk/Master/texmf-dist/tex/latex/scontents/scontents.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/scontents/scontents.sty 2025-04-23 23:44:15 UTC (rev 75011)
+++ trunk/Master/texmf-dist/tex/latex/scontents/scontents.sty 2025-04-24 20:25:51 UTC (rev 75012)
@@ -27,18 +27,10 @@
%% t-scontents.mkiv and
%% scontents-code.tex.
%%
-\def\ScontentsFileDate{2025-03-26}%
-\def\ScontentsFileVersion{2.2}%
+\def\ScontentsFileDate{2025-04-23}%
+\def\ScontentsFileVersion{2.3}%
\def\ScontentsFileDescription{Stores LaTeX contents in memory or files}%
-\IfFormatAtLeastTF { 2022-06-01 }
- { }
- {
- \RequirePackage{l3keys2e}[2020/02/08]
- \PackageWarning { scontents }
- {
- The next update removes compatibility with versions prior to 2024.
- }
- }
+\NeedsTeXFormat{LaTeX2e}[2024-11-01]
\ProvidesExplPackage
{scontents} {\ScontentsFileDate} {\ScontentsFileVersion} {\ScontentsFileDescription}
\tl_new:N \g__scontents_end_verbatimsc_tl
@@ -50,7 +42,7 @@
}
{ \end{verbatimsc} }
\tl_new:N \l__scontents_env_name_tl
-\tl_const:Nx \c__scontents_end_env_tl
+\tl_const:Ne \c__scontents_end_env_tl
{
\c_backslash_str
end
@@ -63,11 +55,7 @@
{#1} % LaTeX
\keys_define:nn { scontents }
{ verb-font .initial:n = \ttfamily }
-\IfFormatAtLeastTF { 2022-06-01 }
- {
- \ProcessKeyOptions [ scontents ]
- }
- { \ProcessKeysOptions { scontents } }
+\ProcessKeyOptions [ scontents ]
\NewDocumentCommand \newenvsc { m O{} }
{
\cs_if_exist:cTF { #1 }
@@ -103,18 +91,50 @@
{ \__scontents_typestored_internal:nn {#1} {#2} }
\NewDocumentCommand \mergesc { o m }
{ \__scontents_mergesc_internal:nn {#1} {#2} }
-\use:x
+\use:e
{
\cs_new_protected:Npn \exp_not:N \__scontents_xverb:w
- ##1 \g__scontents_end_verbatimsc_tl
- { ##1 \exp_not:N \end{verbatimsc} }
+ #1 \g__scontents_end_verbatimsc_tl
+ { #1 \exp_not:N \end{verbatimsc} }
}
+\cs_new_protected:Nn \__scontents_declare_instance:
+ {
+ \DeclareInstance{blockenv}{verbatimsc}{display}
+ {
+ env-name = verbatimsc,
+ tag-name = verbatim,
+ tag-class = ,
+ tagging-recipe = standard,
+ inner-level-counter = ,
+ level-increase = false,
+ setup-code = ,
+ block-instance = displayblock,
+ inner-instance = ,
+ final-code = \legacyverbatimsetup \tag_tool:n {paratag=codeline},
+ para-flattened = true
+ }
+ }
\NewDocumentEnvironment { verbatimsc } { }
{
- \cs_set_eq:cN { @xverbatim } \__scontents_xverb:
- \verbatim
+ \IfDocumentMetadataTF
+ {
+ \__scontents_declare_instance:
+ \UseInstance{blockenv}{verbatimsc}{}
+ \@setupverbinvisiblespace\frenchspacing\@vobeyspaces %% <--??
+ \__scontents_xverb:
+ }
+ {
+ \cs_set_eq:cN { @xverbatim } \__scontents_xverb:
+ \verbatim
+ }
}
- { \endverbatim }
+ {
+ \IfDocumentMetadataTF
+ {
+ \endblockenv
+ }
+ { \endverbatim }
+ }
\group_begin:
\cs_new_protected:Npn \__scontents_plain_disable_outer_par:
{ }
More information about the tex-live-commits
mailing list.