Example: The tkz-berge graph package

Published 2007-05-08 | Author: Alain Matthes

The tkz-berge package is a set of convenient macros for drawing typical textbook graphs. It is built on top of TikZ' node and edge constructs, but adds several shortcuts for placing, arranging and connecting vertices. Visit the package's home page to see more examples.

Documentation only available in French. However, the code and the numerous examples speak for themselves.

Author:Alain Matthes

Download as: [PDF] [TEX]  •  [Open in writeLaTeX]

The tkz-berge graph package

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de.

% The tkz-berge graph package
% Author: Alain Matthes (http://altermundus.fr/)

\begin{tikzpicture}[scale=0.75,transform shape]
  \tikzstyle{EdgeStyle}=[bend left]
  \tikzstyle{EdgeStyle}=[bend right]
\begin{tikzpicture}[scale=0.75,transform shape]
  \tikzstyle{every node}=[node distance = 4cm,%
                          bend angle    = 45,%
                          fill          = gray!30]
  \tikzstyle{EdgeStyle}=[pre and post]
  \tikzstyle{EdgeStyle}=[pre and post,bend right]


  • #1 Oliver Schrenk, June 25, 2010 at 11:25 p.m.

    I wanted to use this example as a template for my graphs, but I have some problems converting it.

    I'm converting the document via $ wget http://media.texample.net/tikz/examples/TEX/tkz-berge.tex $ xelatex tkz-berge.tex

    I'm using MaxTex 2009 on OSX. I followed the installation manual as far as I could, installing the missing .sty like so

    wget http://altermundus.com/downloads/packages/tkz-graph.sty wget http://altermundus.com/downloads/packages/tkz-arith.sty wget http://altermundus.com/downloads/packages/tkz-berge.sty sudo mkdir /usr/local/texlive/2009/texmf-dist/tex/latex/prof sudo mv tkz-* /usr/local/texlive/2009/texmf-dist/tex/latex/prof sudo texhash

    Before I installed the .sty files I got error messages. Obviously!

    Now I got

    ! Package pgf Error: No shape named K is known.

    Any hints for resolving the issue?

  • #2 Oliver Schrenk, June 29, 2010 at 12:20 a.m.

    Another developer/user was so nice to point out

    The example uses round braces for the last argument of \Vertex


    The examples in TKZdoc-graph.pdf uses curly braces:


    It helped me at least.

  • #3 KaharoryHar, January 24, 2012 at 12:54 p.m.

    Good evening!
    Happy New Year! Health, luck and love!

Adding comments is currently not enabled.



Preorder discount 35%
coupon code LXCB35

LaTeX Beginners Guide

Limited discount 50%
coupon code tDRet6Y

click here to read whole story

Creative Commons License