summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/scontents/scontents.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-11-17 22:34:27 +0000
committerKarl Berry <karl@freefriends.org>2019-11-17 22:34:27 +0000
commit23ef0a47d81811188819422f09392e5220e96b59 (patch)
tree17a6d6fc7d95bd2889038db33bb55b1b8c920bd8 /Master/texmf-dist/tex/latex/scontents/scontents.sty
parent59dc3a32912329f9a44b04a5bd4df8bde04e383e (diff)
scontents (17nov19)
git-svn-id: svn://tug.org/texlive/trunk@52841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/scontents/scontents.sty')
-rw-r--r--Master/texmf-dist/tex/latex/scontents/scontents.sty36
1 files changed, 24 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/scontents/scontents.sty b/Master/texmf-dist/tex/latex/scontents/scontents.sty
index ceb700d4348..77147e8ecf7 100644
--- a/Master/texmf-dist/tex/latex/scontents/scontents.sty
+++ b/Master/texmf-dist/tex/latex/scontents/scontents.sty
@@ -27,21 +27,21 @@
%% t-scontents.mkiv and
%% scontents-code.tex.
%%
-\def\ScontentsFileDate{2019-10-29}%
-\def\ScontentsFileVersion{1.7}%
+\def\ScontentsFileDate{2019-11-18}%
+\def\ScontentsFileVersion{1.8}%
\def\ScontentsFileDescription{Stores LaTeX contents in memory or files}%
\RequirePackage{expl3,xparse,l3keys2e}[2019/05/28]
\ProvidesExplPackage
{scontents} {\ScontentsFileDate} {\ScontentsFileVersion} {\ScontentsFileDescription}
\@ifpackageloaded { verbatim }
{
- \iow_term:n
+ \msg_set:nnn { scontents } { unsupported-verbatim }
{
- The~implementation~of~the~'verbatimsc'~environment~\\
- used~by~\tl_to_str:n{\typestored}~is~not~compatible~with~package\\
- 'verbatim'.~Review~the~documentation~and~redefine~\\
- the~'verbatimsc'~environment.
+ The~implementation~of~the~'verbatimsc'~environment~used~by~
+ \iow_char:N \\typestored~is~not~compatible~with~package~'verbatim'.~
+ Review~the~documentation~and~redefine~the~'verbatimsc'~environment.
}
+ \msg_warning:nn { scontents } { unsupported-verbatim }
} { }
\tl_new:N \g__scontents_end_verbatimsc_tl
\tl_gset_rescan:Nnn
@@ -57,7 +57,7 @@
\c_backslash_str
end
\c_left_brace_str
- scontents
+ \exp_not:N \l__scontents_env_name_tl
\c_right_brace_str
}
\file_input:n { scontents-code.tex }
@@ -66,20 +66,32 @@
\keys_define:nn { scontents }
{ verb-font .initial:n = \ttfamily }
\ProcessKeysOptions { scontents }
-\NewDocumentEnvironment { scontents } { }
+\NewDocumentCommand { \newenvsc } { m O{} }
{
- \__scontents_scontents_env_begin:
+ \cs_if_exist:cTF { #1 }
+ { \msg_error:nnn { scontents } { env-already-defined } {#1} }
+ { \__scontents_scontents_setenv:nn {#1} {#2} }
}
+\cs_new_protected:Npn \__scontents_env_define:nnn #1 #2 #3
{
- \__scontents_scontents_env_end:
+ \NewDocumentEnvironment {#1} { }
+ {
+ #2
+ }
+ {
+ #3
+ }
}
+\newenvsc{scontents}
\NewDocumentCommand \__scontents_grab_optional:w { r[] }
{ \__scontents_grab_optional:n {#1} }
+\cs_new_eq:NN \__scontents_analyse_nesting_format:n
+ \__scontents_analyse_nesting_latex:n
\NewDocumentCommand { \Scontents }{ !s !O{} }
{ \__scontents_Scontents_internal:nn {#1} {#2} }
\NewDocumentCommand { \__scontents_verb_arg:w } { +v }
{ \__scontents_verb_arg_internal:n {#1} }
-\NewDocumentCommand { \getstored } { O{1} m }
+\NewDocumentCommand { \getstored } { O{-1} m }
{ \__scontents_getstored_internal:nn {#1} {#2} }
\NewDocumentCommand { \foreachsc } { o m }
{ \__scontents_foreachsc_internal:nn {#1} {#2} }