I have a large diagram which I have implemented in TikZ, currently the size is 16042 × 457. If I try to add more nodes and extend the diagram horizontally, I get the Dimension too large! error and cannot compile the document. Is there a way to go around this and make the diagram larger?
I am aware that I am not providing a MWE but it is tricky as the diagram has about 300 nodes, and without them I cannot replicate the error.
Edit: here is a sample of code which gives this error:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{trees}
\usetikzlibrary{calc}
\usepackage[paperwidth=\maxdimen,paperheight=\maxdimen]{geometry}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}
\node[draw] at (0, 0) {tikz rectangle};
\node[draw] at (600, 0) {tikz circle};
\end{tikzpicture}
\end{document}
Change 600 to 500 or less, and the error disappears.



\node[draw] at (600, 0) {tikz circle};
\end{tikzpicture}}`
– Dec 27 '19 at 19:37\node[draw] at (600, 0) {tikz circle};
\end{tikzpicture}}` to shrink the nodes automatically. If you mean by "proper way" to circumvent the TeX limits on the maximal dimension once and for all, I think this would require to rewrite TeX.
– Dec 27 '19 at 20:00(600cm,0cm)= (6m, 0m) ! – Paul Gaborit Dec 28 '19 at 08:19