diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/tqft/tqft.pdf (renamed from Master/texmf-dist/doc/latex/tqft/tqft_doc.pdf) | bin | 428822 -> 460464 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tqft/tqft_code.pdf | bin | 0 -> 281351 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tqft/tqft_doc.tex | 46 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/tqft/tqft.dtx | 145 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/tqft/tqft.ins | 8 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex | 135 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tqft/tqft.sty | 6 |
7 files changed, 280 insertions, 60 deletions
diff --git a/Master/texmf-dist/doc/latex/tqft/tqft_doc.pdf b/Master/texmf-dist/doc/latex/tqft/tqft.pdf Binary files differindex 3c3eebfb290..7b5ab55652b 100644 --- a/Master/texmf-dist/doc/latex/tqft/tqft_doc.pdf +++ b/Master/texmf-dist/doc/latex/tqft/tqft.pdf diff --git a/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf b/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf Binary files differnew file mode 100644 index 00000000000..cd380f75470 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tqft/tqft_code.pdf diff --git a/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex b/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex index e463c3027ef..97c7ff541cb 100644 --- a/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex +++ b/Master/texmf-dist/doc/latex/tqft/tqft_doc.tex @@ -38,7 +38,7 @@ \title{The \textsf{tqft} Ti\emph{k}Z Library: Documentation} -\author{Andrew Stacey \\ \url{stacey@math.ntnu.no}} +\author{Andrew Stacey \\ \url{loopspace@mathforge.org}} \begin{document} @@ -255,8 +255,12 @@ With no offset (q.v.), this would be the distance between the centres of the fir \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 @@ outgoing boundary 4/below right} \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 @@ Use \Verb+transform shape+ and apply your own transformation. \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 @@ This shouldn't happen, or should happen by design not by accident. \end{tikzpicture} \end{example} -\end{document}
\ No newline at end of file +\end{document} diff --git a/Master/texmf-dist/source/latex/tqft/tqft.dtx b/Master/texmf-dist/source/latex/tqft/tqft.dtx index 4db565611b9..dc471eed3d8 100644 --- a/Master/texmf-dist/source/latex/tqft/tqft.dtx +++ b/Master/texmf-dist/source/latex/tqft/tqft.dtx @@ -26,7 +26,7 @@ This package defines some shapes useful for drawing TQFT diagrams with TikZ/PGF. \preamble ---------------------------------------------------------------- tqft --- a library for drawing TQFT diagrams with TikZ/PGF -E-mail: stacey@math.ntnu.no +E-mail: loopspace@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 @@ See http://www.latex-project.org/lppl.txt \endpreamble \postamble -Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no> +Copyright (C) 2011 by Andrew Stacey <loopspace@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 @@ and the derived files tqft.ins, %</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 @@ and the derived files tqft.ins, %</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,13 +130,14 @@ and the derived files tqft.ins, % % \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} % % \providecommand*{\url}{\texttt} % \GetFileInfo{tqft.dtx} % \title{The \textsf{tqft} package: codebase} -% \author{Andrew Stacey \\ \url{stacey@math.ntnu.no}} +% \author{Andrew Stacey \\ \url{loopspace@mathforge.org}} % % \maketitle % @@ -1313,6 +1314,8 @@ and the derived files tqft.ins, % \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 @@ and the derived files tqft.ins, % \begin{macrocode} \global\let\tqft@alist\pgfutil@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@ibdrylist=\pgfutil@gobble + \global\let\tqft@cibdrylist=\pgfutil@gobble + \global\let\tqft@obdrylist=\pgfutil@gobble + \global\let\tqft@cobdrylist=\pgfutil@gobble + \global\let\tqft@robdrylist=\pgfutil@gobble + \global\let\tqft@rcobdrylist=\pgfutil@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@val{incoming boundary components}>0\relax @@ -1468,13 +1480,24 @@ and the derived files tqft.ins, % \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@val{incoming boundary components}>1\relax - \foreach[ + \ifnum\tqft@val{incoming boundary components}>1\relax + \foreach \k in {2,...,\tqft@val{incoming boundary components}} { + \edef\tqft@temp{\noexpand\pgfutil@in@{,\k,}{,\tqft@val{skip incoming boundary components},}} + \tqft@temp + \ifpgfutil@in@ + \xdef\tqft@cibdrylist{\tqft@cibdrylist,\k} + \else + \xdef\tqft@ibdrylist{\tqft@ibdrylist,\k} + \fi + } + \ifx\tqft@ibdrylist\pgfutil@gobble + \else + \foreach \k [ + remember=\k as \kmo (initially 1), evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation} -\tqft@val{circle x radius}, - evaluate=\k as \xppos using (\k-2)*\tqft@val{boundary separation} +\tqft@val{circle x radius}, - evaluate=\k as \cpos using (\k-1.5)*\tqft@val{boundary separation}, - evaluate=\k as \kmo using int(\k-1) - ] \k in {2,...,\tqft@val{incoming boundary components}} { + ] in \tqft@ibdrylist { + \pgfmathsetmacro\xppos{(\kmo - 1)*\tqft@val{boundary separation} + \tqft@val{circle x radius}} + \pgfmathsetmacro\cpos{(\xpos + \xppos)/2} % \end{macrocode} % Add the curve and the arc. % \begin{macrocode} @@ -1501,7 +1524,8 @@ and the derived files tqft.ins, \xdef\tqft@alist{% \tqft@alist,-incoming boundary \k/{(\kmo * \tqft@val{boundary separation},0)}% }% - }% + }% + \fi \fi % \end{macrocode} % We're at the edge of the last incoming boundary component. @@ -1600,13 +1624,25 @@ and the derived files tqft.ins, % \end{macrocode} % Yes, so add a curve and arc for each. % \begin{macrocode} - \foreach[ + \foreach \k [evaluate=\k as \ok using int(\tqft@val{outgoing boundary components} - \k + 1)] in {2,...,\tqft@val{outgoing boundary components}} { + \edef\tqft@temp{\noexpand\pgfutil@in@{,\ok,}{,\tqft@val{skip outgoing boundary components},}} + \tqft@temp + \ifpgfutil@in@ + \xdef\tqft@cobdrylist{\tqft@cobdrylist,\k} + \else + \xdef\tqft@obdrylist{\tqft@obdrylist,\k} + \fi + } + \ifx\tqft@obdrylist\pgfutil@gobble + \else + \foreach \k [ + remember=\k as \kmo (initially 1), evaluate=\k as \xpos using (\tqft@val{outgoing boundary components} - \k + \tqft@val{offset})*\tqft@val{boundary separation} + \tqft@val{circle x radius}, - evaluate=\k as \xppos using (\tqft@val{outgoing boundary components} - \k + 1 + \tqft@val{offset})*\tqft@val{boundary separation} - \tqft@val{circle x radius}, - evaluate=\k as \cpos using (\tqft@val{outgoing boundary components} - \k + .5 + \tqft@val{offset})*\tqft@val{boundary separation}, - evaluate=\k as \nk using int(\tqft@val{outgoing boundary components} - \k + 1), - evaluate=\k as \nkpo using int(\tqft@val{outgoing boundary components} - \k + 2), - ] \k in {2,...,\tqft@val{outgoing boundary components}} { + ] in \tqft@obdrylist { + \pgfmathsetmacro\xppos{(\tqft@val{outgoing boundary components} - \kmo + \tqft@val{offset})*\tqft@val{boundary separation} - \tqft@val{circle x radius}} + \pgfmathsetmacro\cpos{(\xpos + \xppos)/2} + \pgfmathsetmacro\nk{int(\tqft@val{outgoing boundary components} - \k + 1)} + \pgfmathsetmacro\nkpo{int(\tqft@val{outgoing boundary components} - \kmo + 1)} % \end{macrocode} % Both are added to the full path. % \begin{macrocode} @@ -1635,7 +1671,8 @@ and the derived files tqft.ins, \tqft@alist,-outgoing boundary \nk/{(\xpos pt - \tqft@val{circle x radius},-\tqft@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 @@ and the derived files tqft.ins, % \end{macrocode} % At each incoming boundary component we place an elliptical node of the right size. % \begin{macrocode} - \ifnum\tqft@val{incoming boundary components}>0\relax - \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in {1,...,\tqft@val{incoming boundary components}} { +\ifnum\tqft@val{incoming boundary components}>0\relax +\ifx\tqft@ibdrylist\pgfutil@gobble +\xdef\tqft@ibdrylist{1} +\else +\xdef\tqft@ibdrylist{1,\tqft@ibdrylist} +\fi + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@ibdrylist { \node[ node contents={}, ellipse, @@ -1896,6 +1938,24 @@ and the derived files tqft.ins, /tikz/tqft/incoming boundary component \k/.try ]; }% +\ifx\tqft@cibdrylist\pgfutil@gobble +\else + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@cibdrylist { + \node[ + node contents={}, + ellipse, + inner sep=0pt, + outer sep=0pt, + minimum width=2*\tqft@val{circle x radius}, + minimum height=2*\tqft@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 @@ and the derived files tqft.ins, % Same for the outgoing boundary components. % \begin{macrocode} \ifnum\tqft@val{outgoing boundary components}>0\relax +\ifx\tqft@obdrylist\pgfutil@gobble +\xdef\tqft@obdrylist{1} +\else +\xdef\tqft@obdrylist{1,\tqft@obdrylist} +\fi +\foreach \k [evaluate=\k as \ok using int(\tqft@val{outgoing boundary components} - \k + 1)] in \tqft@obdrylist { + \xdef\tqft@robdrylist{\tqft@robdrylist,\ok} +} \foreach[ - evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} - ] \k in {1,...,\tqft@val{outgoing boundary components}} { + evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} + ] \k in \tqft@robdrylist { \node[ node contents={}, ellipse, @@ -1921,7 +1989,30 @@ and the derived files tqft.ins, /tikz/tqft/every outgoing boundary component/.try, /tikz/tqft/outgoing boundary component \k/.try ]; +}% +\ifx\tqft@cobdrylist\pgfutil@gobble +\else +\foreach \k [evaluate=\k as \ok using int(\tqft@val{outgoing boundary components} - \k + 1)] in \tqft@cobdrylist { + \xdef\tqft@rcobdrylist{\tqft@rcobdrylist,\ok} +} + \foreach[ + evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} + ] \k in \tqft@rcobdrylist { + \node[ + node contents={}, + ellipse, + inner sep=0pt, + outer sep=0pt, + minimum width=2*\tqft@val{circle x radius}, + minimum height=2*\tqft@val{circle y radius}, + at={(\xpos pt,-\tqft@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 @@ and the derived files tqft.ins, % Now we draw the lower paths of the incoming boundary components. % \begin{macrocode} \ifnum\tqft@val{incoming boundary components}>0\relax - \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in {1,...,\tqft@val{incoming boundary components}} { + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@ibdrylist { \path[ /tikz/tqft/every lower boundary component/.try, /tikz/tqft/every incoming lower boundary component/.try, @@ -1945,7 +2036,7 @@ and the derived files tqft.ins, \ifnum\tqft@val{outgoing boundary components}>0\relax \foreach[ evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} - ] \k in {1,...,\tqft@val{outgoing boundary components}} { + ] \k in \tqft@robdrylist { \path[ /tikz/tqft/every lower boundary component/.try, /tikz/tqft/every outgoing lower boundary component/.try, @@ -2016,7 +2107,7 @@ and the derived files tqft.ins, % First, incoming. % \begin{macrocode} \ifnum\tqft@val{incoming boundary components}>0\relax - \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in {1,...,\tqft@val{incoming boundary components}} { + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@ibdrylist { \path[ /tikz/tqft/every upper boundary component/.try, /tikz/tqft/every incoming upper boundary component/.try, @@ -2030,7 +2121,7 @@ and the derived files tqft.ins, \ifnum\tqft@val{outgoing boundary components}>0\relax \foreach[ evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} - ] \k in {1,...,\tqft@val{outgoing boundary components}} { + ] \k in \tqft@robdrylist { \path[ /tikz/tqft/every upper boundary component/.try, /tikz/tqft/every outgoing upper boundary component/.try, diff --git a/Master/texmf-dist/source/latex/tqft/tqft.ins b/Master/texmf-dist/source/latex/tqft/tqft.ins index 492c5cf097d..2eb5352bf85 100644 --- a/Master/texmf-dist/source/latex/tqft/tqft.ins +++ b/Master/texmf-dist/source/latex/tqft/tqft.ins @@ -7,7 +7,7 @@ %% tqft.dtx (with options: `install') %% ---------------------------------------------------------------- %% tqft --- a library for drawing TQFT diagrams with TikZ/PGF -%% E-mail: stacey@math.ntnu.no +%% E-mail: loopspace@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@math.ntnu.no +E-mail: loopspace@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 @@ See http://www.latex-project.org/lppl.txt \endpreamble \postamble -Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no> +Copyright (C) 2011 by Andrew Stacey <loopspace@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 @@ and the derived files tqft.ins, \endbatchfile %% -%% Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no> +%% Copyright (C) 2011 by Andrew Stacey <loopspace@mathforge.org> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either diff --git a/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex b/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex index 24dcfb1bd46..8eb6cdae31b 100644 --- a/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex +++ b/Master/texmf-dist/tex/latex/tqft/tikzlibrarytqft.code.tex @@ -7,7 +7,7 @@ %% tqft.dtx (with options: `library') %% ---------------------------------------------------------------- %% tqft --- a library for drawing TQFT diagrams with TikZ/PGF -%% E-mail: stacey@math.ntnu.no +%% E-mail: loopspace@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@glist\pgfutil@gobble% \global\let\tqft@clist\pgfutil@gobble% \global\let\tqft@alist\pgfutil@gobble + \global\let\tqft@ibdrylist=\pgfutil@gobble + \global\let\tqft@cibdrylist=\pgfutil@gobble + \global\let\tqft@obdrylist=\pgfutil@gobble + \global\let\tqft@cobdrylist=\pgfutil@gobble + \global\let\tqft@robdrylist=\pgfutil@gobble + \global\let\tqft@rcobdrylist=\pgfutil@gobble \ifnum\tqft@val{incoming boundary components}>0\relax \xdef\tqft@fullpath{% \tqft@fullpath @@ -138,13 +146,24 @@ \xdef\tqft@alist{% \tqft@alist,-incoming boundary 1/{(0,0)},-incoming boundary/{(0,0)}% }% - \ifnum\tqft@val{incoming boundary components}>1\relax - \foreach[ + \ifnum\tqft@val{incoming boundary components}>1\relax + \foreach \k in {2,...,\tqft@val{incoming boundary components}} { + \edef\tqft@temp{\noexpand\pgfutil@in@{,\k,}{,\tqft@val{skip incoming boundary components},}} + \tqft@temp + \ifpgfutil@in@ + \xdef\tqft@cibdrylist{\tqft@cibdrylist,\k} + \else + \xdef\tqft@ibdrylist{\tqft@ibdrylist,\k} + \fi + } + \ifx\tqft@ibdrylist\pgfutil@gobble + \else + \foreach \k [ + remember=\k as \kmo (initially 1), evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation} -\tqft@val{circle x radius}, - evaluate=\k as \xppos using (\k-2)*\tqft@val{boundary separation} +\tqft@val{circle x radius}, - evaluate=\k as \cpos using (\k-1.5)*\tqft@val{boundary separation}, - evaluate=\k as \kmo using int(\k-1) - ] \k in {2,...,\tqft@val{incoming boundary components}} { + ] in \tqft@ibdrylist { + \pgfmathsetmacro\xppos{(\kmo - 1)*\tqft@val{boundary separation} + \tqft@val{circle x radius}} + \pgfmathsetmacro\cpos{(\xpos + \xppos)/2} \xdef\tqft@fullpath{% \tqft@fullpath .. controls +(0,-\tqft@val{cobordism height}/3) and +(0,-\tqft@val{cobordism height}/3) .. (\xpos pt,0) arc[start angle=\pgf@tqft@upper180, end angle=0, x radius=\tqft@val{circle x radius}, y radius=\tqft@val{circle y radius}] @@ -159,7 +178,8 @@ \xdef\tqft@alist{% \tqft@alist,-incoming boundary \k/{(\kmo * \tqft@val{boundary separation},0)}% }% - }% + }% + \fi \fi \ifnum\tqft@val{outgoing boundary components}>0\relax \pgfmathsetmacro\xppos{(\tqft@val{outgoing boundary components} -1+\tqft@val{offset}) * \tqft@val{boundary separation} +\tqft@val{circle x radius}}% @@ -213,13 +233,25 @@ \tqft@alist,-outgoing boundary \tqft@val{outgoing boundary components}/{(\xppos pt + \tqft@val{circle x radius},-\tqft@val{cobordism height})},-outgoing boundary/{(\tqft@val{offset}*\tqft@val{boundary separation},-\tqft@val{cobordism height})}% }% \ifnum\tqft@val{outgoing boundary components}>1\relax - \foreach[ + \foreach \k [evaluate=\k as \ok using int(\tqft@val{outgoing boundary components} - \k + 1)] in {2,...,\tqft@val{outgoing boundary components}} { + \edef\tqft@temp{\noexpand\pgfutil@in@{,\ok,}{,\tqft@val{skip outgoing boundary components},}} + \tqft@temp + \ifpgfutil@in@ + \xdef\tqft@cobdrylist{\tqft@cobdrylist,\k} + \else + \xdef\tqft@obdrylist{\tqft@obdrylist,\k} + \fi + } + \ifx\tqft@obdrylist\pgfutil@gobble + \else + \foreach \k [ + remember=\k as \kmo (initially 1), evaluate=\k as \xpos using (\tqft@val{outgoing boundary components} - \k + \tqft@val{offset})*\tqft@val{boundary separation} + \tqft@val{circle x radius}, - evaluate=\k as \xppos using (\tqft@val{outgoing boundary components} - \k + 1 + \tqft@val{offset})*\tqft@val{boundary separation} - \tqft@val{circle x radius}, - evaluate=\k as \cpos using (\tqft@val{outgoing boundary components} - \k + .5 + \tqft@val{offset})*\tqft@val{boundary separation}, - evaluate=\k as \nk using int(\tqft@val{outgoing boundary components} - \k + 1), - evaluate=\k as \nkpo using int(\tqft@val{outgoing boundary components} - \k + 2), - ] \k in {2,...,\tqft@val{outgoing boundary components}} { + ] in \tqft@obdrylist { + \pgfmathsetmacro\xppos{(\tqft@val{outgoing boundary components} - \kmo + \tqft@val{offset})*\tqft@val{boundary separation} - \tqft@val{circle x radius}} + \pgfmathsetmacro\cpos{(\xpos + \xppos)/2} + \pgfmathsetmacro\nk{int(\tqft@val{outgoing boundary components} - \k + 1)} + \pgfmathsetmacro\nkpo{int(\tqft@val{outgoing boundary components} - \kmo + 1)} \xdef\tqft@fullpath{% \tqft@fullpath .. controls +(0,\tqft@val{cobordism height}/3) and +(0,\tqft@val{cobordism height}/3) .. (\xpos pt,-\tqft@val{cobordism height}) arc[end angle=\pgf@tqft@upper180, start angle=0, x radius=\tqft@val{circle x radius}, y radius=\tqft@val{circle y radius}] @@ -236,7 +268,8 @@ \tqft@alist,-outgoing boundary \nk/{(\xpos pt - \tqft@val{circle x radius},-\tqft@val{cobordism height})}% }% }% - \fi + \fi + \fi \ifnum\tqft@val{incoming boundary components}>0\relax \pgfmathsetmacro\tqft@ht{1/3 + 2/3*abs(\tqft@val{offset})/(abs(\tqft@val{offset}) + 1)}% \xdef\tqft@fullpath{% @@ -375,8 +408,13 @@ \fi \tikz@scan@one@point\pgfutil@firstofone\tqft@shift\relax \begin{scope}[shift={(-\pgf@x,-\pgf@y)}] - \ifnum\tqft@val{incoming boundary components}>0\relax - \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in {1,...,\tqft@val{incoming boundary components}} { +\ifnum\tqft@val{incoming boundary components}>0\relax +\ifx\tqft@ibdrylist\pgfutil@gobble +\xdef\tqft@ibdrylist{1} +\else +\xdef\tqft@ibdrylist{1,\tqft@ibdrylist} +\fi + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@ibdrylist { \node[ node contents={}, ellipse, @@ -391,12 +429,38 @@ /tikz/tqft/incoming boundary component \k/.try ]; }% +\ifx\tqft@cibdrylist\pgfutil@gobble +\else + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@cibdrylist { + \node[ + node contents={}, + ellipse, + inner sep=0pt, + outer sep=0pt, + minimum width=2*\tqft@val{circle x radius}, + minimum height=2*\tqft@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@val{outgoing boundary components}>0\relax +\ifx\tqft@obdrylist\pgfutil@gobble +\xdef\tqft@obdrylist{1} +\else +\xdef\tqft@obdrylist{1,\tqft@obdrylist} +\fi +\foreach \k [evaluate=\k as \ok using int(\tqft@val{outgoing boundary components} - \k + 1)] in \tqft@obdrylist { + \xdef\tqft@robdrylist{\tqft@robdrylist,\ok} +} \foreach[ - evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} - ] \k in {1,...,\tqft@val{outgoing boundary components}} { + evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} + ] \k in \tqft@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@cobdrylist\pgfutil@gobble +\else +\foreach \k [evaluate=\k as \ok using int(\tqft@val{outgoing boundary components} - \k + 1)] in \tqft@cobdrylist { + \xdef\tqft@rcobdrylist{\tqft@rcobdrylist,\ok} +} + \foreach[ + evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} + ] \k in \tqft@rcobdrylist { + \node[ + node contents={}, + ellipse, + inner sep=0pt, + outer sep=0pt, + minimum width=2*\tqft@val{circle x radius}, + minimum height=2*\tqft@val{circle y radius}, + at={(\xpos pt,-\tqft@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@val{incoming boundary components}>0\relax - \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in {1,...,\tqft@val{incoming boundary components}} { + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@ibdrylist { \path[ /tikz/tqft/every lower boundary component/.try, /tikz/tqft/every incoming lower boundary component/.try, @@ -425,7 +512,7 @@ \ifnum\tqft@val{outgoing boundary components}>0\relax \foreach[ evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} - ] \k in {1,...,\tqft@val{outgoing boundary components}} { + ] \k in \tqft@robdrylist { \path[ /tikz/tqft/every lower boundary component/.try, /tikz/tqft/every outgoing lower boundary component/.try, @@ -475,7 +562,7 @@ } \fi \ifnum\tqft@val{incoming boundary components}>0\relax - \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in {1,...,\tqft@val{incoming boundary components}} { + \foreach[evaluate=\k as \xpos using (\k-1)*\tqft@val{boundary separation}] \k in \tqft@ibdrylist { \path[ /tikz/tqft/every upper boundary component/.try, /tikz/tqft/every incoming upper boundary component/.try, @@ -486,7 +573,7 @@ \ifnum\tqft@val{outgoing boundary components}>0\relax \foreach[ evaluate=\k as \xpos using (\k-1+\tqft@val{offset})*\tqft@val{boundary separation} - ] \k in {1,...,\tqft@val{outgoing boundary components}} { + ] \k in \tqft@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@math.ntnu.no> +%% Copyright (C) 2011 by Andrew Stacey <loopspace@mathforge.org> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either diff --git a/Master/texmf-dist/tex/latex/tqft/tqft.sty b/Master/texmf-dist/tex/latex/tqft/tqft.sty index a85df63cc49..48d46c33b24 100644 --- a/Master/texmf-dist/tex/latex/tqft/tqft.sty +++ b/Master/texmf-dist/tex/latex/tqft/tqft.sty @@ -7,13 +7,13 @@ %% tqft.dtx (with options: `package') %% ---------------------------------------------------------------- %% tqft --- a library for drawing TQFT diagrams with TikZ/PGF -%% E-mail: stacey@math.ntnu.no +%% E-mail: loopspace@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@tqft@minus{-} @@ -752,7 +752,7 @@ } %% -%% Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no> +%% Copyright (C) 2011 by Andrew Stacey <loopspace@mathforge.org> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either |