1

I need to draw a diagram that has more than 15 nested graph, but i have this error :

! TeX capacity exceeded, sorry [text input levels=15].
l.2 ...rfaceToDisplay.resumeGraphDrawingCoroutine()}

l.94 \end{tikzpicture}

17938 words of node memory still in use:
539 hlist, 28 vlist, 29 rule, 2386 glue, 14 kern, 15 penalty, 62 glyph, 
113 glue_spec, 3 temp, 1 write, 14 local_par, 4 dir, 516 pdf_literal, 
33 pdf_refximage, 57 pdf_colorstack nodes avail lists:   
1:7,2:26,3:11,4:11,5:1,6:7,7:2,9:8
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on netwworkmap.log.enter code here

I use lualatex and pgf 3.0.0. Here is an exemple tex file

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{graphs, graphdrawing}
\usegdlibrary{trees, layered}
\usepackage{epstopdf}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}
\begin{document}
\begin{tikzpicture} [layered layout, grow=right, level distance=5cm, sibling sep=.5em, sibling distance=1cm, subgraph nodes={red, draw}]

    \node [label=center:Internet] (internet) {\includegraphics{cloud}};
    \node [label=above:router] (router) {\includegraphics{router}};

    \node [label=above:switch 1] (switch1) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 10] (pc10) {\includegraphics{pc}};

    \node [label=above:switch 2] (switch2) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 20] (pc20) {\includegraphics{pc}};
    \node [label=above:pc 21] (pc21) {\includegraphics{pc}};

    \node [label=above:switch 3] (switch3) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 30] (pc30) {\includegraphics{pc}};

    \node [label=above:switch 4] (switch4) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 40] (pc40) {\includegraphics{pc}};

    \node [label=above:switch 5] (switch5) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 50] (pc50) {\includegraphics{pc}};

    \node [label=above:switch 6] (switch6) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 60] (pc60) {\includegraphics{pc}};

    \node [label=above:switch 7] (switch7) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 70] (pc70) {\includegraphics{pc}};

    \node [label=above:switch 8] (switch8) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 80] (pc80) {\includegraphics{pc}};

    \node [label=above:switch 9] (switch9) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 90] (pc90) {\includegraphics{pc}};

    \node [label=above:switch 10] (switch10) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 100] (pc100) {\includegraphics{pc}};

    \node [label=above:switch 11] (switch11) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 110] (pc110) {\includegraphics{pc}};

    \node [label=above:switch 12] (switch12) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 120] (pc120) {\includegraphics{pc}};

    \node [label=above:switch 13] (switch13) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 130] (pc130) {\includegraphics{pc}};

    \node [label=above:switch 14] (switch14) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 140] (pc140) {\includegraphics{pc}};

    \node [label=above:switch 15] (switch15) {\includegraphics{workgroup_switch}};
    \node [label=above:pc 150] (pc150) {\includegraphics{pc}};

    \graph [use existing nodes] {
        internet -- router;
        router -- switch1;
        router -- switch2;
        router -- switch3;
        router -- switch4;
        router -- switch5;
        router -- switch6;
        router -- switch7;
        router -- switch8;
        router -- switch9;
        router -- switch10;
        router -- switch11;
        router -- switch12;
        router -- switch13;
        router -- switch14;
        router -- switch15;
        Lab 1 // [tree layout] {switch1; pc10; switch1 -- pc10;};
        Lab 2 // [tree layout] {switch2; pc20; pc21; switch2 -- pc20; switch2 -- pc21;};
        Lab 3 // [tree layout] {switch3; pc30; switch3 -- pc30;};
        Lab 4 // [tree layout] {switch4; pc40; switch4 -- pc40;};
        Lab 5 // [tree layout] {switch5; pc50; switch5 -- pc50;};
        Lab 6 // [tree layout] {switch6; pc60; switch6 -- pc60;};
        Lab 7 // [tree layout] {switch7; pc70; switch7 -- pc70;};
        Lab 8 // [tree layout] {switch8; pc80; switch8 -- pc80;};
        Lab 9 // [tree layout] {switch9; pc90; switch9 -- pc90;};
        Lab 10 // [tree layout] {switch10; pc100; switch10 -- pc100;};
        Lab 11 // [tree layout] {switch11; pc110; switch11 -- pc110;};
        Lab 12 // [tree layout] {switch12; pc120; switch12 -- pc120;};
        Lab 13 // [tree layout] {switch13; pc130; switch13 -- pc130;};
        Lab 14 // [tree layout] {switch14; pc140; switch14 -- pc140;};
        Lab 15 // [tree layout] {switch15; pc150; switch15 -- pc150;};
    };
\end{tikzpicture}
\end{document}

How can I do to pass this limit?

thanks

Justin
  • 43
  • It works with miktex (even if I use the files from the texlive texmf-dist-tree) but not with texlive2014. The problem in texlive seems to be the setting max_in_open = 15 in texmf.cnf. If I change this to max_in_open = 30 your example works. But I have some doubts that it is safe to do this generally (http://tex.stackexchange.com/questions/6091/how-to-increase-the-tex-open-file-limit) and I don't if and how you could restrict such a change to luatex (and if it is safe there ...). – Ulrike Fischer Feb 11 '15 at 09:41
  • Addition: miktex sets max_in_open to 50 (http://docs.miktex.org/2.9/manual/texdefaults.html). So it looks as if a larger value doesn't harm. But you could ask on the texlive list for a confirmation. – Ulrike Fischer Feb 11 '15 at 09:56
  • The comments in the answer referenced by @UlrikeFischer are misleading. The limit on 16 streams open for \read is fixed in the syntax of TeX and not expandable the limit here applies (as well) to \input and is changeable as a system limit without implying changes are needed to the latex read allocation system. – David Carlisle Feb 11 '15 at 11:07
  • @DavidCarlisle: I already suspected this as miktex seems to work fine with a value of 50 but thanks for the confirmation. Did I got it right that max_in_open if for "nested" inputs, when an input file inputs another which inputs another? I never thought about it but now I wonder how tex handles it without opening a new read stream for each file. Does it keep the outer file in memory? – Ulrike Fischer Feb 11 '15 at 11:16
  • @UlrikeFischer it opens streams at the operating system level (up to the limit here) but only a subset of those are exposed to \read which is limited to 16 just by the syntax rules of tex. – David Carlisle Feb 11 '15 at 11:42
  • thanks @UlrikeFischer and @DavidCarlisle. I put max_in_open = 30 in /etc/texmf/texmf.d/00debian.cnf and run sudo update-texmf and works very well for me. – Justin Feb 11 '15 at 18:10

0 Answers0