texlive[44455] Master/texmf-dist: tqft (1jun17)

commits+karl at tug.org commits+karl at tug.org
Mon Jun 5 01:48:03 CEST 2017


Revision: 44455
          http://tug.org/svn/texlive?view=revision&revision=44455
Author:   karl
Date:     2017-06-05 01:48:03 +0200 (Mon, 05 Jun 2017)
Log Message:
-----------
tqft (1jun17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex
    trunk/Master/texmf-dist/source/latex/tqft/tqft.dtx
    trunk/Master/texmf-dist/source/latex/tqft/tqft.ins
    trunk/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex
    trunk/Master/texmf-dist/tex/latex/tqft/tqft.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/tqft/tqft.pdf
    trunk/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/tqft/tqft_doc.pdf

Added: trunk/Master/texmf-dist/doc/latex/tqft/tqft.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tqft/tqft.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tqft/tqft.pdf	2017-06-04 23:47:28 UTC (rev 44454)
+++ trunk/Master/texmf-dist/doc/latex/tqft/tqft.pdf	2017-06-04 23:48:03 UTC (rev 44455)

Property changes on: trunk/Master/texmf-dist/doc/latex/tqft/tqft.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf	2017-06-04 23:47:28 UTC (rev 44454)
+++ trunk/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf	2017-06-04 23:48:03 UTC (rev 44455)

Property changes on: trunk/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/tqft/tqft_doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex	2017-06-04 23:47:28 UTC (rev 44454)
+++ trunk/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex	2017-06-04 23:48:03 UTC (rev 44455)
@@ -38,7 +38,7 @@
 
 
 \title{The \textsf{tqft} Ti\emph{k}Z Library: Documentation}
-\author{Andrew Stacey \\ \url{stacey at math.ntnu.no}}
+\author{Andrew Stacey \\ \url{loopspace at mathforge.org}}
 
 \begin{document}
 
@@ -255,8 +255,12 @@
 
 \item \DescribeMacro{incoming boundary components} The number of incoming boundary components (can be zero).
 
+\item \DescribeMacro{skip incoming boundary components} A list of incoming boundary components to be skipped.
+
 \item \DescribeMacro{outgoing boundary components} The number of outgoing boundary components (can be zero).
 
+\item \DescribeMacro{skip outgoing boundary components} A list of outgoing boundary components to be skipped.
+
 \item \DescribeMacro{offset} This offsets the first outgoing boundary component horizontally relative to the first incoming boundary component.
 It is a dimensionless number (not necessarily an integer) and is interpreted so that a value of \(1\) aligns the first outgoing boundary component with the second incoming boundary component.
 
@@ -449,6 +453,7 @@
 
 \begin{enumerate}
 \item Like \Verb+node+s, \Verb+pic+s need the \Verb+transform shape+ key to be set to take note of external transformations (other than shifts).
+Also, as the tqft pic uses nodes internally, if you use the \Verb+transform shape+ key on the pic, you might find you need to use \Verb+every node/.style={transform shape}+ as well.
 \item There is an additional \Verb+every tqft+ key which is run when the \Verb+tqft+ key is invoked (which might be via some other key).
 This is better placed than the \Verb+every pic+ key since that applies to a surrounding scope rather than to the \Verb+pic+ itself.
 \item If the \Verb+tqft+ key is invoked, either implicitly or explicitly, then the \Verb+pic type+ is set to \Verb+cobordism+.
@@ -507,6 +512,43 @@
 \end{tikzpicture}
 \end{example}
 
+\begin{example}
+\begin{tikzpicture}[
+  tqft,
+  every outgoing boundary component/.style={fill=blue!50},
+  outgoing boundary component 3/.style={fill=none,draw=red},
+  every incoming boundary component/.style={fill=green!50},
+  every lower boundary component/.style={draw,ultra thick, dashed},
+  every upper boundary component/.style={draw,purple},
+  cobordism/.style={fill=red!50},
+  cobordism edge/.style={draw},
+  genus=3,
+  hole 2/.style={ultra thick, blue},
+  view from=incoming,
+  anchor=between incoming 1 and 2
+]
+\pic[rotate=90,every node/.style={transform shape},name=a,tqft,incoming boundary components=5,skip incoming boundary components={2,4},outgoing boundary components=7,skip outgoing boundary components={2,3,5},offset=-.5];
+
+\begin{scope}[every pin edge/.style={<-}]
+\foreach \anchor/\ang in {
+  hole 1/-90,
+  hole 2/90,
+  hole 3/-90,
+  incoming boundary 3/90,
+  outgoing boundary 4/-90,
+  between last incoming and last outgoing/180,
+  between first incoming and first outgoing/180,
+  between incoming 1 and 3/90,
+  between outgoing 1 and 4/-90,
+  between outgoing 4 and 6/-90
+} {
+  \node[pin=\ang:\anchor,at=(a-\anchor),inner sep=0pt] {};
+}
+\draw[<-] (0,0) -- ++(0,3);
+\end{scope}
+\end{tikzpicture}
+\end{example}
+
 %\begin{example}
 \begin{tikzpicture}
 \pic[
@@ -942,4 +984,4 @@
 \end{tikzpicture}
 \end{example}
 
-\end{document}
\ No newline at end of file
+\end{document}

Modified: trunk/Master/texmf-dist/source/latex/tqft/tqft.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tqft/tqft.dtx	2017-06-04 23:47:28 UTC (rev 44454)
+++ trunk/Master/texmf-dist/source/latex/tqft/tqft.dtx	2017-06-04 23:48:03 UTC (rev 44455)
@@ -26,7 +26,7 @@
 \preamble
 ----------------------------------------------------------------
 tqft --- a library for drawing TQFT diagrams with TikZ/PGF
-E-mail: stacey at math.ntnu.no
+E-mail: loopspace at mathforge.org
 Released under the LaTeX Project Public License v1.3c or later
 See http://www.latex-project.org/lppl.txt
 ----------------------------------------------------------------
@@ -34,7 +34,7 @@
 \endpreamble
 \postamble
 
-Copyright (C) 2011 by Andrew Stacey <stacey at math.ntnu.no>
+Copyright (C) 2011 by Andrew Stacey <loopspace at mathforge.org>
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License (LPPL), either
@@ -83,7 +83,7 @@
 %</internal>
 %<*package>
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tqft}[2014/04/07 v2.0 Tikz/PGF commands for drawing TQFT diagrams]
+\ProvidesPackage{tqft}[2017/06/01 v2.1 Tikz/PGF commands for drawing TQFT diagrams]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -109,7 +109,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{2418}
+% \CheckSum{2577}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -130,6 +130,7 @@
 %
 % \changes{1.0}{2011/05/03}{Converted to DTX file}
 % \changes{2.0}{2014/04/07}{Converted nodes to pics}
+% \changes{2.1}{2017/06/01}{Can skip boundary components}
 %
 % \DoNotIndex{\newcommand,\newenvironment}
 %
@@ -136,7 +137,7 @@
 % \providecommand*{\url}{\texttt}
 % \GetFileInfo{tqft.dtx}
 % \title{The \textsf{tqft} package: codebase}
-% \author{Andrew Stacey \\ \url{stacey at math.ntnu.no}}
+% \author{Andrew Stacey \\ \url{loopspace at mathforge.org}}
 %
 % \maketitle
 %
@@ -1313,6 +1314,8 @@
 %    \begin{macrocode}
   incoming boundary components/.initial=5,
   outgoing boundary components/.initial=4,
+  skip incoming boundary components/.initial={},
+  skip outgoing boundary components/.initial={},
   genus/.initial = 0,
 %    \end{macrocode}
 % This is the ``horizontal'' offset of the first outgoing component from the first incoming one.
@@ -1448,6 +1451,15 @@
 %    \begin{macrocode}
       \global\let\tqft at alist\pgfutil at gobble
 %    \end{macrocode}
+% These will be lists of the boundary components, divided into sets as to whether or not they are rendered.  For the outgoing ones, we need too lists because they are rendered in the opposite order to how they are labelled.
+%    \begin{macrocode}
+      \global\let\tqft at ibdrylist=\pgfutil at gobble
+      \global\let\tqft at cibdrylist=\pgfutil at gobble
+      \global\let\tqft at obdrylist=\pgfutil at gobble
+      \global\let\tqft at cobdrylist=\pgfutil at gobble
+      \global\let\tqft at robdrylist=\pgfutil at gobble
+      \global\let\tqft at rcobdrylist=\pgfutil at gobble
+%    \end{macrocode}    
 % The first stage is to iterate over the incoming boundary components (if there are any), building up the various paths.
 %    \begin{macrocode}
       \ifnum\tqft at val{incoming boundary components}>0\relax
@@ -1468,13 +1480,24 @@
 %    \end{macrocode}
 % If there are more than one then for each subsequent one we add the curve between them and the corresponding arc of the boundary circle.
 %    \begin{macrocode}
-      \ifnum\tqft at val{incoming boundary components}>1\relax
-      \foreach[
+    \ifnum\tqft at val{incoming boundary components}>1\relax
+    \foreach \k in {2,...,\tqft at val{incoming boundary components}} {
+      \edef\tqft at temp{\noexpand\pgfutil at in@{,\k,}{,\tqft at val{skip incoming boundary components},}}
+      \tqft at temp
+      \ifpgfutil at in@
+      \xdef\tqft at cibdrylist{\tqft at cibdrylist,\k}
+      \else
+      \xdef\tqft at ibdrylist{\tqft at ibdrylist,\k}
+      \fi
+    }
+    \ifx\tqft at ibdrylist\pgfutil at gobble
+    \else
+    \foreach \k [
+      remember=\k as \kmo (initially 1),
         evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation} -\tqft at val{circle x radius},
-        evaluate=\k as \xppos using (\k-2)*\tqft at val{boundary separation} +\tqft at val{circle x radius},
-        evaluate=\k as \cpos using (\k-1.5)*\tqft at val{boundary separation},
-        evaluate=\k as \kmo using int(\k-1)
-      ] \k in {2,...,\tqft at val{incoming boundary components}} {
+    ] in \tqft at ibdrylist {
+      \pgfmathsetmacro\xppos{(\kmo - 1)*\tqft at val{boundary separation} + \tqft at val{circle x radius}}
+      \pgfmathsetmacro\cpos{(\xpos + \xppos)/2}
 %    \end{macrocode}
 % Add the curve and the arc.
 %    \begin{macrocode}
@@ -1501,7 +1524,8 @@
       \xdef\tqft at alist{%
         \tqft at alist,-incoming boundary \k/{(\kmo * \tqft at val{boundary separation},0)}%
       }%
-      }%
+    }%
+    \fi
       \fi
 %    \end{macrocode}
 % We're at the edge of the last incoming boundary component.
