The following is a snippet of the original. It works..,

\usepackage{tikz} % drawing support
  \begin{tikzpicture}[yscale=-1,scale=1,label/.style={postaction={decorate,decoration={ markings, mark=at position .5 with \node #1;}} }]
    \node at (0,0) (node0) [inner sep=0pt,minimum width=1mm,circle,draw=blue] {1};                       % node#1 

The label style is primarily for edges which don't appear in the snippet above. However, I'd like to label the nodes, too: change the \node line to:

\node at (0,0) (node0) [inner sep=0pt,minimum width=1mm,circle,draw=blue] [label=60:X] {1};                       % node#1 

which is intended to put the letter "X" at a 60 degree angle from the node.

Tikz then "blesses" me with a

Package tikz Error: A node must have a (possibly empty) label text.

I've tried numerous combinations of [] {} etc, and haven't gotten the code to work.


As TikZ already has already a label option (see section 16.10 The Label and Pin Options in the pgfmanual) you can not define your own style calling it label (moreover with a different aim).

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.