2

How can I define a style, in which two arguments take pairwise values in a list? In my case, the style is

\tikzset{
    loop/.style 2 args={decoration={markings,
        mark=at position {#1} with {\arrow{>},
        \node[anchor=\pgfdecoratedangle-90] {$p_{#2}$};}},
        postaction={decorate}}
}

1 Answer 1

3

Aha, I just figured it out. This works:

\documentclass[tikz]{standalone}

\usetikzlibrary{decorations.markings}

\tikzset{
    loop/.style 2 args={thick,decoration={markings,
        mark=at position {0.0625*#1} with {\arrow{>},
        \node[anchor=\pgfdecoratedangle-90,font=\footnotesize] {$p_{#2}$};}},
        postaction={decorate}}
}

\begin{document}
\begin{tikzpicture}

    \draw[loop/.list={{1}{6},{3}{1},{5}{2},{7}{3},{10}{4},{14}{5}}] (0,0) circle (1);

\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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