texlive[67251] Master: string-diagrams (31may23)

commits+karl at tug.org commits+karl at tug.org
Wed May 31 21:58:21 CEST 2023


Revision: 67251
          http://tug.org/svn/texlive?view=revision&revision=67251
Author:   karl
Date:     2023-05-31 21:58:20 +0200 (Wed, 31 May 2023)
Log Message:
-----------
string-diagrams (31may23)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/string-diagrams/
    trunk/Master/texmf-dist/doc/latex/string-diagrams/README.md
    trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf
    trunk/Master/texmf-dist/source/latex/string-diagrams/
    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/
    trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty
    trunk/Master/tlpkg/tlpsrc/string-diagrams.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/string-diagrams/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/string-diagrams/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/string-diagrams/README.md	2023-05-31 19:58:20 UTC (rev 67251)
@@ -0,0 +1,77 @@
+# string-diagrams
+
+[![CTAN release][ctan-shield]][ctan-link]
+[![GitHub release][release-shield]][release-link]
+[![Project licence][licence-shield]][licence-link]
+
+[ctan-shield]: https://img.shields.io/ctan/v/string-diagrams?label=CTAN
+[ctan-link]: https://ctan.org/pkg/string-diagrams
+[release-shield]: https://img.shields.io/github/v/release/paolobrasolin/string-diagrams?display_name=release&include_prereleases
+[release-link]: https://github.com/paolobrasolin/string-diagrams/releases/
+[licence-shield]: https://img.shields.io/github/license/paolobrasolin/string-diagrams
+[licence-link]: https://www.latex-project.org/lppl.txt
+
+Create string diagrams with LaTeX!
+
+`string-diagrams` is a LaTeX package designed for effortless and aesthetically pleasing creation of string diagrams.
+
+## Getting Started
+
+### Prerequisites
+
+The only thing you need is an up-to-date LaTeX distribution including TikZ.
+
+### Installation
+
+The fastest way to hit the ground running is to download `string-diagrams` from CTAN via your package manager. For instance, TeXLive users can run `tlmgr install string-diagrams` or select `string-diagrams` from the GUI.
+
+Alternatively, you can download the package from the [CTAN page](https://www.ctan.org/pkg/string-diagrams), unzip the archive, and place `string-diagrams.sty` in your working directory.
+
+For those who always live on the edge, unreleased versions are available on the [releases page](https://github.com/paolobrasolin/string-diagrams/releases).
+
+### Usage
+
+After including the package in your preamble, you can craft your string diagrams in a `tikzpicture` environment:
+
+```latex
+\usepackage{string-diagrams}
+
+%...
+
+\begin{tikzpicture}
+  \node[box] (a) {a};
+  \node[box] (b) at (0,-2) {b};
+  \node[dot] (x) at (1,-1) {};
+  \node[dot] (y) at (-1,-1) {};
+  \wires[]{
+    a = { east = x.north },
+    b = { east0 = x.south },
+    y = { north = a.west1, south = b.west },
+  }{
+    a.west0, b.east1, x.east, y.west
+  }
+\end{tikzpicture}
+```
+
+Detailed instructions are available in the [documentation](http://mirrors.ctan.org/graphics/pgf/contrib/string-diagrams/string-diagrams.pdf).
+
+## Contributing
+
+Got a fantastic idea? Noticed a bug? Contributions are more than welcome! Please feel free to share your thoughts via the [issue tracker](https://github.com/paolobrasolin/string-diagrams/issues).
+
+For the adventurous, you can [fork the repository](https://github.com/paolobrasolin/string-diagrams/fork), create some magic, and [submit a pull request](https://github.com/paolobrasolin/string-diagrams/pulls).
+
+## License
+
+This project is licensed under the LPPL-1.3c License.
+
+## Acknowledgements
+
+Special gratitude goes to the [Laboratory for Compositional Systems and Methods](https://compose.ioc.ee/) of [Tallin University of Technology](https://taltech.ee/). My stay with them in May 2023 set the stage for the birth and primary development of this work, fueled by their warm hospitality and vibrant scholarly atmosphere.
+
+This work is built upon the collaborative efforts of two exceptional contributors:
+
+- [tetrapharmakon](https://github.com/tetrapharmakon), my partner in crime for [moirai](https://github.com/tetrapharmakon/moirai), the projects' first iteration.
+- [iwilare](https://github.com/iwilare), who saw potential in our initial idea and pushed it forward with their own fork [moirphism](https://github.com/iwilare/moirphism).
+
+Without them, their shared enthusiasm, and our fruitful discussions, `string-diagrams` simply wouldn't be.


Property changes on: trunk/Master/texmf-dist/doc/latex/string-diagrams/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf	2023-05-31 19:55:31 UTC (rev 67250)
+++ trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf	2023-05-31 19:58:20 UTC (rev 67251)

Property changes on: trunk/Master/texmf-dist/doc/latex/string-diagrams/string-diagrams.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx	2023-05-31 19:58:20 UTC (rev 67251)
@@ -0,0 +1,370 @@
+% \iffalse meta-comment
+%% =============================================================================
+%%
+%% string-diagrams 0.1.0 (2023/05/31)
+%%
+%% Copyright (C) 2023 by Paolo Brasolin <paolo.brasolin at gmail.com>
+%% SPDX-License-Identifier: LPPL-1.3c
+%%
+%% =============================================================================
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% The Current Maintainer of this work is Paolo Brasolin.
+%%
+%% This work consists of the files  README.md,
+%%                                  string-diagrams.dtx,
+%% and the derived files            string-diagrams.ins,
+%%                                  string-diagrams.sty, and
+%%                                  string-diagrams.pdf.
+%%
+%% =============================================================================
+%
+% %%%=[ INSTALL ]===============================================================
+%
+%<*internal>
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+  \expandafter\begingroup
+\fi
+%</internal>
+%
+%<*install>
+\input l3docstrip.tex
+\keepsilent
+\askforoverwritefalse
+
+% NOTE: to avoid redundancy we use `%%'-lines instead of pre/postambles
+\preamble
+\endpreamble
+\nopostamble
+
+\usedir{tex/latex/string-diagrams}
+\generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}}}
+
+%</install>
+%<*internal>
+
+\usedir{source/latex/string-diagrams}
+\generate{\file{\jobname.ins}{\from{\jobname.dtx}{install}}}
+
+%</internal>
+%
+%<*internal>
+\ifx\fmtname\nameofplainTeX
+  \expandafter\endbatchfile
+\else
+  \expandafter\endgroup
+\fi
+%</internal>
+%
+%<install>\endbatchfile
+%
+% %%%=[ DRIVER ]================================================================
+%
+%<*driver>
+\documentclass[a4paper,full]{l3doc}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\usepackage{string-diagrams}
+\usetikzlibrary{calc}
+\usepackage{snapshot}
+
+\usepackage{tcolorbox}
+\tcbuselibrary{listings, skins}
+
+\lstset{
+  language=[LaTeX]TeX,
+  basicstyle=\ttfamily\small,
+  columns=flexible,
+  ^^A keywordstyle=\color{red},
+  ^^A morekeywords={},
+  texcsstyle=*\color{violet},
+  moretexcs={node,wires},
+  breaklines=true,
+}
+
+\tcbset{example/.style={
+  listing engine=listings,
+  verbatim ignore percent=true,
+  listing side text,
+  size=minimal,
+  skin=bicolor,
+  colback=black!5!white,
+  colbacklower=white,
+  sidebyside,
+  lefthand ratio=0.62,
+  listing options={
+    xleftmargin=-0.6em, % poor man's gobble=4
+  },
+}}
+
+\begin{document}
+  \DocInput{\jobname.dtx}
+  \PrintChanges
+  \PrintIndex
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \changes{0.1.0}{2023/05/31}{Initial version}
+%
+% \GetFileInfo{\jobname.sty}
+%
+% \title{^^A
+%   The \pkg{\jobname} package^^A
+%   \thanks{Thanks!}\\^^A
+%   \fileinfo^^A
+% }
+%
+% \author{^^A
+%   Paolo Brasolin\\^^A
+%   \texttt{\href{mailto:paolo.brasolin at gmail.com}{paolo.brasolin at gmail.com}}^^A
+% }
+%
+% \date{\fileversion~(\filedate)}
+%
+% \maketitle
+%
+% ^^A=[ DOCUMENTATION ]=========================================================
+%
+% \begin{documentation}
+%
+% \begin{tcolorbox}[
+%   colback=red!5!white,
+%   colframe=red,
+%   sharp corners,
+%   boxrule=1pt,
+% ]
+% Please note this is the \href{https://semver.org/#spec-item-4}{major version zero}, meant for initial development: \emph{anything MAY change at any time}.
+% The upside is that this is the best time to \href{https://github.com/paolobrasolin/string-diagrams#contributing}{contribute}!
+% Of course you can also just keep the \texttt{sty} along with your code and not care at all.
+% \end{tcolorbox}
+% 
+%
+% \section{Documentation}
+%
+% Let's walk through the features by example.
+%
+%
+% To draw boxes, you use the \texttt{box} style on a node.
+%
+% \begin{tcblisting}{example}
+%   \begin{tikzpicture}
+%     \node[box] {A};
+%   \end{tikzpicture}
+% \end{tcblisting}
+%
+% You can draw multiple boxes using any of your standard Ti\emph{k}Z positioning techniques.
+% Don't forget to label the nodes so you can easily reference them.
+%
+% \begin{tcblisting}{example}
+%   \begin{tikzpicture}
+%     \node[box] (A) at (0,0) {A};
+%     \node[box, right of=A] (B) {B};
+%     \node[box] (C) at ($(B)+(2cm,1em)$) {C};
+%   \end{tikzpicture}
+% \end{tcblisting}
+%
+% 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.
+% \texttt{box}es have the following anchors: \texttt{west}, \texttt{west0}, \texttt{west1},  \texttt{east}, \texttt{east0}, and \texttt{east1}.
+%
+% \begin{tcblisting}{example}
+%   \begin{tikzpicture}[scale=0.6]
+%     \node[box] (A) at (-2, 0) {A};
+%     \node[box] (B) at (+2, 0) {B};
+%     \node[box] (C) at ( 0,+1) {C};
+%     \node[box] (D) at ( 0,-1) {D};
+%     \wires[]{
+%       A = { east0 = C.west, east1 = D.west },
+%       C = { east = B.west0 },
+%       D = { east = B.west1 },
+%     }{ A.west, B.east }
+%   \end{tikzpicture}
+% \end{tcblisting}
+%
+% To split and join wires, you can use \texttt{dot}s and their anchors \texttt{north}, \texttt{east}, \texttt{south}, and \texttt{west}.
+% Remember to have fun with styling wires.
+%
+% \begin{tcblisting}{example}
+%   \begin{tikzpicture}
+%     \node[box] (A) at ( 0,+1) {A};
+%     \node[box] (B) at ( 0,-1) {B};
+%     \node[dot] (x) at (+1, 0) {};
+%     \node[dot] (y) at (-1, 0) {};
+%     \wires[looseness=1.5, dashed]{
+%       A = { east = x.north },
+%       B = { east0 = x.south },
+%       y = { north = A.west1, south = B.west },
+%     }{
+%       A.west0, B.east1, x.east, y.west
+%     }
+%   \end{tikzpicture}
+% \end{tcblisting}
+%
+% That's it. This is the package, for now.
+%
+% \end{documentation}
+%
+% ^^A=[ PACKAGE ]===============================================================
+%
+% \begin{implementation}
+%
+% \section{Implementation}
+%
+% Open the \pkg{DocStrip} guards.
+%    \begin{macrocode}
+%<*package>
+%    \end{macrocode}
+%
+% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention).
+%    \begin{macrocode}
+%<@@=stridi>
+%    \end{macrocode}
+%
+% Load the essential support (\pkg{expl3}) \enquote{up-front}.
+%
+%    \begin{macrocode}
+\RequirePackage{expl3}[2023/05/11]
+\RequirePackage{tikz}[2023/01/15]
+%    \end{macrocode}
+%
+% Identify the package and give the over all version information.
+%    \begin{macrocode}
+\ProvidesExplPackage
+  {string-diagrams}
+  {2023/05/31}
+  {0.1.0}
+  {Draw string diagrams using TikZ}
+%    \end{macrocode}
+%
+% Define a shape with useful anchor points.
+%    \begin{macrocode}
+\pgfdeclareshape{box}{
+  \inheritbackgroundpath[from=rectangle]
+  \inheritsavedanchors[from=rectangle]
+  \inheritanchorborder[from=rectangle]
+  \inheritanchor[from=rectangle]{center}
+  \inheritanchor[from=rectangle]{north}
+  \inheritanchor[from=rectangle]{south}
+  \inheritanchor[from=rectangle]{west}
+  \inheritanchor[from=rectangle]{east}
+  \anchor{east0}{
+    \pgf at process{\southwest}
+    \pgf at ya=0.25\pgf at y
+    \pgf at process{\northeast}
+    \pgf at y=0.75\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+  \anchor{east1}{
+    \pgf at process{\southwest}
+    \pgf at ya=0.75\pgf at y
+    \pgf at process{\northeast}
+    \pgf at y=0.25\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+  \anchor{west0}{
+    \pgf at process{\northeast}
+    \pgf at ya=0.75\pgf at y
+    \pgf at process{\southwest}
+    \pgf at y=0.25\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+  \anchor{west1}{
+    \pgf at process{\northeast}
+    \pgf at ya=0.25\pgf at y
+    \pgf at process{\southwest}
+    \pgf at y=0.75\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+}
+%    \end{macrocode}
+% Define styles to draw boxes and dots.
+%    \begin{macrocode}
+\ExplSyntaxOff
+\tikzset{
+  box/.style={
+    shape=box,
+    draw,
+    inner sep=.5em,
+    minimum width=2em,
+    minimum height=2em,
+    execute at begin node=$,
+    execute at end node=$,
+  },
+  dot/.style={
+    shape=circle,
+    fill,
+    inner sep=0,
+    minimum width=0.4em,
+  },
+}
+\ExplSyntaxOn
+%    \end{macrocode}
+%
+% Define our main actor.
+% \begin{macro}{\wires}
+%    \begin{macrocode}
+\NewDocumentCommand{\wires}{ o m m }
+{
+  \prop_set_from_keyval:Nn \l_tmpa_prop { #2 }
+  \prop_map_inline:Nn \l_tmpa_prop
+  {
+    \prop_set_from_keyval:Nn \l_tmpb_prop { ##2 }
+    \prop_map_inline:Nn \l_tmpb_prop
+    {
+      \regex_match_case:nnTF
+      {
+        { \. 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
+      {
+        { 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 } {} {}
+      \draw [
+        out={\tl_use:N \g_tmpb_tl},
+        in={\tl_use:N \g_tmpa_tl},
+        #1,
+      ] (##1.####1) to (####2);
+    }
+  }
+  \clist_set:Nn \l_tmpa_clist { #3 }
+  \clist_map_inline:Nn \l_tmpa_clist {
+    \regex_match_case:nnTF
+    {
+      { \. north } { \draw[#1] (##1) -- +( 0,+1); } % TODO: cleaner solution?
+      { \. south }
+        {
+          \draw[out=-90, in=0,#1] (##1)
+            to ($(\pgf at picminx, \pgf at y)$);
+        } % TODO: not sure why this works
+      { \. west  } { \draw[#1] (##1) -- +(-1, 0); }
+      { \. east  } { \draw[#1] (##1) -- +(+1, 0); }
+    } { ##1 } {} {}
+  }
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</package>
+% \fi
+% \end{implementation}
+%% =============================================================================


Property changes on: trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/string-diagrams/string-diagrams.ins	2023-05-31 19:58:20 UTC (rev 67251)
@@ -0,0 +1,49 @@
+%%
+%% This is file `string-diagrams.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% string-diagrams.dtx  (with options: `install')
+%% 
+%% =============================================================================
+%%
+%% string-diagrams 0.1.0 (2023/05/31)
+%%
+%% Copyright (C) 2023 by Paolo Brasolin <paolo.brasolin at gmail.com>
+%% SPDX-License-Identifier: LPPL-1.3c
+%%
+%% =============================================================================
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% The Current Maintainer of this work is Paolo Brasolin.
+%%
+%% This work consists of the files  README.md,
+%%                                  string-diagrams.dtx,
+%% and the derived files            string-diagrams.ins,
+%%                                  string-diagrams.sty, and
+%%                                  string-diagrams.pdf.
+%%
+%% =============================================================================
+\input l3docstrip.tex
+\keepsilent
+\askforoverwritefalse
+
+\preamble
+\endpreamble
+\nopostamble
+
+\usedir{tex/latex/string-diagrams}
+\generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}}}
+
+\endbatchfile
+%% =============================================================================

Added: trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty	2023-05-31 19:58:20 UTC (rev 67251)
@@ -0,0 +1,145 @@
+%%
+%% This is file `string-diagrams.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% string-diagrams.dtx  (with options: `package')
+%% 
+%% =============================================================================
+%%
+%% string-diagrams 0.1.0 (2023/05/31)
+%%
+%% Copyright (C) 2023 by Paolo Brasolin <paolo.brasolin at gmail.com>
+%% SPDX-License-Identifier: LPPL-1.3c
+%%
+%% =============================================================================
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008 or later.
+%%
+%% This work has the LPPL maintenance status `author-maintained'.
+%%
+%% The Current Maintainer of this work is Paolo Brasolin.
+%%
+%% This work consists of the files  README.md,
+%%                                  string-diagrams.dtx,
+%% and the derived files            string-diagrams.ins,
+%%                                  string-diagrams.sty, and
+%%                                  string-diagrams.pdf.
+%%
+%% =============================================================================
+\RequirePackage{expl3}[2023/05/11]
+\RequirePackage{tikz}[2023/01/15]
+\ProvidesExplPackage
+  {string-diagrams}
+  {2023/05/31}
+  {0.1.0}
+  {Draw string diagrams using TikZ}
+\pgfdeclareshape{box}{
+  \inheritbackgroundpath[from=rectangle]
+  \inheritsavedanchors[from=rectangle]
+  \inheritanchorborder[from=rectangle]
+  \inheritanchor[from=rectangle]{center}
+  \inheritanchor[from=rectangle]{north}
+  \inheritanchor[from=rectangle]{south}
+  \inheritanchor[from=rectangle]{west}
+  \inheritanchor[from=rectangle]{east}
+  \anchor{east0}{
+    \pgf at process{\southwest}
+    \pgf at ya=0.25\pgf at y
+    \pgf at process{\northeast}
+    \pgf at y=0.75\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+  \anchor{east1}{
+    \pgf at process{\southwest}
+    \pgf at ya=0.75\pgf at y
+    \pgf at process{\northeast}
+    \pgf at y=0.25\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+  \anchor{west0}{
+    \pgf at process{\northeast}
+    \pgf at ya=0.75\pgf at y
+    \pgf at process{\southwest}
+    \pgf at y=0.25\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+  \anchor{west1}{
+    \pgf at process{\northeast}
+    \pgf at ya=0.25\pgf at y
+    \pgf at process{\southwest}
+    \pgf at y=0.75\pgf at y
+    \advance\pgf at y by \pgf at ya
+  }
+}
+\ExplSyntaxOff
+\tikzset{
+  box/.style={
+    shape=box,
+    draw,
+    inner sep=.5em,
+    minimum width=2em,
+    minimum height=2em,
+    execute at begin node=$,
+    execute at end node=$,
+  },
+  dot/.style={
+    shape=circle,
+    fill,
+    inner sep=0,
+    minimum width=0.4em,
+  },
+}
+\ExplSyntaxOn
+\NewDocumentCommand{\wires}{ o m m }
+{
+  \prop_set_from_keyval:Nn \l_tmpa_prop { #2 }
+  \prop_map_inline:Nn \l_tmpa_prop
+  {
+    \prop_set_from_keyval:Nn \l_tmpb_prop { ##2 }
+    \prop_map_inline:Nn \l_tmpb_prop
+    {
+      \regex_match_case:nnTF
+      {
+        { \. 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
+      {
+        { 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 } {} {}
+      \draw [
+        out={\tl_use:N \g_tmpb_tl},
+        in={\tl_use:N \g_tmpa_tl},
+        #1,
+      ] (##1.####1) to (####2);
+    }
+  }
+  \clist_set:Nn \l_tmpa_clist { #3 }
+  \clist_map_inline:Nn \l_tmpa_clist {
+    \regex_match_case:nnTF
+    {
+      { \. north } { \draw[#1] (##1) -- +( 0,+1); } % TODO: cleaner solution?
+      { \. south }
+        {
+          \draw[out=-90, in=0,#1] (##1)
+            to ($(\pgf at picminx, \pgf at y)$);
+        } % TODO: not sure why this works
+      { \. west  } { \draw[#1] (##1) -- +(-1, 0); }
+      { \. east  } { \draw[#1] (##1) -- +(+1, 0); }
+    } { ##1 } {} {}
+  }
+}
+%% =============================================================================


Property changes on: trunk/Master/texmf-dist/tex/latex/string-diagrams/string-diagrams.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2023-05-31 19:55:31 UTC (rev 67250)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2023-05-31 19:58:20 UTC (rev 67251)
@@ -770,7 +770,8 @@
     stdclsdv stdpage stealcaps steinmetz
     stellenbosch step stepgreek stex
     stickstoo stix stix2-otf stix2-type1 stmaryrd storebox storecmd
-    strands stricttex stringenc stringstrings structmech struktex
+    strands stricttex string-diagrams stringenc stringstrings
+    structmech struktex
     sttools stubs studenthandouts sty2dtx styledcmd suanpan
     subdocs subdepth subeqn subeqnarray
     subfig subfigmat subfigure subfiles subfloat substances

Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2023-05-31 19:55:31 UTC (rev 67250)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2023-05-31 19:58:20 UTC (rev 67251)
@@ -223,6 +223,7 @@
 depend statmath
 depend steinmetz
 depend stmaryrd
+depend github.com/paolobrasolin/string-diagrams
 depend structmech
 depend struktex
 depend substances

Added: trunk/Master/tlpkg/tlpsrc/string-diagrams.tlpsrc
===================================================================


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