
我是第一次使用 geogebra,當我將 PGF/TikZ 程式碼放入背頁時出現錯誤。確切的錯誤是
輸入行 306 上的浮點數對於頁面來說太大了 455.39223pt。
main.tex,第 304 行第 304--305 行段落中的 \hbox 過滿(1140.459pt 太寬)
下面是程式碼(請注意,顯示的最後一行 '\end{figure}' 對應於第 306 行,如上面的錯誤所示:
\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{ffcctt}{rgb}{1,0.8,0.2}
\definecolor{ffqqqq}{rgb}{1,0,0}
\definecolor{yqyqyq}{rgb}{0.5019607843137255,0.5019607843137255,0.5019607843137255}
\definecolor{uququq}{rgb}{0.25098039215686274,0.25098039215686274,0.25098039215686274}
\begin{figure}[!ht]
\begin{center}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\clip(-29.15527732052291,-20.111903557751653) rectangle (27.437297647521294,18.136500246696393);
\draw [line width=2pt,color=yqyqyq] (0,0) circle (6cm);
\draw [line width=2pt,color=ffqqqq] (0,6)-- (-4.336291901416994,-4.146875033770055);
\draw [line width=2pt,color=ffcctt] (0,6)-- (-2.2142787553979884,-5.576465690147581);
\draw [line width=2pt,color=ffcctt] (0,6)-- (2.190703198420197,-5.585769373723867);
\draw [line width=2pt,color=qqqqff] (0,6)-- (4.206985190994306,-4.277999018554656);
\draw (-0.10585670954964947,7.431250799319233) node[anchor=north west] {v};
\draw (-5.055017258085835,-3.9195413283017766) node[anchor=north west] {x};
\draw (-2.580436983817742,-5.533398028911399) node[anchor=north west] {y};
\draw (2.5301092347794056,-5.210626688789474) node[anchor=north west] {w};
\draw (4.628122945571919,-3.8657461049481223) node[anchor=north west] {z};
\draw [shift={(0,0)},line width=2pt,color=ffqqqq] plot[domain=3.904665970656774:4.334406131420695,variable=\t]({1*6*cos(\t r)+0*6*sin(\t r)},{0*6*cos(\t r)+1*6*sin(\t r)});
\draw [shift={(0,0)},line width=2pt,color=qqqqff] plot[domain=5.08614767141132:5.4894179862449555,variable=\t]({1*6*cos(\t r)+0*6*sin(\t r)},{0*6*cos(\t r)+1*6*sin(\t r)});
\draw [color=ffqqqq](-3.3335701107689006,1.3523905603563229) node[anchor=north west] {$c_1$};
\draw [color=ffqqqq](-3.8715223443054425,-4.726469678606588) node[anchor=north west] {$c_1$};
\draw [color=ffcctt](-1.0741707299154248,-0.1000804701923371) node[anchor=north west] {$c_3$};
\draw [color=ffcctt](0.48589074734054655,-0.1000804701923371) node[anchor=north west] {$c_3$};
\draw [color=qqqqff](2.5301092347794056,1.2985953370026688) node[anchor=north west] {$c_2$};
\draw [color=qqqqff](3.4446280317915265,-4.726469678606588) node[anchor=north west] {$c_2$};
\begin{scriptsize}
\draw [fill=uququq] (0,6) circle (2.5pt);
\draw [fill=uququq] (-4.336291901416994,-4.146875033770055) circle (2.5pt);
\draw [fill=uququq] (-2.2142787553979884,-5.576465690147581) circle (2.5pt);
\draw [fill=uququq] (2.190703198420197,-5.585769373723867) circle (2.5pt);
\draw [fill=uququq] (4.206985190994306,-4.277999018554656) circle (2.5pt);
\end{scriptsize}
\end{tikzpicture}
\end{center}
\end{figure}
還有其他幾篇關於從 geogebra 導入時圖像大小的文章,但是答案似乎給出了正確的代碼,但沒有解釋一般如何處理這些錯誤或它是如何出現的,所以我不確定如何處理我的例子。
答案1
我認為在您的情況下 TeX 輸出相當有幫助。事實上,您想要渲染的 tikzpicture 的大小為 5m 寬和 3,8m 高,這可能不是您想要的(「太大」)。我建議簡單地刪除該行
\clip(-29.15527732052291,-20.111903557751653) rectangle (27.437297647521294,18.136500246696393);
此命令將 tikz 圖片的大小調整為指定的矩形(加起來等於我上面指出的大小)。由於圖像中沒有任何內容需要剪切,因此刪除它會導致適合文件的較小尺寸(實際上,大約為 12 x 13.5 公分)。 (當您不確切知道某些元素有多大並且您只想將圖片保持在合理的大小而不顯式計算線條的端點等時,最常使用剪輯命令。)
如果需要進一步調整,只需添加(例如)
\begin{tikzpicture}[scale = .5, <other options>]