我第一次使用 geogebra,在将 PGF/TikZ 代码放入 overleaf 时出现错误。具体错误如下
在输入行 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 厘米)。(当您不确切知道某些元素有多大并且您只想将图片保持在合理大小而无需明确计算线条的端点等时,最常使用 clip 命令。)
如果需要进一步调整,只需添加(例如)
\begin{tikzpicture}[scale = .5, <other options>]