diff options
author | Karl Berry <karl@freefriends.org> | 2017-06-04 23:48:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-06-04 23:48:03 +0000 |
commit | 7af991c29f681544324e8e1cfbcf107d30df717d (patch) | |
tree | f7d07df98df0540f7e10a325fb3c38b9424b7532 /Master/texmf-dist/tex/latex/tqft | |
parent | 6bac2215133832542c828065aac545050e38cfd1 (diff) |
tqft (1jun17)
git-svn-id: svn://tug.org/texlive/trunk@44455 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tqft')
-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 |
2 files changed, 114 insertions, 27 deletions
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 |