1

When I do

    \begin{scope}[every node/.style={minimum size=1cm,draw,rectangle}]
        \node (v1) at (2,0) {$\#1 \cdot \#2$};
    \end{scope}

it works.

But when I do

   \newcommand{\operatorNode}{every node/.style={minimumcsize=1cm,draw,rectangle}}

    \begin{scope}[\operatorNode]
        \node (v1) at (2,0) {$\#1 \cdot \#2$};
    \end{scope}

I get the error: Package pgfkeys Error: I do not know the key '/tikz/every node/.style={minimum size=1cm,draw,rectangle}' and I am going to ignore it. Perhaps you misspelled it.

I think there is something strange going on in the internals. I'm working in Overleaf.

Any ideas how to solve this problem?

1 Answer 1

1

You can define a new style with :\tikzset{ operatorNode/.style={ every node/.style={minimum size=1cm,draw,rectangle} } }

An example:

\documentclass[border= 0.5cm]{standalone}
\usepackage{tikz}

%\newcommand{\operatorNode}{every node/.style={minimumcsize=1cm,draw,rectangle}}

\tikzset{
operatorNode/.style={
every node/.style={minimum size=1cm,draw,rectangle}
}
}

\begin{document}
\begin{tikzpicture}
\begin{scope}[operatorNode]
        \node (v1) at (2,0) {$\#1 \cdot \#2$};
    \end{scope}
\end{tikzpicture}
\end{document}

You must log in to answer this question.

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