1

Within the provided code, I want to define a TiKz scope and to scale the contents of such scope.

\documentclass{beamer}
\usepackage{tikz}

\tikzstyle{result}[blue] = [draw=#1,rounded corners,align=center,label={north:\{User,Paper\}}]

\begin{document}
\begin{tikzpicture}
    \begin{scope}[scale=0.5,every node/.style={transform shape}]
        \node[result] {ciao};
    \end{scope}
\end{tikzpicture}

\end{document}

By the way, I got the following error:

Package PGF Math Error: Unknown function `north' (in 'north').

See the PGF Math package documentation for explanation. Type H for immediate help. ...

                                               l.9        \node[result] {ciao};

Is there a way to preserve the labels within the node transformation? Thanks in advance.

1

See, if the following solution work for you:

\documentclass{beamer}
\usepackage{tikz}

\begin{document}
\begin{frame}[fragile]
    \begin{tikzpicture}[
result/.style = {draw=#1, rounded corners, align=center,
                 label=above:{\{User,Paper\}}},
result/.default = blue
                        ]
    \begin{scope}[scale=0.5,every node/.append style={transform shape}]
        \node[result] {ciao};
    \end{scope}
    \end{tikzpicture}
\end{frame}
\end{document}

In this case you need to replace north with above (assuming, that with north you expect that label is above node). Since tikzstyle is deprecated I move node stale definition into tikzpicture options.

enter image description here

  • Yes, literally I just had to replace "north" with "above" in my code. Thanks for the update! – jackb Dec 24 '16 at 9:39

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.