Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to draw the lower part of a split circle node differently: I want it to have a double-style border, whereas the upper nodepart stays the same.

I've read this but cannot tell how to modify it to draw an extra border. Also it doesn't appear to be the most generic solution for styling the lower semicircle of a circle node separately.

share|improve this question
    
Unfortunately, you can't apply different drawing styles to different parts of the node, they always apply to all the lines of the node. You'll have to create a new node shape. If you edit your question to include an example of what you want the node to look like, and add more details to the requirements (are all the lines the same colour? Do you want to be able to change the line styles of the double line?), someone might be able to help. –  Jake Jun 6 '12 at 14:03

1 Answer 1

up vote 8 down vote accepted

Update

Now the code is more efficient with Jake's idea.

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{shapes,calc}
\begin{document}

\begin{tikzpicture}
  \node [circle split,
         draw,
         minimum width=4cm,
         append after command={%
          let \p1=($(\tikzlastnode.east)-(\tikzlastnode.west)$) in  
              node[draw,
                   shape=semicircle,
                   rotate=180,
                   anchor=south,
                   double,
                   minimum width=\x1] at (\tikzlastnode.center)     {}}]
  {top
    \nodepart{lower}
    below
  };
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
The line horizontal is always with double style –  Alain Matthes Jun 6 '12 at 17:31
    
Very nice pragmatic approach! –  Jake Jun 6 '12 at 17:33
    
@Jake Thanks! it's not obvious to find another approach, perhaps it's possible to add an arc... Do you know if it's easy to recuperate the radius of the tikzlastnode ? (to draw an arc or to avoid minimum width for the second node) –  Alain Matthes Jun 6 '12 at 17:43
1  
You can add let \p1=($(\tikzlastnode.east)-(\tikzlastnode.west)$) in before the semicircle node command, and then set the minimum width=\x1. Requires the use of the calc library. –  Jake Jun 6 '12 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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