From what I have read so far, a Dimension too large! is caused by a result or an intermediate calculation that goes beyond the limit of 16384.
I get this error with this document (note: the doubledash setting comes from this answer; and using 2pt instead of 2.5pt does not solve the case.):
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{angles,decorations.markings}
\tikzset{doubledash/.style={decoration={ markings, %
mark= at position 0.5
with{
\draw (-1pt,-2.5pt) -- (-1pt,2.5pt);
\draw (1pt,-2.5pt) -- (1pt,2.5pt);
} },
pic actions/.append code=\tikzset{postaction=decorate}}}
\begin{document}
\begin{tikzpicture}
% Text font size
\scriptsize
% Declare Points
\coordinate (G) at (0,0);
\coordinate (U) at (1.5,0);
\coordinate (M) at (0.75,0.661);
% Draw IsoscelesTriangle
\draw[thick] (G)
-- (U)
-- (M)
-- cycle
pic [draw, thick, angle radius = 0.25 cm, doubledash] {angle = U--G--M}
pic [draw, thick, angle radius = 0.25 cm, doubledash] {angle = M--U--G};
% Label Points
\draw (G) node[left] {G};
\draw (U) node[right] {U};
\draw (M) node[above] {M};
\end{tikzpicture}
\end{document}
Exact error message:
! Dimension too large.
<to be read again>
\relax
l.31 ...ius = 0.25 cm, doubledash] {angle = U--G--M}
The doubledash hatchmarks seem necessary to get the error, if both of them are removed, then the document compiles:
I guess the 16384 limit has been reached by some internal calculation were the doubledash is involved, but how exactly, I have no idea...
It's worth noticing that other pictures did compile while preserving the doubledash but that some of them required to round the coordinates to the tenth, what, in the case of an isosceles triangle, is not really satisfying since the triangle then looks slightly slanted. In the example above, this solution actually "works" too, but required to round the coordinates of M to the unit, what is even worse (after that, the triangle doesn't look isosceles at all!).
Some more context
I am currently working on a software library (written in python) that creates such TikZ code in an automated way and I need to be able to anticipate when this error will be triggered, in order to produce a compilable picture. It's not possible to try to compile the produced code and then try again and again with slightly different values until it's "ok" (and the picture maybe quite different than expected).
Question
How to ensure that the document will compile before trying to compile?
EDIT: from Zarcos' answer, it seems that increasing the angle's radius solves the problem. But how is it possible to anticipate which minimal value will be required for the picture to compile well? (The 1st example requires 0.35 cm, and the 2d example, below, requires 0.85 cm).
Extra example that does not compile, yet with a larger radius
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{angles,decorations.markings,quotes}
\tikzset{doubledash/.style={decoration={ markings, %
mark= at position 0.5
with{
\draw (-1pt,-2pt) -- (-1pt,2pt);
\draw (1pt,-2pt) -- (1pt,2pt);
} },
pic actions/.append code=\tikzset{postaction=decorate}}}
\begin{document}
\begin{tikzpicture}
% Text font size
\scriptsize
% Declare Points
\coordinate (A) at (0,0);
\coordinate (E) at (-1.35,1.609);
\coordinate (F) at (-1.837,1.018);
% Draw Angles
\draw[thick] (E) -- (A) -- (F)
pic ["$\alpha$", draw, angle eccentricity=1.3333, angle radius = 0.84 cm, thick, doubledash] {angle = E--A--F};
% Label Points
\draw (A) node[below] {A};
\draw (E) node[above] {E};
\draw (F) node[below left] {F};
\end{tikzpicture}
\end{document}




angle radiusseems to work, but4 mmis not enough is another document (I add it as an extra example) where using1 cminstead or0.84 cmis enough. How to anticipate the minimal radius value? – zezollo Feb 28 '18 at 08:41