9

I would like to pass the arguments

->,line width=1.2pt

to command

\draw [] ...

However, this does not work

\newcommand\newstyle{->,line width=1.2pt}
\draw[\newstyle]

Is there any way to do that?

10

Tikz options are not handled that way; if you pass a macro to \draw, it will think you meant to call a single key with the name ->,line width=1.2pt. Instead, use a real style:

\tikzset{newstyle/.style = {->,line width=1.2pt}}
\draw[newstyle] ...

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.