1

I'm trying to create a mapping showing the flow of ideas in a course, something similar to this

However, whenever I try to create a long path connecting a topic with a subject, I get a "Dimension too large" error. I can't see that there's a math overflow error. It seems to be caused purely by the length of the path. In the MWE below, the troublesome line tries to connect Topic 1 to Subject 1. However, even if I try to connect Topic 1 to something further away than Section 3 (e.g. Section 2), I get the same error making me think the error has to do with the length of the path, yet I cannot see that such a restriction on path length exists in tikz.

\documentclass{beamer}
  
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
  
\usepackage[orientation=landscape,size=a0,scale=1.0]{beamerposter}

\begin{document}
\begin{frame}{} 
    \begin{tikzpicture}

        \draw[help lines,xstep=1,ystep=1] (0,0) grid (115,70);
        \foreach \x in {0,1,...,115} { \node [anchor=north] at (\x,0) {\small{\x}}; }
        \foreach \y in {0,1,...,70} { \node [anchor=east] at (0,\y) {\small{\y}}; }
    
        \node [anchor=west] at (1,66)  {\small{Topic 1}};
        \node [anchor=west] at (1,30)  {\small{Topic 2}};
        \draw (20,10) node [anchor=west] {\small{Section 1}};
        \draw (20,30) node [anchor=west] {\small{Section 2}};
        \draw (20,31) node [anchor=west] {\small{Section 3}};
        \draw (20,32) node [anchor=west] {\small{Section 4}};
        \draw (20,33) node [anchor=west] {\small{Section 5}};
        \draw (20,35) node [anchor=west] {\small{Section 6}};
        \draw (20,40) node [anchor=west] {\small{Section 7}};
        \draw (20,50) node [anchor=west] {\small{Section 8}};
    
        \draw (4.0,66) to [out=0, in=180] (20,50);
        \draw (4.0,66) to [out=0, in=180] (20,40);
        \draw (4.0,66) to [out=0, in=180] (20,35);
        \draw (4.0,66) to [out=0, in=180] (20,33);
        \draw (4.0,66) to [out=0, in=180] (20,32);
        \draw (4.0,66) to [out=0, in=180] (20,31);
%       \draw (4.0,66) to [out=0, in=180] (20,30);  % This line causes a "Dimensions too large" error
%       \draw (4.0,66) to [out=0, in=180] (20,10);  % This line causes a "Dimensions too large" error
        \draw (4.0,30) to [out=0, in=180] (20,10);

    \end{tikzpicture}
\end{frame}

\end{document}

Any help getting around this error would be greatly appreciated. I'm probably missing something really obvious.

UPDATE So this is bizarre. Following a hint in an answer to this question Dimension too large error with too many tikz marks, I just asked pdflatex to continue compiling the document and the paths appeared. Using the tracingmacros and tracingcommands commands I think the "Dimensions too large" error seems to have something to do with \pgf@ya but I don't have time to dig deeper.

7
  • Not related but you can shorten your code like this: \draw (4.0,66) to [out=0, in=180] (20,50) node [anchor=west] {\small{Section 8}};.
    – SebGlav
    Jun 2, 2021 at 17:19
  • Are you really trying to draw picture that is 115cm wide and 70cm tall? That's a bit large to fit on a beamer slide. The base units in TikZ are cm. Jun 2, 2021 at 18:17
  • Henri, I'm using the beamerposter package for creating large figures....unless I've done something exceptionally stupid. Jun 2, 2021 at 19:36
  • Just for reference, Tantau's map that I link to in the original question is 46.82 x 33.12 inches and was produced by LuaTeX (which may help solve the problem, but I've not used LuaTeX before so I'm not sure). A different, but very similar map at this link has the same size but was produced using pdflatex, so I'm not sure using LuaTeX is the solution. Jun 3, 2021 at 16:11
  • I tested with LuaLaTeX and it produces the same error. Maybe one of the internal control points of the curved edge causes the issue. A straight line works fine. By the way: I would suggest so name your nodes and use the names for the connections. This would make the figure code much more readable.
    – Gunter
    Jun 4, 2021 at 14:02

1 Answer 1

1

There is a way around this issue. Essentially you can redefine the x and y values to .5cm instead of 1cm and then scale it by a factor of 2. It is not very elegant, but compiles without errors and gives your desired output:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage[orientation=landscape,size=a0,scale=1.0]{beamerposter}

\begin{document}
    \begin{frame}{} 
        \centering
        \begin{tikzpicture}[x=1cm,y=1cm,every node/.style={font=\small}]
            \draw[help lines,xstep=1,ystep=1] (0,0) grid (115,70);
            \foreach \x in {0,1,...,115} {\node [anchor=north] at (\x,0) {\x};}
            \foreach \y in {0,1,...,70} {\node [anchor=east] at (0,\y) {\y};}
            \node[anchor=east] at (4,66)  {Topic 1};
            \node[anchor=east] at (4,30)  {Topic 2};
            \begin{scope}[every node/.style={anchor=west}]
                \draw (4.0,30) to [out=0, in=180] (20,10);
                \foreach \i/\j in {31/3, 32/4, 33/5, 35/6, 40/7, 50/8} {
                    \draw (4.0,66) to [out=0, in=180] (20,\i) node {Section \j};
                }
            \end{scope} 
            \begin{scope}[x=.5cm,y=.5cm,scale=2,every node/.style={anchor=west}]
                \foreach \i/\j in {10/1, 30/2} {
                    \draw (4.0,66) to [out=0, in=180] (20,\i) node {Section \j};
                }
            \end{scope} 
        \end{tikzpicture}
    \end{frame}
\end{document}

I also took the liberty of making your code a little bit shorter based on the comments above.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .