I want to use the list of fractions flist to label some angles. They will be in the place of the "A".

    %\edef\flist{{\frac{\pi}{6}, \frac{\pi}{4}, \frac{\pi}{3}, \frac{2\pi}{3}, \frac{3\pi}{4}, \frac{5\pi}{6}, \frac{7\pi}{6}, \frac{5\pi}{4}, \frac{4\pi}{3}, \frac{5\pi}{3}, \frac{7\pi}{4}, \frac{11\pi}{6}}}
    \foreach \a in{0,...,11}{
        \draw[cycle1] (0,0)--({\r*cos(\anglist[\a])},{\r*sin(\anglist[\a])})node[pos=1.3]{$A$};

I don't know where is the mistake, but the code above doesn't works.

  • 1
    Please don't post code fragments. Instead, put your fragments into a complete compilable document that shows the problem.
    – Alan Munn
    Aug 14, 2017 at 19:55
  • Please make a minimal working example (MWE).
    – dexteritas
    Aug 14, 2017 at 20:04
  • \frac{a}{b} is intended for typesetting a fraction, you seem to want to calculate a/b. pgfmath doesn't understand \frac, but it does understand /, so just use that. Aug 14, 2017 at 20:28

1 Answer 1


The tikz \foreach construct supports looping on pairs, precisely to allow what you wish to do.

The output

enter image description here

The code

  % join this
  %30 /\frac{\pi}{6},
  %45 /\frac{\pi}{4},
  %60 /\frac{\pi}{3},
    \foreach \cAngle/\dAngle in {30/\frac{\pi}{6},45/\frac{\pi}{4},60/\frac{\pi}{3},120/\frac{2\pi}{3},135/\frac{3\pi}{4},150/\frac{5\pi}{6},210/\frac{7\pi}{6},225/\frac{5\pi}{4},240/\frac{4\pi}{3},300/\frac{5\pi}{3},315/\frac{7\pi}{4},330/\frac{11\pi}{6}}
        \draw (0,0)--({\r*cos(\cAngle)},{\r*sin(\cAngle)}) node[pos=1.3]{$\dAngle$};

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .