summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-14 21:31:31 +0000
committerKarl Berry <karl@freefriends.org>2018-02-14 21:31:31 +0000
commit5dc958d03508be1e48423296a0b88d973ccd2d74 (patch)
tree28875c7c9fae9bb3c9c88120eddc1fb6663feb76 /Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex
parentc9f9bf7a01281c0b591c5df6bac04399630bdf48 (diff)
xsim (14feb18)
git-svn-id: svn://tug.org/texlive/trunk@46634 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex19
1 files changed, 18 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex b/Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex
index 57e0dfd38bf..4fac1762f8e 100644
--- a/Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex
+++ b/Master/texmf-dist/tex/latex/xsim/xsim.tags.code.tex
@@ -8,7 +8,7 @@
% Web: https://github.com/cgnieder/xsim
% E-Mail: contact@mychemistry.eu
% ----------------------------------------------------------------------------
-% Copyright 2017 Clemens Niederberger
+% Copyright 2017--2018 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -40,6 +40,9 @@
}
\cs_generate_variant:Nn \xsim_set_seq_from_clist:Nn {c,Nx}
+\msg_new:nnn {xsim} {tag-exists}
+ { The~ tag~ type~ `#1'~ already~ exists.~ I~ am~ doing~ nothing. }
+
% #1: name
\cs_new_protected:Npn \xsim_new_tag_type:n #1
{
@@ -56,6 +59,12 @@
#1 .code:n =
\xsim_set_seq_from_clist:cn {l__xsim_chosen_tags_#1_seq} {##1}
}
+ \prg_new_protected_conditional:cpnn {xsim_if_#1_value:n} ##1 {T,F,TF}
+ {
+ \seq_if_in:cnTF {l__xsim_chosen_tags_#1_seq} {##1}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
\xsim_declare_property:nnnn
{ \c_false_bool }
{ \c_false_bool }
@@ -78,6 +87,14 @@
}
% #1: tag type
+\prg_new_protected_conditional:Npnn \xsim_if_tag_type_exists:n #1 {T,F,TF}
+ {
+ \seq_if_in:NnTF \l__xsim_tag_types_seq {#1}
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+% #1: tag type
% #2: exercise type
% #3: id
% #4: print|use