2

The following code gives me an unexpected capacity exceeded error, and I don't understand why...

 \[\begin{tikzpicture}[xscale=5, yscale=5.5]

node (1) at (0,0){ $\begin{tikzpicture}[xscale=0.6, yscale=0.6]

\tikzset{morphlabel/.style={draw=black, thin, rectangle, minimum width=7pt, fill=white, font=\scriptsize}}

\node[morphlabel] at (0, 0) {$a$}; \end{tikzpicture}$}; \end{tikzpicture}]

What feels really odd to me is that I use almost identical code at other places, and don't get any error message?

JeCl
  • 145
  • 3
    Please extend this to a full example others can copy and test as is. That said, using tikzpicture inside tikz picture is asking for trouble. What exactly are you trying to do? – daleif Apr 14 '21 at 07:10
  • 3
    The first node is missing a backslash. – campa Apr 14 '21 at 07:10
  • Oups... I was afraid I had made such a dumb mistake. Thanks for pointing it out! – JeCl Apr 17 '21 at 06:57

1 Answers1

2

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}

\newsavebox\mybox \begin{lrbox}{\mybox} \begin{tikzpicture}[]

    \tikzset{morphlabel/.style={draw=black, thin, rectangle, minimum width=7pt, fill=white, 
            font=\scriptsize}}

    \node[morphlabel] at (0,0) {$a$};

\end{tikzpicture} \end{lrbox}

\begin{document} \begin{tikzpicture}[]

\node (1) at (0,0){\usebox\mybox};

\end{tikzpicture} \end{document}

js bibra
  • 21,280