LaTeX forum ⇒ GeneralLabel above (automaton) node exhausts memory Topic is solved

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

Label above (automaton) node exhausts memory

Postby mushishi » Wed Nov 06, 2019 10:53 pm

Hello everyone,

I have narrowed my problem to the following MWE:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{tikzpicture}[node distance=3cm,auto,sloped]
  2. \tikzstyle{initial} = [initial by arrow,initial text = {}]
  4. \node[state,initial,label=below:$\{a,b\}$] (q0s0) {$\langle q_0, s_0 \rangle$}; % this is where the problem occurs
  5. \node[state,label=below:$\{a,b,c\}$] (q1s3) [below of=q0s0] {$\langle q_1, s_3 \rangle$}; % same problem here
  7. \path[->]
  8. (q0s0) edge node {} (q1s3);
  9. \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] [Expand/Collapse] [Download] ({untitled.tex})
  1. 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

User avatar
Stefan Kottwitz
Site Admin
Posts: 9593
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Nov 07, 2019 8:14 am


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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \usetikzlibrary{automata}
  4. \begin{document}
  5. \begin{tikzpicture}[node distance=3cm,auto,sloped]
  6. \tikzstyle{initial} = [initial by arrow,initial text = {}]
  7. \node[state,initial,label={below:$\{a,b\}$}] (q0s0)
  8. {$\langle q_0, s_0 \rangle$};
  9. \node[state,label={below:$\{a,b,c\}$}] (q1s3) [below of=q0s0]
  10. {$\langle q_1, s_3 \rangle$};
  11. \path[->]
  12. (q0s0) edge node {} (q1s3);
  13. \end{tikzpicture}
  14. \end{document}

Stefan admin

Posts: 2
Joined: Wed Jun 05, 2019 6:04 pm

Postby mushishi » Thu Nov 07, 2019 10:00 am

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.

Return to “General”

Who is online

Users browsing this forum: No registered users and 10 guests