
ChatGPT와 Google에서 문제에 대한 해결책을 찾으러 갔을 때 원격으로 문제를 언급하는 내용조차 전혀 찾지 못하는 경우는 거의 없습니다. 어쩌면 나는 검색에 형편없을 수도 있다.
다음 코드에는 다양한 유형의 삼각형을 표시하는 4개의 미니페이지가 있습니다. 이등변삼각형과 정삼각형에서 tkx-euclide 명령을 사용합니다(부등변삼각형은 아님). 두 다이어그램을 모두 중앙에 배치하고 수직으로 이동합니다. 나는 그것들을 중앙에 두는 것을 원하지 않으며 수직으로 이동하는 것도 원하지 않습니다. 그래서 문제에 대한 해결책이 필요합니다. \tkzLabelAngle 명령이 문제를 일으키는 것 같지만 위치 지정 문제 없이 해당 명령을 사용할 수 있는 방법이 필요합니다.
감사해요
\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Scalene Triangle}}
\newline\newline
\begin{tikzpicture}
\draw (0,0) -- (1,2) -- (3,1.75) -- (0,0);
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Isosceles Triangle}}
\newline\newline
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (2,1.5);
\draw (0,0) -- (4,0) -- (2,1.5) -- (0,0);
\tkzMarkSegment[color=black,pos=.5,mark=|](A,C)
\tkzMarkSegment[color=black,pos=.5,mark=|](B,C)
\tkzLabelAngle[pos=-0.33](C,A,B){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\end{tikzpicture}
\end{minipage}
\newline\newline
\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Equilateral Triangle}}
\newline\newline
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at (1.5,{1.5*sqrt(3)});
\draw (A) -- (B) -- (C) -- cycle;
\tkzLabelAngle[pos=-0.33](C,A,B){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\tkzLabelAngle[pos=-0.33](B,C,A){$\circ$}
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Right Triangle}}
\newline\newline
\begin{tikzpicture}
\end{tikzpicture}
\end{minipage}
답변1
서로 다른 단일 tikz 그림에 모두 그려서 scope
다른 값으로 찾는 것이 더 좋습니다 shift
. nagtive pos
키 값으로 인해 경계 상자가 더 커질 수 있다고 생각합니다. 가능하면 양수 값을 사용하는 것이 좋습니다.
\documentclass{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\draw (0,0) -- (1,2) -- (3,1.75) -- cycle;
\node at (1.5,2) [above=0.5cm] {\textsf{\textbf{Scalene Triangle}}};
\end{scope}
\begin{scope}[xshift=6cm]
\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (2,1.5);
\draw (0,0) -- (4,0) -- (2,1.5) -- cycle;
\tkzMarkSegment[color=black,pos=.5,mark=|](A,C)
\tkzMarkSegment[color=black,pos=.5,mark=|](B,C)
\tkzLabelAngle[pos=-0.33](C,A,B){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\node at (C) [above=1cm] {\textsf{\textbf{Isosceles Triangle}}};
\end{scope}
\begin{scope}[yshift=-4cm]
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at (1.5,{1.5*sqrt(3)});
\draw (A) -- (B) -- (C) -- cycle;
\tkzLabelAngle[pos=0.33](B,A,C){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\tkzLabelAngle[pos=0.33](A,C,B){$\circ$}
\node at (C) [above=0.5cm] {\textsf{\textbf{Equilateral Triangle}}};
\end{scope}
\begin{scope}[shift={(6.5cm,-4cm)}]
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at (3,{1.5*sqrt(3)});
\draw (A) -- (B) -- (C) -- cycle;
\node at (1.5,{1.5*sqrt(3)}) [above=0.5cm] {\textsf{\textbf{Right Triangle}}};
\end{scope}
\end{tikzpicture}
\end{document}
############################################# ###########################
pos
다음은 음수 값이 경계 상자를 확대하는 것을 보여주는 예입니다 . 동일한 도면이지만 기본pos
값으로 인해 왼쪽 하단과 상단 각도에 더 큰 경계 상자가 있습니다.
\documentclass{report}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at (1.5,{1.5*sqrt(3)});
\draw (A) -- (B) -- (C) -- cycle;
\tkzLabelAngle[pos=0.33](B,A,C){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\tkzLabelAngle[pos=0.33](A,C,B){$\circ$}
\draw (current bounding box.south west) rectangle (current bounding box.north east);
\end{tikzpicture}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at (1.5,{1.5*sqrt(3)});
\draw (A) -- (B) -- (C) -- cycle;
\tkzLabelAngle[pos=-0.33](C,A,B){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\tkzLabelAngle[pos=-0.33](B,C,A){$\circ$}
\draw (current bounding box.south west) rectangle (current bounding box.north east);
\end{tikzpicture}
\end{document}
minipage
양수pos
값과\noindent
첫 번째 줄에 사용합니다 . 출력이 예상한 것과 일치했습니까?report
문서 클래스를 예로 사용 하고 페이지의 프레임을 표시합니다.
\documentclass{report}
\usepackage{showframe}
\usepackage{tkz-euclide}
\begin{document}
\noindent\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Scalene Triangle}}
\newline\newline
\begin{tikzpicture}
\draw (0,0) -- (1,2) -- (3,1.75) -- (0,0);
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Isosceles Triangle}}
\newline\newline
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (4,0);
\coordinate (C) at (2,1.5);
\draw (0,0) -- (4,0) -- (2,1.5) -- (0,0);
\tkzMarkSegment[color=black,pos=.5,mark=|](A,C)
\tkzMarkSegment[color=black,pos=.5,mark=|](B,C)
\tkzLabelAngle[pos=0.33](B,A,C){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\end{tikzpicture}
\end{minipage}
\newline\newline
\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Equilateral Triangle}}
\newline\newline
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at (1.5,{1.5*sqrt(3)});
\draw (A) -- (B) -- (C) -- cycle;
\tkzLabelAngle[pos=0.33](B,A,C){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\tkzLabelAngle[pos=0.33](A,C,B){$\circ$}
\end{tikzpicture}
\end{minipage}
\begin{minipage}[t]{0.475\linewidth}
\textsf{\textbf{Right Triangle}}
\newline\newline
\begin{tikzpicture}
\end{tikzpicture}
\end{minipage}
\end{document}
답변2
- 첫 번째 솔루션. tkz-euclide를 사용하여 특별히 작업하지 않습니다. TikZ와 섞으면 좋지 않습니다.
pos
Tom이 말했듯이 경계 상자를 더 크게 만들고 있기 때문에 음수 값을 사용하지 않습니다 .
클립을 사용하면 bbox를 제어할 수 있습니다( 2 참조).
\begin{tikzpicture}
\tkzDefPoints{0/0/A,3/0/B}
\tkzDefTriangle[equilateral](A,B)\tkzGetPoint{C}
\tkzDrawPolygon(A,B,C)
\tkzLabelAngle[pos=0.33](B,A,C){$\circ$}
\tkzLabelAngle[pos=0.33](C,B,A){$\circ$}
\tkzLabelAngle[pos=0.33](A,C,B){$\circ$}
\end{tikzpicture}
다음으로 bbox를 제어할 수 있습니다.
\tkzClipPolygon(A,B,C)
\begin{tikzpicture} \coordinate (A) at (0,0); \coordinate (B) at (3,0); \coordinate (C) at (1.5,{1.5*sqrt(3)}); \draw (A) -- (B) -- (C) -- cycle; \tkzClipPolygon(A,B,C) \tkzLabelAngle[pos=-0.33](C,A,B){$\circ$} \tkzLabelAngle[pos=0.33](C,B,A){$\circ$} \tkzLabelAngle[pos=-0.33](B,C,A){$\circ$} \end{tikzpicture}