@@ -1600,13 +1624,25 @@
 %    \end{macrocode}
 % Yes, so add a curve and arc for each.
 %    \begin{macrocode}
-      \foreach[
+    \foreach \k [evaluate=\k as \ok using int(\tqft at val{outgoing boundary components} - \k + 1)] in {2,...,\tqft at val{outgoing boundary components}} {
+      \edef\tqft at temp{\noexpand\pgfutil at in@{,\ok,}{,\tqft at val{skip outgoing boundary components},}}
+      \tqft at temp
+      \ifpgfutil at in@
+      \xdef\tqft at cobdrylist{\tqft at cobdrylist,\k}
+      \else
+      \xdef\tqft at obdrylist{\tqft at obdrylist,\k}
+      \fi
+    }
+    \ifx\tqft at obdrylist\pgfutil at gobble
+    \else
+    \foreach \k [
+      remember=\k as \kmo (initially 1),
         evaluate=\k as \xpos using (\tqft at val{outgoing boundary components} - \k + \tqft at val{offset})*\tqft at val{boundary separation} + \tqft at val{circle x radius},
-        evaluate=\k as \xppos using (\tqft at val{outgoing boundary components} - \k + 1 + \tqft at val{offset})*\tqft at val{boundary separation} - \tqft at val{circle x radius},
-        evaluate=\k as \cpos using (\tqft at val{outgoing boundary components} - \k + .5 + \tqft at val{offset})*\tqft at val{boundary separation},
-        evaluate=\k as \nk using int(\tqft at val{outgoing boundary components} - \k + 1),
-        evaluate=\k as \nkpo using int(\tqft at val{outgoing boundary components} - \k + 2),
-      ] \k in {2,...,\tqft at val{outgoing boundary components}} {
+    ] in \tqft at obdrylist {
+      \pgfmathsetmacro\xppos{(\tqft at val{outgoing boundary components} - \kmo + \tqft at val{offset})*\tqft at val{boundary separation} - \tqft at val{circle x radius}}
+        \pgfmathsetmacro\cpos{(\xpos + \xppos)/2}
+        \pgfmathsetmacro\nk{int(\tqft at val{outgoing boundary components} - \k + 1)}
+        \pgfmathsetmacro\nkpo{int(\tqft at val{outgoing boundary components} - \kmo + 1)}
 %    \end{macrocode}
 % Both are added to the full path.
 %    \begin{macrocode}
@@ -1635,7 +1671,8 @@
         \tqft at alist,-outgoing boundary \nk/{(\xpos pt - \tqft at val{circle x radius},-\tqft at val{cobordism height})}%
       }%
       }%
-      \fi
+    \fi
+    \fi
 %    \end{macrocode}
 % Now we're at the end of the outgoing boundary components (well, the start actually).
 % What we do now depends on whether or not there are any incoming boundary components.
@@ -1880,8 +1917,13 @@
 %    \end{macrocode}
 % At each incoming boundary component we place an elliptical node of the right size.
 %    \begin{macrocode}
-      \ifnum\tqft at val{incoming boundary components}>0\relax
-      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in {1,...,\tqft at val{incoming boundary components}} {
+\ifnum\tqft at val{incoming boundary components}>0\relax
+\ifx\tqft at ibdrylist\pgfutil at gobble
+\xdef\tqft at ibdrylist{1}
+\else
+\xdef\tqft at ibdrylist{1,\tqft at ibdrylist}
+\fi
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at ibdrylist {
         \node[
           node contents={},
           ellipse,
@@ -1896,6 +1938,24 @@
           /tikz/tqft/incoming boundary component \k/.try
         ];
       }%
+\ifx\tqft at cibdrylist\pgfutil at gobble
+\else
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at cibdrylist {
+        \node[
+          node contents={},
+          ellipse,
+          inner sep=0pt,
+          outer sep=0pt,
+          minimum width=2*\tqft at val{circle x radius},
+          minimum height=2*\tqft at val{circle y radius},
+          at={(\xpos pt,0)},
+          name=-incoming boundary \k,
+          /tikz/tqft/every skipped boundary component/.try,
+          /tikz/tqft/every skipped incoming boundary component/.try,
+          /tikz/tqft/skipped incoming boundary component \k/.try,
+        ];
+}%
+\fi
 %    \end{macrocode}
 % Add an alias for the first.
 %    \begin{macrocode}
@@ -1905,9 +1965,17 @@
 % Same for the outgoing boundary components.
 %    \begin{macrocode}
       \ifnum\tqft at val{outgoing boundary components}>0\relax
+\ifx\tqft at obdrylist\pgfutil at gobble
+\xdef\tqft at obdrylist{1}
+\else
+\xdef\tqft at obdrylist{1,\tqft at obdrylist}
+\fi
+\foreach \k [evaluate=\k as \ok using int(\tqft at val{outgoing boundary components} - \k + 1)] in \tqft at obdrylist {
+  \xdef\tqft at robdrylist{\tqft at robdrylist,\ok}
+}
       \foreach[
-        evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary                   separation}
-      ] \k in {1,...,\tqft at val{outgoing boundary components}} {
+        evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary separation}
+      ] \k in \tqft at robdrylist {
           \node[
           node contents={},
           ellipse,
@@ -1921,7 +1989,30 @@
           /tikz/tqft/every outgoing boundary component/.try,
           /tikz/tqft/outgoing boundary component \k/.try
         ];
+}%
+\ifx\tqft at cobdrylist\pgfutil at gobble
+\else
+\foreach \k [evaluate=\k as \ok using int(\tqft at val{outgoing boundary components} - \k + 1)] in \tqft at cobdrylist {
+  \xdef\tqft at rcobdrylist{\tqft at rcobdrylist,\ok}
+}
+      \foreach[
+        evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary separation}
+      ] \k in \tqft at rcobdrylist {
+          \node[
+          node contents={},
+          ellipse,
+          inner sep=0pt,
+          outer sep=0pt,
+          minimum width=2*\tqft at val{circle x radius},
+          minimum height=2*\tqft at val{circle y radius},
+          at={(\xpos pt,-\tqft at val{cobordism height})},
+          name=-outgoing boundary \k,
+          /tikz/tqft/every skipped boundary component/.try,
+          /tikz/tqft/every skipped outgoing boundary component/.try,
+          /tikz/tqft/skipped outgoing boundary component \k/.try
+        ];
       }%
