1

Hopefully a quick question but one I can't get to the bottom of. I'm using the code below to place a curly brace decoration, and though I can place text at it's halfway point I'd like to place on of my previous node objects.

The code is

\draw [thick,decoration={brace},decorate] 
    ([xshift=-0.1cm,yshift=0.2cm]H16.135) to
        node[midway,above] (bracket) {node[circle]}
    ([xshift=0.1cm,yshift=0.2cm]H112.45);

But where I've got node [circle] I'd like it to actually draw a circle node, rather than just display text. Can anyone point me in the right direction?

Many thanks,

2 Answers 2

2

To draw a circular node, use

... node[midway,above,draw,circle] (bracket) {node label} ...

The draw key strokes the outline of the node, and circle sets the shape.

A complete, minimal example:

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\node (H16) {};
\node (H112) at (3,0) {};
\draw[thick,decoration={brace},decorate] ([xshift=-0.1cm,yshift=0.2cm]H16.135) to
node[midway,above=1mm,draw,circle] (bracket) {}
([xshift=0.1cm,yshift=0.2cm]H112.45);
\end{tikzpicture}
\end{document}

enter image description here

2
  • If this isn't what you were after, please turn your snippet into a complete, minimal example that we can compile without any modifications, and see if you can clarify in any way. Mar 16, 2016 at 22:27
  • That's it thanks! I had tried putting circle inside the node arguments but didn't realise I needed draw in there as well. Sorry for the simple question, many thanks for the clear answer. (I'll accept when I can in 5mins) Mar 16, 2016 at 22:32
1

here is a slightly different code. I removed midway, I used raise and changed the anchors

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\node (H16) {x};
\node (H112) at (3,0) {y};
\draw[thick,decoration={brace,raise=5pt},decorate] 
   (H16.180) to node[above=8pt,draw,circle] {} (H112.0);
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.