1

I want to create a node style, which consists of a circle with two lines (curved inwards possibly) connecting south west with south east and north west with north east.

After a bit of research, I found a way that in principle should be the solution:

\tikzset{
Vh/.style = {draw, circle, minimum size=1cm, ultra thick, text = black, path picture={%
        \draw (path picture bounding box.south east) -- (path picture bounding box.north west)
              (path picture bounding box.north east) -- (path picture bounding box.south west)
              (path picture bounding box.north east) -- (path picture bounding box.north west)
      ;}}

However, for some reason, this only produces the diagonal lines. Neither vertical nor horizontal lines work with this solution. But why? Is it a bug or am I doing it wrong? Is there a nicer solution?

3
  • Straight lines because you are using --. You need to use bend
    – CroCo
    Sep 18, 2015 at 13:18
  • Of course, thats the second step. However, with this code only two of the three (streight) lines show up! Curving the third one will be easier after it is showing up.
    – Hagadol
    Sep 18, 2015 at 13:21
  • north east to north west is the edge and the circle node inscribes that bounding box hence invisible
    – percusse
    Sep 18, 2015 at 13:30

1 Answer 1

1

You mean this?

\documentclass[a4paper,11pt]{article}
\usepackage{tikz}

\tikzset{
Vh/.style = {draw, circle, minimum size=1cm, ultra thick, text = black, path picture={%
        \draw (path picture bounding box.south east) to[bend right] (path picture bounding box.south west)
              (path picture bounding box.north east) to[bend left] (path picture bounding box.north west)
      ;}}
      }

\begin{document}
\begin{tikzpicture}
  \node[Vh] {here};
\end{tikzpicture}
\end{document}

enter image description here

The changed lines are

\draw (path picture bounding box.south east) to[bend right] (path picture bounding box.south west)
                  (path picture bounding box.north east) to[bend left] (path picture bounding box.north west)

where to[bend left/right] has been used.

3
  • Yes, thank you! Still not sure why the version I gave only produces diagonal lines but yours is working.
    – Hagadol
    Sep 18, 2015 at 13:29
  • Pay attention to --. It has been replaced with to[bend right]. As I said in my comment in your question. If this solves your problem, you should accept it an answer. More info, read the manual page 48 3.10 Connecting Nodes.
    – CroCo
    Sep 18, 2015 at 13:30
  • @Hagadol Eventhough your node is circular, it's bounding box is a square with the circle inscribed, so (path picture bounding box.north east) -- (path picture bounding box.north west) is a straight line on the edge of the square so it's "invisible" for the circular inscribed node. Sep 18, 2015 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .