5

In my continuing quest to draw circles and lines willy-nilly, I've made the following use of tkz-berge:

\documentclass[11pt]{standalone}
\usepackage{tkz-berge}
\usetikzlibrary{shapes,snakes,mindmap}
\definecolor{lightblue}{RGB}{160,180,200}
\definecolor{darkblue}{RGB}{110,130,150}
\begin{document}

\begin{tikzpicture}[concept, outer sep=0pt, color=lightblue, every node/.style={circle,fill={lightblue}},
                    every path/.style={circle connection bar, fill=darkblue}]
  \SetVertexNoLabel
  \begin{scope}[xshift=12cm]
    \grEmptyCycle[RA=2/sin(60)]{5}
  \end{scope}
  \AssignVertexLabel{a}{A,B,C,D,E}
  \Edges(a0,a2)
  \Edges(a3,a1)
  \Edges(a4,a0,a3)
\end{tikzpicture}
\end{document}

The goal is to duplicate the style seen in Till Tantau's 2012 talk, without dragging in LuaTeX:

till's example

Unfortunately, what the above code generates is this:

current result

If \AssignVertexLabel is commented out, the circle connection bar edges are properly positioned, but the node formatting as specified is not completely applied. No arguments for path/.style={color=} or fill= properly shade the edges; I seem to have a choice of black or nothing.

Is there a way to get this kind of style control while maintaining the relative ease of tkz-berge?

  • Great, I wanted to reproduce the example but with LuaLaTex and you provided enough details for me to get the job done. TY – Ludovic Kuty Dec 19 '15 at 16:33
3

A way to work around is to define every node style as such (where the inner sep=xx affects the filled area while the line width adjust the line thickness one desires)

every node/.style= {circle,fill={lightblue},draw=black,line width=1pt,inner sep=2.7pt}

enter image description here

Code

\documentclass[border=10pt,11pt]{standalone}
\usepackage{tkz-berge}
\usetikzlibrary{shapes,snakes,mindmap}
\definecolor{lightblue}{RGB}{160,180,200}
\definecolor{darkblue}{RGB}{110,130,150}
\begin{document}

\begin{tikzpicture}[concept, outer sep=0pt, color=lightblue, 
every node/.style= {circle,fill={lightblue},draw=black, line width=1pt,inner sep=2.7pt},
every path/.style={circle connection bar, fill=darkblue}]
  \SetVertexNoLabel
  \begin{scope}[xshift=12cm]
    \grEmptyCycle[RA=2/sin(60)]{5}
  \end{scope}
  \AssignVertexLabel{a}{A,B,C,D,E}
  \Edges(a0,a2)
  \Edges(a3,a1)
  \Edges(a4,a0,a3)
\end{tikzpicture}
\end{document}
  • This is probably the best compromise between compactness and dependency cutting. – bright-star Oct 3 '14 at 8:57
  • Yes, I think so, recalling I did try other parameters I can come up with. – Jesse Oct 3 '14 at 9:02

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.