GeneralLabel above (automaton) node exhausts memory

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mushishi
Posts: 7
Joined: Wed Jun 05, 2019 6:04 pm

Label above (automaton) node exhausts memory

Post by mushishi »

Hello everyone,

I have narrowed my problem to the following MWE:

Code: Select all

\begin{tikzpicture}[node distance=3cm,auto,sloped]
                \tikzstyle{initial} = [initial by arrow,initial text = {}]
                
                \node[state,initial,label=below:$\{a,b\}$] (q0s0) {$\langle q_0, s_0 \rangle$}; % this is where the problem occurs
                \node[state,label=below:$\{a,b,c\}$] (q1s3) [below of=q0s0]  {$\langle q_1, s_3 \rangle$}; % same problem here
                
                \path[->]
                (q0s0) edge node {} (q1s3);
\end{tikzpicture}
Regardless of how much I increase the memory available to texlive (2017), texstudio (2.12.10) keeps complaining with the following error:

Code: Select all

TeX capacity exceeded, sorry [input stack size=5000]. ...node[state,initial,label=below:$\{a,b\}$]
I also tried increasing all resources explicitly mentioned in the error message, such as input stack, param size, save size.
Even if I create a new document containing only the transition system from above, I still get the same error. OTOH, as soon as I remove the labels above the nodes, the error disappears.

Any ideas?

stack memory automata

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Label above (automaton) node exhausts memory

Post by Stefan Kottwitz »

Hello,

welcome to the forum!

It's probably a parsing issue of the label text with options. It is ok when the label is grouped (protected) by braces:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata}
\begin{document}
\begin{tikzpicture}[node distance=3cm,auto,sloped]
  \tikzstyle{initial} = [initial by arrow,initial text = {}]
  \node[state,initial,label={below:$\{a,b\}$}] (q0s0)
    {$\langle q_0, s_0 \rangle$};
  \node[state,label={below:$\{a,b,c\}$}] (q1s3) [below of=q0s0]
    {$\langle q_1, s_3 \rangle$}; 
  \path[->]
    (q0s0) edge node {} (q1s3);
\end{tikzpicture}
\end{document}
Stefan
LaTeX.org admin
mushishi
Posts: 7
Joined: Wed Jun 05, 2019 6:04 pm

Label above (automaton) node exhausts memory

Post by mushishi »

This was the correct solution, thanks.
The tikz manual does mention curly braces for label in chapters 3.9 and 13.9, but only when specifying additional options before the label position.
Post Reply