texlive[67363] Master/texmf-dist: string-diagrams (14jun23)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 14 22:13:32 CEST 2023


Revision: 67363
          http://tug.org/svn/texlive?view=revision&revision=67363
Author:   karl
Date:     2023-06-14 22:13:32 +0200 (Wed, 14 Jun 2023)
Log Message:
-----------
string-diagrams (14jun23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf
    trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx
    trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.ins
    trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty

Modified: trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx	2023-06-14 20:13:04 UTC (rev 67362)
+++ trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx	2023-06-14 20:13:32 UTC (rev 67363)
@@ -1,7 +1,7 @@
 % \iffalse meta-comment
 %% =============================================================================
 %%
-%% string-diagrams 0.2.0 (2023/06/12)
+%% string-diagrams 0.2.1 (2023/06/13)
 %%
 %% Copyright (C) 2023 by Paolo Brasolin <paolo.brasolin at gmail.com>
 %% SPDX-License-Identifier: LPPL-1.3c
@@ -75,6 +75,8 @@
 \documentclass[a4paper,full]{l3doc}
 \usepackage{parskip}
 
+\NewDocumentCommand{\TikZ}{}{Ti\emph{k}Z}
+
 \EnableCrossrefs
 \CodelineIndex
 \RecordChanges
@@ -168,7 +170,7 @@
 %     \end{tikzpicture}
 %   \end{tcblisting}
 %
-%   You can draw multiple boxes using any of your standard Ti\emph{k}Z positioning techniques.
+%   You can draw multiple boxes using any of your standard \TikZ\ positioning techniques.
 %   Don't forget to label the nodes so you can easily reference them.
 %
 %   \begin{tcblisting}{example}
@@ -247,13 +249,13 @@
 %
 % \end{function}
 %
-% \begin{function}[added=2023-05-31]{\wires}
+% \begin{function}[added=2023-05-31,updated=2023-06-13]{\wires}
 %   \begin{syntax}
-%     \cs{wires}\oarg{Ti\emph{k}Z keys}\marg{connectivity}\marg{loose ends}
+%     \cs{wires}\oarg{\TikZ\ keys}\marg{connectivity}\marg{loose ends}
 %   \end{syntax}
 %
 %   To connect boxes, you can use the \cmd\wires\ macro.
-%   The first argument is Ti\emph{k}Z styling for the wires; the second argument is a nested dicionary specifying the connectivity; the third argument is a list of the loose ends to draw.
+%   The first argument is \TikZ\ styling for the wires; the second argument is a nested dicionary specifying the connectivity; the third argument is a list of the loose ends to draw.
 %   \texttt{box}es have the following anchors: \texttt{west}, \texttt{west.0}, \texttt{west.1},  \texttt{east}, \texttt{east.0}, and \texttt{east.1}.
 %
 %   \begin{tcblisting}{example}
@@ -262,7 +264,7 @@
 %       \node[box=0/1/0/2] (B) at (+2, 0) {B};
 %       \node[box=0/1/0/1] (C) at ( 0,+1) {C};
 %       \node[box=0/1/0/1] (D) at ( 0,-1) {D};
-%       \wires[]{
+%       \wires{
 %         A = { east.1 = C.west, east.2 = D.west },
 %         C = { east = B.west.1 },
 %         D = { east = B.west.2 },
@@ -322,8 +324,8 @@
 %    \begin{macrocode}
 \ProvidesExplPackage
   {string-diagrams}
-  {2023/06/12}
-  {0.2.0}
+  {2023/06/13}
+  {0.2.1}
   {Draw string diagrams using TikZ}
 %    \end{macrocode}
 %
@@ -401,7 +403,7 @@
 % \end{macro}
 %
 % \begin{macro}{box}
-%   \changes{0.2.0}{2023/06/12}{make ports configurable through Ti\emph{k}Z keys}
+%   \changes{0.2.0}{2023/06/12}{make ports configurable through \TikZ\ keys}
 %
 %   Define a rectangular shape with configurable ports.
 %    \begin{macrocode}
@@ -487,11 +489,14 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\wires}
-%   Define our main actor.
+% \begin{macro}{\@@_draw_bound_wires:nn}
+%   Draws bound wires.
+%   \begin{arguments}
+%     \item \TikZ\ keys
+%     \item dictionary of port labels
+%   \end{arguments}
 %    \begin{macrocode}
-\NewDocumentCommand{\wires}{ o m m }
-{
+\cs_new:Nn \@@_draw_bound_wires:nn {
   \prop_set_from_keyval:Nn \l_tmpa_prop { #2 }
   \prop_map_inline:Nn \l_tmpa_prop
   {
@@ -498,20 +503,20 @@
     \prop_set_from_keyval:Nn \l_tmpb_prop { ##2 }
     \prop_map_inline:Nn \l_tmpb_prop
     {
-      \regex_match_case:nnTF
+      \regex_match_case:nn
       {
         { \. north } { \tl_gset:Nn \g_tmpa_tl { 90 } }
         { \. south } { \tl_gset:Nn \g_tmpa_tl { -90 } }
         { \. west } { \tl_gset:Nn \g_tmpa_tl { 180 } }
         { \. east } { \tl_gset:Nn \g_tmpa_tl { 0 } }
-      } { ####2 } {} {}
-      \regex_match_case:nnTF
+      } { ####2 }
+      \regex_match_case:nn
       {
         { north } { \tl_gset:Nn \g_tmpb_tl { 90 } }
         { south } { \tl_gset:Nn \g_tmpb_tl { -90 } }
         { west } { \tl_gset:Nn \g_tmpb_tl { 180 } }
         { east } { \tl_gset:Nn \g_tmpb_tl { 0 } }
-      } { ####1 } {} {}
+      } { ####1 }
       \draw [
         out={\tl_use:N \g_tmpb_tl},
         in={\tl_use:N \g_tmpa_tl},
@@ -519,9 +524,21 @@
       ] (##1.####1) to (####2);
     }
   }
-  \clist_set:Nn \l_tmpa_clist { #3 }
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_draw_loose_wires:nn}
+%   Draws loose wires.
+%   \begin{arguments}
+%     \item \TikZ\ keys
+%     \item list of port labels
+%   \end{arguments}
+%    \begin{macrocode}
+\cs_new:Nn \@@_draw_loose_wires:nn {
+  \clist_set:Nn \l_tmpa_clist { #2 }
   \clist_map_inline:Nn \l_tmpa_clist {
-    \regex_match_case:nnTF
+    \regex_match_case:nn
     {
       { \. north } { \draw[#1] (##1) -- +( 0,+1); } % TODO: cleaner solution?
       { \. south }
@@ -531,12 +548,24 @@
         } % TODO: not sure why this works
       { \. west  } { \draw[#1] (##1) -- +(-1, 0); }
       { \. east  } { \draw[#1] (##1) -- +(+1, 0); }
-    } { ##1 } {} {}
+    } { ##1 }
   }
 }
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\wires}
+%   \changes{0.2.1}{2023/06/13}{now correctly handles optional style parameter}
+%   Define our main actor.
+%    \begin{macrocode}
+\NewDocumentCommand{\wires}{ O{} m m }
+{
+  \@@_draw_bound_wires:nn { #1 } { #2 }
+  \@@_draw_loose_wires:nn { #1 } { #3 }
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % Close the \pkg{DocStrip} guards and call it a day.
 %    \begin{macrocode}
 %</package>

Modified: trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.ins	2023-06-14 20:13:04 UTC (rev 67362)
+++ trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.ins	2023-06-14 20:13:32 UTC (rev 67363)
@@ -8,7 +8,7 @@
 %% 
 %% =============================================================================
 %%
-%% string-diagrams 0.2.0 (2023/06/12)
+%% string-diagrams 0.2.1 (2023/06/13)
 %%
 %% Copyright (C) 2023 by Paolo Brasolin <paolo.brasolin at gmail.com>
 %% SPDX-License-Identifier: LPPL-1.3c

Modified: trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty	2023-06-14 20:13:04 UTC (rev 67362)
+++ trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty	2023-06-14 20:13:32 UTC (rev 67363)
@@ -8,7 +8,7 @@
 %% 
 %% =============================================================================
 %%
-%% string-diagrams 0.2.0 (2023/06/12)
+%% string-diagrams 0.2.1 (2023/06/13)
 %%
 %% Copyright (C) 2023 by Paolo Brasolin <paolo.brasolin at gmail.com>
 %% SPDX-License-Identifier: LPPL-1.3c
@@ -39,8 +39,8 @@
 \RequirePackage{tikz}[2023/01/15]
 \ProvidesExplPackage
   {string-diagrams}
-  {2023/06/12}
-  {0.2.0}
+  {2023/06/13}
+  {0.2.1}
   {Draw string diagrams using TikZ}
 \pgfkeys{
   /pgf/box~ports~north/.initial=1,
@@ -142,8 +142,7 @@
   },
 }
 \ExplSyntaxOn
-\NewDocumentCommand{\wires}{ o m m }
-{
+\cs_new:Nn \__stridi_draw_bound_wires:nn {
   \prop_set_from_keyval:Nn \l_tmpa_prop { #2 }
   \prop_map_inline:Nn \l_tmpa_prop
   {
@@ -150,20 +149,20 @@
     \prop_set_from_keyval:Nn \l_tmpb_prop { ##2 }
     \prop_map_inline:Nn \l_tmpb_prop
     {
-      \regex_match_case:nnTF
+      \regex_match_case:nn
       {
         { \. north } { \tl_gset:Nn \g_tmpa_tl { 90 } }
         { \. south } { \tl_gset:Nn \g_tmpa_tl { -90 } }
         { \. west } { \tl_gset:Nn \g_tmpa_tl { 180 } }
         { \. east } { \tl_gset:Nn \g_tmpa_tl { 0 } }
-      } { ####2 } {} {}
-      \regex_match_case:nnTF
+      } { ####2 }
+      \regex_match_case:nn
       {
         { north } { \tl_gset:Nn \g_tmpb_tl { 90 } }
         { south } { \tl_gset:Nn \g_tmpb_tl { -90 } }
         { west } { \tl_gset:Nn \g_tmpb_tl { 180 } }
         { east } { \tl_gset:Nn \g_tmpb_tl { 0 } }
-      } { ####1 } {} {}
+      } { ####1 }
       \draw [
         out={\tl_use:N \g_tmpb_tl},
         in={\tl_use:N \g_tmpa_tl},
@@ -171,9 +170,11 @@
       ] (##1.####1) to (####2);
     }
   }
-  \clist_set:Nn \l_tmpa_clist { #3 }
+}
+\cs_new:Nn \__stridi_draw_loose_wires:nn {
+  \clist_set:Nn \l_tmpa_clist { #2 }
   \clist_map_inline:Nn \l_tmpa_clist {
-    \regex_match_case:nnTF
+    \regex_match_case:nn
     {
       { \. north } { \draw[#1] (##1) -- +( 0,+1); } % TODO: cleaner solution?
       { \. south }
@@ -183,6 +184,11 @@
         } % TODO: not sure why this works
       { \. west  } { \draw[#1] (##1) -- +(-1, 0); }
       { \. east  } { \draw[#1] (##1) -- +(+1, 0); }
-    } { ##1 } {} {}
+    } { ##1 }
   }
 }
+\NewDocumentCommand{\wires}{ O{} m m }
+{
+  \__stridi_draw_bound_wires:nn { #1 } { #2 }
+  \__stridi_draw_loose_wires:nn { #1 } { #3 }
+}



More information about the tex-live-commits mailing list.