尝试在 TexStudio 中使用 Geogebra 代码

尝试在 TexStudio 中使用 Geogebra 代码

我画了一个图形(四分之一圆内有一个正方形)。当我将其导出到 tikz 并将其粘贴到我的 texstudio 中时,四分之一圆输出未显示,尽管另一个图形显示正常:

\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{xdxdff}{rgb}{0.49019607843137253,0.49019607843137253,1}
\definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-19.210333466054728,
xmax=20.87167851254458,
ymin=-14.541787054587674,
ymax=10.522690092979717,
xtick={-18,-16,...,20},
ytick={-14,-12,...,10},]
\clip(-19.210333466054728,-14.541787054587674) rectangle (20.87167851254458,10.522690092979717);
\draw [shift={(-10,4)},line width=2pt]  plot[domain=0:1.5707963267948966,variable=\t]({1*6*cos(\t r)+0*6*sin(\t r)},{0*6*cos(\t r)+1*6*sin(\t r)});
\draw [line width=2pt] (-10,10)-- (-10,4);
\draw [line width=2pt] (-10,4)-- (-4,4);
\draw [line width=2pt] (-10,6.95338163842107)-- (-7.471274548839627,4);
\draw [line width=2pt] (-7.471274548839627,4)-- (-4.438909754691155,6.252615209824085);
\draw [line width=2pt] (-10,6.95338163842107)-- (-6.967268362401102,9.177116843795076);
\draw [line width=2pt] (-6.967268362401102,9.177116843795076)-- (-4.438909754691155,6.252615209824085);
\draw [line width=2pt] (-10,4)-- (-4.438909754691155,6.252615209824085);
\draw [line width=2pt] (-4.438909754691155,6.252615209824085)-- (-4.430752531993374,4);
\draw [line width=2pt] (-10,6.95338163842107)-- (-4.438909754691155,6.252615209824085);
\begin{scriptsize}
\draw [fill=ududff] (-10,4) circle (2.5pt);
\draw[color=ududff] (-9.797934874774151,4.560623007772495) node {$A$};
\draw [fill=ududff] (-4,4) circle (2.5pt);
\draw[color=ududff] (-3.796208806738503,4.560623007772495) node {$B$};
\draw [fill=ududff] (-10,10) circle (2.5pt);
\draw[color=ududff] (-9.797934874774151,10.403713144494429) node {$C$};
\draw[color=black] (-5.514764729303777,8.711596543814773) node {$c$};
\draw[color=black] (-10.326721312486542,7.3103124838769356) node {$f$};
\draw[color=black] (-6.916048789241616,3.899639960632005) node {$g$};
\draw [fill=xdxdff] (-10,6.95338163842107) circle (2.5pt);
\draw[color=xdxdff] (-9.797934874774151,7.521827058961892) node {$D$};
\draw [fill=xdxdff] (-7.471274548839627,4) circle (2.5pt);
\draw[color=xdxdff] (-7.2597599737546705,4.560623007772495) node {$E$};
\draw[color=black] (-8.951876574434324,5.512438595654801) node {$h$};
\draw [fill=xdxdff] (-4.438909754691155,6.252615209824085) circle (2.5pt);
\draw[color=xdxdff] (-4.219237956908417,6.807965368050162) node {$F$};
\draw[color=black] (-5.620522016846255,5.115848767370507) node {$i$};
\draw [fill=xdxdff] (-6.967268362401102,9.177116843795076) circle (2.5pt);
\draw[color=xdxdff] (-6.757412857927898,9.742730097353938) node {$G$};
\draw[color=black] (-8.132257595980116,8.050613496674284) node {$j$};
\draw[color=black] (-5.93779387947369,7.759780955932468) node {$k$};
\draw[color=black] (-6.968927433012855,5.062970123599269) node {$l$};
\draw [fill=xdxdff] (-4.430752531993374,4) circle (2.5pt);
\draw[color=xdxdff] (-4.219237956908417,4.560623007772495) node {$H$};
\draw[color=black] (-4.774463716506428,5.433120629997942) node {$m$};
\draw[color=black] (-7.1804420080978115,6.490693505422727) node {$n$};
\end{scriptsize}
\end{axis}
\end{tikzpicture}
\end{document}

答案1

GeoGebra 生成的代码应该始终经过大量编辑。

在这种情况下,axis环境会导致图片宽度约为 40 厘米,很可能是不需要的。

我还对荒谬的准确性进行了编辑,并对字体大小进行了稍微的重新格式化。

片段上的标签已被注释掉,因为它们对于理解图片没有用处。线宽也已减小。

剩下的只是修复顶点标签的位置。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}

\definecolor{xdxdff}{rgb}{0.49,0.49,1}
\definecolor{ududff}{rgb}{0.3,0.3,1}

\pagestyle{empty}

\begin{document}

\begin{tikzpicture}[
  line cap=round,
  line join=round,
  x=1cm,y=1cm,
  font=\scriptsize,
]
\draw [
  shift={(-10,4)},
  line width=1pt
]  plot[domain=0:1.57,variable=\t]({1*6*cos(\t r)+0*6*sin(\t r)},{0*6*cos(\t r)+1*6*sin(\t r)});
\draw [line width=1pt] (-10,10)-- (-10,4);
\draw [line width=1pt] (-10,4)-- (-4,4);
\draw [line width=1pt] (-10,6.95)-- (-7.47,4);
\draw [line width=1pt] (-7.47,4)-- (-4.44,6.25);
\draw [line width=1pt] (-10,6.95)-- (-6.97,9.18);
\draw [line width=1pt] (-6.97,9.18)-- (-4.44,6.25);
\draw [line width=1pt] (-10,4)-- (-4.44,6.25);
\draw [line width=1pt] (-4.44,6.25)-- (-4.43,4);
\draw [line width=1pt] (-10,6.95)-- (-4.44,6.25);
\draw [fill=ududff] (-10,4) circle (1.5pt);
\draw[color=ududff] (-9.8,4.56) node {$A$};
\draw [fill=ududff] (-4,4) circle (1.5pt);
\draw[color=ududff] (-3.8,4.56) node {$B$};
\draw [fill=ududff] (-10,10) circle (1.5pt);
\draw[color=ududff] (-9.8,10.40) node {$C$};
%\draw[color=black] (-5.51,8.71) node {$c$};
%\draw[color=black] (-10.33,7.31) node {$f$};
%\draw[color=black] (-6.92,3.9) node {$g$};
\draw [fill=xdxdff] (-10,6.95) circle (1.5pt);
\draw[color=xdxdff] (-9.8,7.52) node {$D$};
\draw [fill=xdxdff] (-7.47,4) circle (1.5pt);
\draw[color=xdxdff] (-7.26,4.56) node {$E$};
%\draw[color=black] (-8.95,5.51) node {$h$};
\draw [fill=xdxdff] (-4.44,6.25) circle (1.5pt);
\draw[color=xdxdff] (-4.22,6.81) node {$F$};
%\draw[color=black] (-5.62,5.12) node {$i$};
\draw [fill=xdxdff] (-6.97,9.18) circle (1.5pt);
\draw[color=xdxdff] (-6.76,9.74) node {$G$};
%\draw[color=black] (-8.13,8.05) node {$j$};
%\draw[color=black] (-5.94,7.76) node {$k$};
%\draw[color=black] (-6.97,5.06) node {$l$};
\draw [fill=xdxdff] (-4.43,4) circle (1.5pt);
\draw[color=xdxdff] (-4.22,4.56) node {$H$};
%\draw[color=black] (-4.77,5.43) node {$m$};
%\draw[color=black] (-7.18,6.49) node {$n$};
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容