diff options
author | Karl Berry <karl@freefriends.org> | 2021-04-16 20:15:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-04-16 20:15:03 +0000 |
commit | fa07c77aefbc7f46ac32acf1dfe1367b5eaf9ce2 (patch) | |
tree | 9dc4bed1abf539cdaa7a5f9da4d7a2e6e28c38dc /Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty | |
parent | 611b225a456949639e46d4ccb7d458761c3dc818 (diff) |
tikzlings (16apr21)
git-svn-id: svn://tug.org/texlive/trunk@58885 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty index 3251df7a1bf..4cc5eecbf35 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-addons.sty @@ -12,11 +12,49 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzlings-addons}[2021/03/17 version v0.5 Draw additional items for the tikzlings] +\ProvidesPackage{tikzlings-addons}[2021/04/16 version v0.6 Draw additional items for the tikzlings] \RequirePackage{tikz} \usetikzlibrary{patterns} % for the wizard hat +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% List of all TikZlings +% +% converting a list of the format +% bee/bees, marmot/marmots, ... +% into a list of the format +% /bee, /marmot, ... +% for the also search option +% usage: \tikzling@iteratesearch\tikzling@list +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{tikzlings-list} +\RequirePackage{expl3} + +\ExplSyntaxOn +\cs_new:Npn \tikzlings_iteratesearch:N #1 { + \clist_map_function:NN #1 \__tikzlings_slashed_items:n +} +\cs_new:Npn \__tikzlings_slashed_items:n #1 { + / + \exp_not:N { + \__tikzlings_before_slashsearch:w #1 / \s_stop + } + , +} +\cs_new:Npn \__tikzlings_before_slashsearch:w #1 / #2 \s_stop { + \tl_trim_spaces:n {#1} +} +\cs_new_eq:NN \tikzling@iteratesearch \tikzlings_iteratesearch:N +\ExplSyntaxOff + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Addons +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \newcommand*{\thing}[1][]{% \begin{scope}% \tikzset{/thing/.cd,#1}% @@ -79,10 +117,7 @@ % General % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - /thing/.search also={% - /tikz,/pgf, - /bear,/coati,/koala,/marmot,/mouse,/owl,/penguin,/snowman,/moles,/sloth,/pig,/cat,/hippo,/rhino,/panda,/bee,/anteater,/squirrel,/sheep, - }, + /thing/.search also/.expanded={/tikz,/pgf,\tikzling@iteratesearch\tikzling@list}, %/thing/.unknown/.code=\relax, % bad idea, prevents tikz/pgf keys /thing/.cd, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |