0
\begin{tikzpicture}[x={(0.5cm, 0cm)}, y={(0cm, 0.5cm)}, z={(0.25cm, 0.25cm)}]
...
\end{tikzpicture}

Works

\newcommand{\kosXYZ}{[x=\{(0.5cm, 0cm)\}, y=\{(0cm, 0.5cm)\}, z=\{(0.25cm, 0.25cm)\}]}

\begin{tikzpicture}\kosXYZ
...
\end{tikzpicture}

Doesn't

How and why?

1 Answers1

1

Why it does not work? \kosXYZ is not expanded at the time when \begin{tikzpicture} 's optional argument is searched. Seems it should be.

Perhaps like this:

\newcommand\Exchange[2]{#2#1}%
\newcommand\Expandsecond[2]{\expandafter\Exchange\expandafter{#2}{#1}}%

\newcommand{\kosXYZ}{[x={(0.5cm, 0cm)}, y={(0cm, 0.5cm)}, z={(0.25cm, 0.25cm)}]}

\Expandsecond{\begin{tikzpicture}}{\kosXYZ}
...
\end{tikzpicture}
Ulrich Diez
  • 28,770