|
kuing
发表于 2021-11-23 23:38
回复 5# abababa
更简单的方法是在最后画线之前加 \pgfresetboundingbox 将边界归零。
测试代码:- \documentclass{article}
- % 颜色,必须放在前面
- \usepackage[dvipsnames, svgnames]{xcolor}
- \usepackage{pgf,tikz}
- \usepackage{float}
- \usepackage{pgfplots,wrapfig}
- \usepackage{graphicx}
- \usepackage{subfigure}
- \usepackage{tkz-euclide}
- % 页边距设置
- \usepackage[top=0.5in,bottom=0.5in,left=0.5in,right=0.5in]{geometry}
- \begin{document}
- \begin{figure}
- \begin{minipage}{.3\textwidth}
- \fbox{%for test
- \begin{tikzpicture}[scale=5,label style/.style={font=\scriptsize}, every node/.style={font=\scriptsize}]
- \tkzDefPoints{0/0/A,1/0/B};
- \tkzDefPointBy[rotation=center B angle -60](A)\tkzGetPoint{C}
- \tkzCircumCenter(A,B,C)\tkzGetPoint{O}
- \tkzDrawSegments[color=OliveGreen](A,B B,C C,A);
- \tkzDrawSegments[color=Purple](O,A O,B O,C);
- \end{tikzpicture}}
- \end{minipage}%
- \begin{minipage}{.3\textwidth}
- \fbox{%for test
- \begin{tikzpicture}[scale=5,label style/.style={font=\scriptsize}, every node/.style={font=\scriptsize}]
- \tkzDefPoints{0/0/A,1/0/B};
- \tkzDefPointBy[rotation=center B angle -60](A)\tkzGetPoint{C}
- \tkzDefPointBy[rotation=center A angle 40](B)\tkzGetPoint{X}
- \tkzInterLL(A,X)(B,C)\tkzGetPoint{D};
- \tkzDefPointBy[rotation=center B angle 20](C)\tkzGetPoint{X}
- \tkzInterLL(A,D)(B,X)\tkzGetPoint{E};
- \tkzDefPointBy[rotation=center C angle 20](A)\tkzGetPoint{X}
- \tkzInterLL(A,D)(C,X)\tkzGetPoint{F};
- \tkzLabelAngle[color=Purple, pos=0.2](B,A,D){$40^\circ$}
- \tkzLabelAngle[color=Purple, pos=0.3](C,B,E){$20^\circ$}
- \tkzLabelAngle[color=Purple, pos=0.3](A,C,F){$20^\circ$}
- \pgfresetboundingbox
- \tkzDrawSegments[color=OliveGreen](A,B B,C C,A);
- \tkzDrawSegments[color=Purple](A,D B,E C,F);
- \end{tikzpicture}}
- \end{minipage}%
- \begin{minipage}{.3\textwidth}
- \fbox{%for test
- \begin{tikzpicture}[scale=5,label style/.style={font=\scriptsize}, every node/.style={font=\scriptsize}]
- \tkzDefPoints{0/0/A,1/0/B};
- \tkzDefPointBy[rotation=center B angle -60](A)\tkzGetPoint{C}
- \tkzDefPointBy[rotation=center A angle 45](B)\tkzGetPoint{X}
- \tkzDefPointBy[rotation=center B angle -45](A)\tkzGetPoint{Y}
- \tkzInterLL(A,X)(B,Y)\tkzGetPoint{O};
- \tkzInterLC(A,C)(O,C)\tkzGetFirstPoint{M};
- \tkzInterLC(B,C)(O,C)\tkzGetSecondPoint{N};
- \tkzLabelAngle[color=Purple, pos=0.2](B,A,O){$45^\circ$}
- \tkzLabelAngle[color=Purple, pos=0.2](O,M,C){$30^\circ$}
- \pgfresetboundingbox
- \tkzDrawSegments[color=OliveGreen](A,B B,C C,A);
- \tkzDrawSegments[color=Purple](O,A O,B O,C O,M O,N);
- \end{tikzpicture}}
- \end{minipage}%
- \end{figure}
- \end{document}
复制代码 |
|