# pgf/tikz dimension too large

Ajat Adriansyah shared this question 1 year ago

Hi, I made the following configuration in Geogebra:

and I would like to include it on my latex file.

I "download as" tikz/pgf and it can't compile, you may see the latex code in sharelatex here:

The above is really the vanilla file geogebra-export.txt without any modification, so the errors should be from geogebra.

The logs indicate that "something is too large", and I'm not really sure how to scale them.

Thank You

Ajat.

Okay what do you have to do in order to make this work in LaTeX:

• you have to substitute each occurrence of $$with  thats a GGb-error (GGb greates Math-Text-Nodes as base and includes the Math-Formated LaTeX by copy paste without thinking) (you found that issue already) • in order to see all the created Tikz content you should change the first line \documentclass[10pt]{article} to \documentclass[tikz,border=10pt]{standalone} that creates a standalone tikz picture • the next issue is in line 15 you have here a quite steep line and GGb sets the domain of drawing equal to the domain of the picture... well this leads to a verrrrrry large line in computation, solution: change the domain to domain=-5:5, this is also a GGb error as the visible domain of that function is much smaller and Tikz complains on all platforms if you do that • i would recommend to scale the graphed picture and modify the font size, you can do that by modifying the \begin{tikzpicture} arguments : add ,font=\Huge,scale=0.50 there (you have to play here a bit with the font sizes and the scale factor as it might look bad on some combinations or you need some font size reserves) (or delete the \begin{scriptsize} and \end{scriptsize}) • lastly you have to modify the circles from line 28 onwards change the size to maybe 8pt • bonus if you dont want that triangle filled you have to change the \fill in line 12 to \draw (modifying the width property might be also necessary) \documentclass[tikz,border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666} \definecolor{rvwvcq}{rgb}{0.08235294117647059,0.396078431372549,0.7529411764705882} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,font=\large,scale=0.25] \clip(-25,-28) rectangle (35,28); \draw[line width=4pt,color=rvwvcq] (-9.117199479490878,-0.3187065436130529) -- (-1.7142620079664708,7.295743427097774) -- (21.33530932391174,0.5464830451503161) -- cycle; \draw [line width=2pt] (-1.7142620079664708,7.295743427097774)-- (-9.117199479490878,-0.3187065436130529); \draw [line width=2pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(-0.7029030273003228--0.33464028251330147*\x)/11.778500668015564}); \draw [line width=0.4pt,domain=-5:5] plot(\x,{(--17.749986564398217--11.778500668015564*\x)/-0.33464028251330147}); \draw [line width=2pt] (-9.117199479490878,-0.3187065436130529)-- (-1.5040722786402216,-0.10240914642221062); \draw [line width=2pt,color=rvwvcq] (-9.117199479490878,-0.3187065436130529)-- (-1.7142620079664708,7.295743427097774); \draw [line width=2pt,color=rvwvcq] (-1.7142620079664708,7.295743427097774)-- (21.33530932391174,0.5464830451503161); \draw [line width=2pt,color=rvwvcq] (21.33530932391174,0.5464830451503161)-- (-9.117199479490878,-0.3187065436130529); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--162.1051286676891-7.402937471524408*\x)/7.614449970710827}); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--207.99650630121292--23.049571331878212*\x)/6.749260381947458}); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--67.063094695441--7.614449970710827*\x)/7.402937471524408}); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(-156.59375788732595--6.749260381947458*\x)/-23.049571331878212}); \draw [line width=2pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--152.55391605679307--6.655344525314801*\x)/12.591693878653874}); \draw [line width=1.6pt] (6.337833868947355,-7.938558265025991) circle (17.231372436856493cm); \draw [line width=2pt] (2.084337812900165,13.362556632162143) circle (4.490269410895694cm); \draw [fill=black] (-1.7142620079664708,7.295743427097774) circle (8pt); \draw[color=black] (-2.7713331834939128,8.431426910006454) node {A}; \draw [fill=black] (-9.117199479490878,-0.3187065436130529) circle (8pt); \draw[color=black] (-10.059477116614278,0.9173199081665) node {B}; \draw [fill=black] (-1.5040722786402216,-0.10240914642221062) circle (8pt); \draw[color=black] (-0.5572135076092448,-1.5873824257801514) node {A_{1}}; \draw [fill=black] (21.33530932391174,0.5464830451503161) circle (8pt); \draw[color=black] (22.598788102684573,1.8449874392578525) node {C}; \draw [fill=black] (-2.1718199014403203,23.400636458687018) circle (8pt); \draw[color=black] (-0.6494684941044393,23.645174419904635) node {H}; \draw [fill=black] (6.112654612540066,15.34628623676165) circle (8pt); \draw[color=black] (6.269655493035147,17.70810222091998) node {B_{1}}; \draw [fill=black] (-6.4790392661138085,8.690941711446849) circle (8pt); \draw[color=black] (-7.107317548768054,10.657828984625699) node {C_{1}}; \draw [fill=black] (-1.9430409547033956,15.348189942892397) circle (8pt); \draw[color=black] (-3.601628061950663,15.667233652519002) node {M}; \draw [fill=uuuuuu] (-1.823807375352225,11.15146627445053) circle (8pt); \draw[color=uuuuuu] (-3.601628061950663,11.492729762607917) node {K}; \draw [fill=black] (2.963614957956796,8.959218002825686) circle (8pt); \draw[color=black] (3.594260884674507,10.379528725298293) node {T}; \end{tikzpicture} \end{document} ## Comments (11) 1 Does it work if you delete the line with the error? 1 It 'works' (there were another errors like$$A$$should be changed to A ), but obviously there's a catch. As a result a line is removed on my figure. Also I wonder what happen to the opacity option in tikz? The polygon is now fulfilled with blue colour, and some lines' thickness are way off. I remember geogebra -> pgf/tikz, was near perfect few years ago (I used it on my project on 2014). Thank you Ajat 1 What's the line with the error (that you removed)? 1 this one: \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--17.749986564398217--11.778500668015564*\x)/-0.33464028251330147}); here is the log from TexShop: ./ukro.tex:15: Dimension too large. <recently read> \pgf@yy l.15 ...778500668015564*\x)/-0.334 I used MacTex 2020 1 What happens if you truncate the numbers eg change 42.34872238993235 to 42.34 1 Still got (the same) error 1 OK, seems to be a Tikz limitation rather than a GeoGebra bug as far as I can see, Does zooming the figure out (in?) and rescaling it in GeoGebra help? 1 Zooming doesn't do anything. I wonder if there is a way to make the Geogebra use x-digit rounding for coordinates. Also as this is a geogebra to tikz feature, doesn't it make the geogebra problem to adjust this conversion so that it will works on tikz? thank you Ajat 1 Not if it doesn't fix it, as your previous message suggests. I think that you either need to figure out what small change is needed to make it work or submit a bug report to sharelatex etc 1 For the moment I'll use -Loco- 's solution Thank you for the responds. 1 Okay what do you have to do in order to make this work in LaTeX: • you have to substitute each occurrence of$$ with $thats a GGb-error (GGb greates Math-Text-Nodes as base and includes the Math-Formated LaTeX by copy paste without thinking) (you found that issue already) • in order to see all the created Tikz content you should change the first line \documentclass[10pt]{article} to \documentclass[tikz,border=10pt]{standalone} that creates a standalone tikz picture • the next issue is in line 15 you have here a quite steep line and GGb sets the domain of drawing equal to the domain of the picture... well this leads to a verrrrrry large line in computation, solution: change the domain to domain=-5:5, this is also a GGb error as the visible domain of that function is much smaller and Tikz complains on all platforms if you do that • i would recommend to scale the graphed picture and modify the font size, you can do that by modifying the \begin{tikzpicture} arguments : add ,font=\Huge,scale=0.50 there (you have to play here a bit with the font sizes and the scale factor as it might look bad on some combinations or you need some font size reserves) (or delete the \begin{scriptsize} and \end{scriptsize}) • lastly you have to modify the circles from line 28 onwards change the size to maybe 8pt • bonus if you dont want that triangle filled you have to change the \fill in line 12 to \draw (modifying the width property might be also necessary) \documentclass[tikz,border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666} \definecolor{rvwvcq}{rgb}{0.08235294117647059,0.396078431372549,0.7529411764705882} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,font=\large,scale=0.25] \clip(-25,-28) rectangle (35,28); \draw[line width=4pt,color=rvwvcq] (-9.117199479490878,-0.3187065436130529) -- (-1.7142620079664708,7.295743427097774) -- (21.33530932391174,0.5464830451503161) -- cycle; \draw [line width=2pt] (-1.7142620079664708,7.295743427097774)-- (-9.117199479490878,-0.3187065436130529); \draw [line width=2pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(-0.7029030273003228--0.33464028251330147*\x)/11.778500668015564}); \draw [line width=0.4pt,domain=-5:5] plot(\x,{(--17.749986564398217--11.778500668015564*\x)/-0.33464028251330147}); \draw [line width=2pt] (-9.117199479490878,-0.3187065436130529)-- (-1.5040722786402216,-0.10240914642221062); \draw [line width=2pt,color=rvwvcq] (-9.117199479490878,-0.3187065436130529)-- (-1.7142620079664708,7.295743427097774); \draw [line width=2pt,color=rvwvcq] (-1.7142620079664708,7.295743427097774)-- (21.33530932391174,0.5464830451503161); \draw [line width=2pt,color=rvwvcq] (21.33530932391174,0.5464830451503161)-- (-9.117199479490878,-0.3187065436130529); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--162.1051286676891-7.402937471524408*\x)/7.614449970710827}); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--207.99650630121292--23.049571331878212*\x)/6.749260381947458}); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--67.063094695441--7.614449970710827*\x)/7.402937471524408}); \draw [line width=0.4pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(-156.59375788732595--6.749260381947458*\x)/-23.049571331878212}); \draw [line width=2pt,domain=-42.34872238993235:54.70352340301226] plot(\x,{(--152.55391605679307--6.655344525314801*\x)/12.591693878653874}); \draw [line width=1.6pt] (6.337833868947355,-7.938558265025991) circle (17.231372436856493cm); \draw [line width=2pt] (2.084337812900165,13.362556632162143) circle (4.490269410895694cm); \draw [fill=black] (-1.7142620079664708,7.295743427097774) circle (8pt); \draw[color=black] (-2.7713331834939128,8.431426910006454) node {$A$}; \draw [fill=black] (-9.117199479490878,-0.3187065436130529) circle (8pt); \draw[color=black] (-10.059477116614278,0.9173199081665) node {$B$}; \draw [fill=black] (-1.5040722786402216,-0.10240914642221062) circle (8pt); \draw[color=black] (-0.5572135076092448,-1.5873824257801514) node {$A_{1}$}; \draw [fill=black] (21.33530932391174,0.5464830451503161) circle (8pt); \draw[color=black] (22.598788102684573,1.8449874392578525) node {$C$}; \draw [fill=black] (-2.1718199014403203,23.400636458687018) circle (8pt); \draw[color=black] (-0.6494684941044393,23.645174419904635) node {$H$}; \draw [fill=black] (6.112654612540066,15.34628623676165) circle (8pt); \draw[color=black] (6.269655493035147,17.70810222091998) node {$B_{1}$}; \draw [fill=black] (-6.4790392661138085,8.690941711446849) circle (8pt); \draw[color=black] (-7.107317548768054,10.657828984625699) node {$C_{1}$}; \draw [fill=black] (-1.9430409547033956,15.348189942892397) circle (8pt); \draw[color=black] (-3.601628061950663,15.667233652519002) node {$M$}; \draw [fill=uuuuuu] (-1.823807375352225,11.15146627445053) circle (8pt); \draw[color=uuuuuu] (-3.601628061950663,11.492729762607917) node {$K$}; \draw [fill=black] (2.963614957956796,8.959218002825686) circle (8pt); \draw[color=black] (3.594260884674507,10.379528725298293) node {$T\$};
\end{tikzpicture}

\end{document}