5

I'm using Andrew Stacey's wonderful TQFT package to create pictures of cobordisms. But I'm having trouble with the boundaries:

enter image description here

\documentclass{article}

\usepackage{tikz}
\usepackage{tqft}

\begin{document}
    \begin{tikzpicture}
        \node[draw,tqft/reverse pair of pants,boundary lower style={draw,dashed}] (A) {};
        \node[label={below:should be solid}] at (A.outgoing boundary 1) {};
    \end{tikzpicture}
\end{document}

My drawing convention for cobordisms is that the boundaries that are covered by the cobordism are dashed, and all that are visible should be solid. The above is how far I came - nearly all circles come out correctly, but the bottom circle should be completely solid. Is there a key for only styling the outgoing lower boundary?

Turion
  • 4,622
  • Are you using the latest version of TikZ (3.0), by the way? If so, I've rewritten the TQFT code to make use of the pic syntax that has now been introduced and with the rewrite I've added more styling options such as would fix this. It's ready for testing from http://bazaar.launchpad.net/~tex-sx/tex-sx/development/files (run tex on tqft-pic.dtx and look at tqft-pic_test.tex for examples) but I need to test it and rewrite the documentation before unleashing it on CTAN. – Andrew Stacey Apr 02 '14 at 11:48

3 Answers3

4

You define a global setting for lower boundary via every ... key. So you need to overwrite it.

\documentclass{standalone}

\usepackage{tikz}
\usepackage{tqft}

\begin{document}
    \begin{tikzpicture}[every tqft/.style={draw,boundary lower style={draw,dashed}}]% DASHED!!!
        \node[tqft/pair of pants] (A) {};
        \node[tqft/reverse pair of pants,anchor=incoming boundary 1,
                    boundary lower style={draw,solid}% SOLID AGAIN HERE !!
                    ] (B) at (A.outgoing boundary 1) {};
        \node[label={below:should be solid}] at (B.outgoing boundary 1) {};
    \end{tikzpicture}
\end{document}

enter image description here

percusse
  • 157,807
  • That's not what I mean. Only the outgoing boundary of the lower, reverse pants should be solid. – Turion Mar 26 '14 at 23:56
  • @Turion Oops didn't even notice that. I'll check again. – percusse Mar 27 '14 at 06:29
  • I simplified the example so it's clearer what I want to achieve. – Turion Mar 27 '14 at 14:53
  • 1
    @Turion I found where the problem is and it is not possible to distinguish incoming and outgoing lower styles. If you want I can paste the problematic part but it's gonna be messy. Better I delete the answer and we call Andrew Stacey for a patch, what do you say? – percusse Mar 27 '14 at 19:30
  • Yes, calling Andrew Stacey is a good idea. But I would be sorry to see your answer deleted. I think I'll post a workaround instead so that your answer can stay as a reference. – Turion Mar 28 '14 at 12:28
2

It is possible to work around this issue by drawing an additional boundary circle over the pair of pants (Thanks to Andrew Stacey to point this out):

\documentclass{article}

\usepackage{tikz}
\usepackage{tqft}

\begin{document}
    \begin{tikzpicture}
        \node[draw,tqft/reverse pair of pants,boundary lower style={draw,dashed}] (A) {};
        \node[tqft boundary circle,draw] at (A.outgoing boundary 1) {};
        \node[label={below:should be solid}] at (A.outgoing boundary 1) {};
    \end{tikzpicture}
\end{document}

enter image description here

Turion
  • 4,622
1

I have (on 7th April 2014) uploaded a new version of the tqft package to CTAN. Once it propagates throughout the system, the following will achieve the desired result.

\documentclass{article}
%\url{http://tex.stackexchange.com/q/167836/86}
\usepackage{tikz}
\usetikzlibrary{tqft}

\begin{document}
    \begin{tikzpicture}
        \pic[
  draw,
  tqft/reverse pair of pants,
  every lower boundary component/.style={draw},
  every incoming lower boundary component/.style={dashed},
  every outgoing lower boundary component/.style={solid},
  name=A
];
        \node[label={below:is solid}] at (A-outgoing boundary 1) {};
    \end{tikzpicture}
\end{document}

This revision (which required TikZ3.0 or later) introduces far more styling possibilities. In essence, any segment of the cobordism paths can be separately styled.

TQFT with separate styling

Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751