+\fi
 %    \end{macrocode}
 % Add an alias for the first.
 %    \begin{macrocode}
@@ -1931,7 +2022,7 @@
 % Now we draw the lower paths of the incoming boundary components.
 %    \begin{macrocode}
       \ifnum\tqft at val{incoming boundary components}>0\relax
-      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in {1,...,\tqft at val{incoming boundary components}} {
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at ibdrylist {
         \path[
           /tikz/tqft/every lower boundary component/.try,
           /tikz/tqft/every incoming lower boundary component/.try,
@@ -1945,7 +2036,7 @@
       \ifnum\tqft at val{outgoing boundary components}>0\relax
       \foreach[
         evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary                   separation}
-      ] \k in {1,...,\tqft at val{outgoing boundary components}} {
+      ] \k in \tqft at robdrylist {
         \path[
           /tikz/tqft/every lower boundary component/.try,
           /tikz/tqft/every outgoing lower boundary component/.try,
@@ -2016,7 +2107,7 @@
 % First, incoming.
 %    \begin{macrocode}
       \ifnum\tqft at val{incoming boundary components}>0\relax
-      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in {1,...,\tqft at val{incoming boundary components}} {
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at ibdrylist {
         \path[
           /tikz/tqft/every upper boundary component/.try,
           /tikz/tqft/every incoming upper boundary component/.try,
@@ -2030,7 +2121,7 @@
       \ifnum\tqft at val{outgoing boundary components}>0\relax
       \foreach[
         evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary                   separation}
-      ] \k in {1,...,\tqft at val{outgoing boundary components}} {
+      ] \k in \tqft at robdrylist {
         \path[
           /tikz/tqft/every upper boundary component/.try,
           /tikz/tqft/every outgoing upper boundary component/.try,

Modified: trunk/Master/texmf-dist/source/latex/tqft/tqft.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/tqft/tqft.ins	2017-06-04 23:47:28 UTC (rev 44454)
+++ trunk/Master/texmf-dist/source/latex/tqft/tqft.ins	2017-06-04 23:48:03 UTC (rev 44455)
@@ -7,7 +7,7 @@
 %% tqft.dtx  (with options: `install')
 %% ----------------------------------------------------------------
 %% tqft --- a library for drawing TQFT diagrams with TikZ/PGF
-%% E-mail: stacey at math.ntnu.no
+%% E-mail: loopspace at mathforge.org
 %% Released under the LaTeX Project Public License v1.3c or later
 %% See http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
@@ -18,7 +18,7 @@
 \preamble
 ----------------------------------------------------------------
 tqft --- a library for drawing TQFT diagrams with TikZ/PGF
-E-mail: stacey at math.ntnu.no
+E-mail: loopspace at mathforge.org
 Released under the LaTeX Project Public License v1.3c or later
 See http://www.latex-project.org/lppl.txt
 ----------------------------------------------------------------
@@ -26,7 +26,7 @@
 \endpreamble
 \postamble
 
-Copyright (C) 2011 by Andrew Stacey <stacey at math.ntnu.no>
+Copyright (C) 2011 by Andrew Stacey <loopspace at mathforge.org>
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License (LPPL), either
@@ -58,7 +58,7 @@
 \endbatchfile
 
 %% 
-%% Copyright (C) 2011 by Andrew Stacey <stacey at math.ntnu.no>
+%% Copyright (C) 2011 by Andrew Stacey <loopspace at mathforge.org>
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License (LPPL), either

Modified: trunk/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex	2017-06-04 23:47:28 UTC (rev 44454)
+++ trunk/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex	2017-06-04 23:48:03 UTC (rev 44455)
@@ -7,7 +7,7 @@
 %% tqft.dtx  (with options: `library')
 %% ----------------------------------------------------------------
 %% tqft --- a library for drawing TQFT diagrams with TikZ/PGF
-%% E-mail: stacey at math.ntnu.no
+%% E-mail: loopspace at mathforge.org
 %% Released under the LaTeX Project Public License v1.3c or later
 %% See http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
@@ -44,6 +44,8 @@
   tqft/.cd,
   incoming boundary components/.initial=5,
   outgoing boundary components/.initial=4,
+  skip incoming boundary components/.initial={},
+  skip outgoing boundary components/.initial={},
   genus/.initial = 0,
   offset/.initial=0,
   cobordism height/.initial=2cm,
@@ -130,6 +132,12 @@
       \global\let\tqft at glist\pgfutil at gobble%
       \global\let\tqft at clist\pgfutil at gobble%
       \global\let\tqft at alist\pgfutil at gobble
+      \global\let\tqft at ibdrylist=\pgfutil at gobble
+      \global\let\tqft at cibdrylist=\pgfutil at gobble
+      \global\let\tqft at obdrylist=\pgfutil at gobble
+      \global\let\tqft at cobdrylist=\pgfutil at gobble
+      \global\let\tqft at robdrylist=\pgfutil at gobble
+      \global\let\tqft at rcobdrylist=\pgfutil at gobble
       \ifnum\tqft at val{incoming boundary components}>0\relax
       \xdef\tqft at fullpath{%
         \tqft at fullpath
@@ -138,13 +146,24 @@
       \xdef\tqft at alist{%
         \tqft at alist,-incoming boundary 1/{(0,0)},-incoming boundary/{(0,0)}%
       }%
-      \ifnum\tqft at val{incoming boundary components}>1\relax
-      \foreach[
+    \ifnum\tqft at val{incoming boundary components}>1\relax
+    \foreach \k in {2,...,\tqft at val{incoming boundary components}} {
+      \edef\tqft at temp{\noexpand\pgfutil at in@{,\k,}{,\tqft at val{skip incoming boundary components},}}
+      \tqft at temp
+      \ifpgfutil at in@
+      \xdef\tqft at cibdrylist{\tqft at cibdrylist,\k}
+      \else
+      \xdef\tqft at ibdrylist{\tqft at ibdrylist,\k}
+      \fi
+    }
+    \ifx\tqft at ibdrylist\pgfutil at gobble
+    \else
+    \foreach \k [
+      remember=\k as \kmo (initially 1),
         evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation} -\tqft at val{circle x radius},
-        evaluate=\k as \xppos using (\k-2)*\tqft at val{boundary separation} +\tqft at val{circle x radius},
-        evaluate=\k as \cpos using (\k-1.5)*\tqft at val{boundary separation},
-        evaluate=\k as \kmo using int(\k-1)
-      ] \k in {2,...,\tqft at val{incoming boundary components}} {
+    ] in \tqft at ibdrylist {
+      \pgfmathsetmacro\xppos{(\kmo - 1)*\tqft at val{boundary separation} + \tqft at val{circle x radius}}
+      \pgfmathsetmacro\cpos{(\xpos + \xppos)/2}
         \xdef\tqft at fullpath{%
           \tqft at fullpath
            .. controls +(0,-\tqft at val{cobordism height}/3) and +(0,-\tqft at val{cobordism height}/3) ..  (\xpos pt,0) arc[start angle=\pgf at tqft@upper180, end angle=0, x radius=\tqft at val{circle x radius}, y radius=\tqft at val{circle y radius}]
@@ -159,7 +178,8 @@
       \xdef\tqft at alist{%
         \tqft at alist,-incoming boundary \k/{(\kmo * \tqft at val{boundary separation},0)}%
       }%
-      }%
+    }%
+    \fi
       \fi
       \ifnum\tqft at val{outgoing boundary components}>0\relax
         \pgfmathsetmacro\xppos{(\tqft at val{outgoing boundary components} -1+\tqft at val{offset}) * \tqft at val{boundary separation} +\tqft at val{circle x radius}}%
@@ -213,13 +233,25 @@
         \tqft at alist,-outgoing boundary \tqft at val{outgoing boundary components}/{(\xppos pt + \tqft at val{circle x radius},-\tqft at val{cobordism height})},-outgoing boundary/{(\tqft at val{offset}*\tqft at val{boundary separation},-\tqft at val{cobordism height})}%
       }%
       \ifnum\tqft at val{outgoing boundary components}>1\relax
-      \foreach[
+    \foreach \k [evaluate=\k as \ok using int(\tqft at val{outgoing boundary components} - \k + 1)] in {2,...,\tqft at val{outgoing boundary components}} {
+      \edef\tqft at temp{\noexpand\pgfutil at in@{,\ok,}{,\tqft at val{skip outgoing boundary components},}}
+      \tqft at temp
+      \ifpgfutil at in@
+      \xdef\tqft at cobdrylist{\tqft at cobdrylist,\k}
+      \else
+      \xdef\tqft at obdrylist{\tqft at obdrylist,\k}
+      \fi
+    }
+    \ifx\tqft at obdrylist\pgfutil at gobble
+    \else
+    \foreach \k [
+      remember=\k as \kmo (initially 1),
         evaluate=\k as \xpos using (\tqft at val{outgoing boundary components} - \k + \tqft at val{offset})*\tqft at val{boundary separation} + \tqft at val{circle x radius},
-        evaluate=\k as \xppos using (\tqft at val{outgoing boundary components} - \k + 1 + \tqft at val{offset})*\tqft at val{boundary separation} - \tqft at val{circle x radius},
-        evaluate=\k as \cpos using (\tqft at val{outgoing boundary components} - \k + .5 + \tqft at val{offset})*\tqft at val{boundary separation},
-        evaluate=\k as \nk using int(\tqft at val{outgoing boundary components} - \k + 1),
-        evaluate=\k as \nkpo using int(\tqft at val{outgoing boundary components} - \k + 2),
-      ] \k in {2,...,\tqft at val{outgoing boundary components}} {
+    ] in \tqft at obdrylist {
+      \pgfmathsetmacro\xppos{(\tqft at val{outgoing boundary components} - \kmo + \tqft at val{offset})*\tqft at val{boundary separation} - \tqft at val{circle x radius}}
+        \pgfmathsetmacro\cpos{(\xpos + \xppos)/2}
+        \pgfmathsetmacro\nk{int(\tqft at val{outgoing boundary components} - \k + 1)}
+        \pgfmathsetmacro\nkpo{int(\tqft at val{outgoing boundary components} - \kmo + 1)}
         \xdef\tqft at fullpath{%
           \tqft at fullpath
            .. controls +(0,\tqft at val{cobordism height}/3) and +(0,\tqft at val{cobordism height}/3) ..  (\xpos pt,-\tqft at val{cobordism height}) arc[end angle=\pgf at tqft@upper180, start angle=0, x radius=\tqft at val{circle x radius}, y radius=\tqft at val{circle y radius}]
@@ -236,7 +268,8 @@
         \tqft at alist,-outgoing boundary \nk/{(\xpos pt - \tqft at val{circle x radius},-\tqft at val{cobordism height})}%
       }%
       }%
-      \fi
+    \fi
+    \fi
       \ifnum\tqft at val{incoming boundary components}>0\relax
       \pgfmathsetmacro\tqft at ht{1/3 + 2/3*abs(\tqft at val{offset})/(abs(\tqft at val{offset}) + 1)}%
       \xdef\tqft at fullpath{%
@@ -375,8 +408,13 @@
 \fi
 \tikz at scan@one at point\pgfutil at firstofone\tqft at shift\relax
 \begin{scope}[shift={(-\pgf at x,-\pgf at y)}]
-      \ifnum\tqft at val{incoming boundary components}>0\relax
-      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in {1,...,\tqft at val{incoming boundary components}} {
+\ifnum\tqft at val{incoming boundary components}>0\relax
+\ifx\tqft at ibdrylist\pgfutil at gobble
+\xdef\tqft at ibdrylist{1}
+\else
+\xdef\tqft at ibdrylist{1,\tqft at ibdrylist}
+\fi
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at ibdrylist {
         \node[
           node contents={},
           ellipse,
@@ -391,12 +429,38 @@
           /tikz/tqft/incoming boundary component \k/.try
         ];
       }%
+\ifx\tqft at cibdrylist\pgfutil at gobble
+\else
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at cibdrylist {
+        \node[
+          node contents={},
+          ellipse,
+          inner sep=0pt,
+          outer sep=0pt,
+          minimum width=2*\tqft at val{circle x radius},
+          minimum height=2*\tqft at val{circle y radius},
+          at={(\xpos pt,0)},
+          name=-incoming boundary \k,
+          /tikz/tqft/every skipped boundary component/.try,
+          /tikz/tqft/every skipped incoming boundary component/.try,
+          /tikz/tqft/skipped incoming boundary component \k/.try,
+        ];
+}%
+\fi
       \path node also[pic alias=-incoming boundary] (-incoming boundary 1);
       \fi
       \ifnum\tqft at val{outgoing boundary components}>0\relax
+\ifx\tqft at obdrylist\pgfutil at gobble
+\xdef\tqft at obdrylist{1}
+\else
+\xdef\tqft at obdrylist{1,\tqft at obdrylist}
+\fi
+\foreach \k [evaluate=\k as \ok using int(\tqft at val{outgoing boundary components} - \k + 1)] in \tqft at obdrylist {
+  \xdef\tqft at robdrylist{\tqft at robdrylist,\ok}
+}
       \foreach[
-        evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary                   separation}
-      ] \k in {1,...,\tqft at val{outgoing boundary components}} {
+        evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary separation}
+      ] \k in \tqft at robdrylist {
           \node[
           node contents={},
           ellipse,
@@ -410,11 +474,34 @@
           /tikz/tqft/every outgoing boundary component/.try,
           /tikz/tqft/outgoing boundary component \k/.try
         ];
+}%
+\ifx\tqft at cobdrylist\pgfutil at gobble
+\else
+\foreach \k [evaluate=\k as \ok using int(\tqft at val{outgoing boundary components} - \k + 1)] in \tqft at cobdrylist {
+  \xdef\tqft at rcobdrylist{\tqft at rcobdrylist,\ok}
+}
+      \foreach[
+        evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary separation}
+      ] \k in \tqft at rcobdrylist {
+          \node[
+          node contents={},
+          ellipse,
+          inner sep=0pt,
+          outer sep=0pt,
+          minimum width=2*\tqft at val{circle x radius},
+          minimum height=2*\tqft at val{circle y radius},
+          at={(\xpos pt,-\tqft at val{cobordism height})},
+          name=-outgoing boundary \k,
+          /tikz/tqft/every skipped boundary component/.try,
+          /tikz/tqft/every skipped outgoing boundary component/.try,
+          /tikz/tqft/skipped outgoing boundary component \k/.try
+        ];
       }%
+\fi
       \path node also[pic alias=-outgoing boundary] (-outgoing boundary 1);
       \fi
       \ifnum\tqft at val{incoming boundary components}>0\relax
-      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in {1,...,\tqft at val{incoming boundary components}} {
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at ibdrylist {
         \path[
           /tikz/tqft/every lower boundary component/.try,
           /tikz/tqft/every incoming lower boundary component/.try,
@@ -425,7 +512,7 @@
       \ifnum\tqft at val{outgoing boundary components}>0\relax
       \foreach[
         evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary                   separation}
-      ] \k in {1,...,\tqft at val{outgoing boundary components}} {
+      ] \k in \tqft at robdrylist {
         \path[
           /tikz/tqft/every lower boundary component/.try,
           /tikz/tqft/every outgoing lower boundary component/.try,
@@ -475,7 +562,7 @@
       }
       \fi
       \ifnum\tqft at val{incoming boundary components}>0\relax
-      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in {1,...,\tqft at val{incoming boundary components}} {
+      \foreach[evaluate=\k as \xpos using (\k-1)*\tqft at val{boundary separation}] \k in \tqft at ibdrylist {
         \path[
           /tikz/tqft/every upper boundary component/.try,
           /tikz/tqft/every incoming upper boundary component/.try,
@@ -486,7 +573,7 @@
       \ifnum\tqft at val{outgoing boundary components}>0\relax
       \foreach[
         evaluate=\k as \xpos using (\k-1+\tqft at val{offset})*\tqft at val{boundary                   separation}
-      ] \k in {1,...,\tqft at val{outgoing boundary components}} {
+      ] \k in \tqft at robdrylist {
         \path[
           /tikz/tqft/every upper boundary component/.try,
           /tikz/tqft/every outgoing upper boundary component/.try,
@@ -499,7 +586,7 @@
 }
 
 %% 
-%% Copyright (C) 2011 by Andrew Stacey <stacey at math.ntnu.no>
+%% Copyright (C) 2011 by Andrew Stacey <loopspace at mathforge.org>
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License (LPPL), either

Modified: trunk/Master/texmf-dist/tex/latex/tqft/tqft.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tqft/tqft.sty	2017-06-04 23:47:28 UTC (rev 44454)
+++ trunk/Master/texmf-dist/tex/latex/tqft/tqft.sty	2017-06-04 23:48:03 UTC (rev 44455)
@@ -7,13 +7,13 @@
 %% tqft.dtx  (with options: `package')
 %% ----------------------------------------------------------------
 %% tqft --- a library for drawing TQFT diagrams with TikZ/PGF
-%% E-mail: stacey at math.ntnu.no
+%% E-mail: loopspace at mathforge.org
 %% Released under the LaTeX Project Public License v1.3c or later
 %% See http://www.latex-project.org/lppl.txt
 %% ----------------------------------------------------------------
 %% 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tqft}[2014/04/07 v2.0 Tikz/PGF commands for drawing TQFT diagrams]
+\ProvidesPackage{tqft}[2017/06/01 v2.1 Tikz/PGF commands for drawing TQFT diagrams]
 \RequirePackage{pgfkeys}
 \RequirePackage{pgf}
 \def\pgf at tqft@minus{-}
@@ -752,7 +752,7 @@
   }
 
 %% 
-%% Copyright (C) 2011 by Andrew Stacey <stacey at math.ntnu.no>
+%% Copyright (C) 2011 by Andrew Stacey <loopspace at mathforge.org>
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License (LPPL), either



More information about the tex-live-commits mailing list