忽略节点命令中字符所占的空间

忽略节点命令中字符所占的空间

我有两个角度测量值,我想将它们放置在角度的假想角平分线上。字符“${}^\circ$”占用的空间将数字的位置移得离角平分线太远,不利于美观。我希望包含数字的节点的中心位于假想角平分线上,但我希望排版度数符号。以下命令是我用来在图表中输入其中一个角度测量值的命令。

\node[anchor=150] at ($(D) +(-30:0.45)$){60{\makebox[0pt][l]{${}^\circ$}}};

它似乎完全符合我的要求 - 节点的中心位于点D(vertex D) 处的角平分线上,并且和“${}^\circ$”之间的空间60与 $60^{\circ}$ 中的空间相同。对吗?

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes}



\begin{document}



\begin{center}\Huge{\textbf{Sample of Geometry}}\end{center}\vskip0.3in

\begin{center}\Large{\textbf{For New York State Regents Test}}\end{center}\vskip0.25in

\noindent In the following figure, $\mathit{ABCD}$ is a parallelogram. Evaluate $\theta$.
\vskip0.2in

\noindent \hspace*{\fill}
\begin{tikzpicture}

%The vertices of a hexagon are located.
\path (0,0) coordinate (A) (4,0) coordinate (B) ($(B) +(120:3)$) coordinate (C) ($(C) +(-4,0)$) coordinate (D);
\draw (A) -- (B) -- (C) -- (D) -- cycle;


%The labels for A and B are typeset 1.5mm below side AB.
\coordinate (a_point_below_AB) at ($(A)!1.5mm!-90:(B)$);
\coordinate (another_point_below_AB) at ($($(B)!1.5mm!90:(A)$) +(0.5,0)$);
\path[name path=path_on_which_labels_for_A_and_B_are_typeset] (a_point_below_AB) -- (another_point_below_AB);

\path[name path=a_path_for_label_for_A] (A) -- ($(A) +(-60:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_A_and_B_are_typeset and a_path_for_label_for_A, by={label_for_A}}];
\node[anchor=north, inner sep=0] at (label_for_A){$A$};

\path[name path=a_path_for_label_for_B] (B) -- ($(B) +(-60:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_A_and_B_are_typeset and a_path_for_label_for_B, by={label_for_B}}];
\node[anchor=north, inner sep=0] at (label_for_B){$B$};


%The labels for C and D are typeset 1.5mm above side CD.
\coordinate (a_point_above_CD) at ($(C)!1.5mm!-90:(D)$);
\coordinate (another_point_above_CD) at ($($(D)!1.5mm!90:(C)$) +(-0.5,0)$);
\path[name path=path_on_which_labels_for_C_and_D_are_typeset] (a_point_above_CD) -- (another_point_above_CD);

\path[name path=a_path_for_label_for_C] (C) -- ($(C) +(120:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_C_and_D_are_typeset and a_path_for_label_for_C, by={label_for_C}}];
\node[anchor=south, inner sep=0] at (label_for_C){$C$};

\path[name path=a_path_for_label_for_D] (D) -- ($(D) +(120:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_C_and_D_are_typeset and a_path_for_label_for_D, by={label_for_D}}];
\node[anchor=south, inner sep=0] at (label_for_D){$D$};



%P is a point a quarter of the way from A to B. A line through P is drawn so that the measure of the smaller
%angle formed from the line and AB is 81 degrees. Its intersection with CD is called Q. The midpoint of PQ
%is called R.
\coordinate (P) at (1,0);
\draw[name path=a_path_to_locate_Q] (P) -- ($(P) +(81:3.5)$);
\path[name path=another_path_to_locate_Q] (C) -- (D); 
\coordinate[name intersections={of=a_path_to_locate_Q and another_path_to_locate_Q, by=Q}];
\coordinate (R) at ($(P)!0.5!(Q)$);

\draw[latex-latex] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in ($(P) +({\n1-180}:1)$) --  ($(Q) +(\n1:1)$);


%The line perpendicular to PQ through R is drawn. The line intersects AD at P' and it
%intersects BC at Q'.
\draw[name path=a_path_to_locate_P'] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in (R) -- ($(R) +({\n1+90}:2.5)$);
\path[name path=another_path_to_locate_P'] (A) -- (D);
\coordinate[name intersections={of=a_path_to_locate_P' and another_path_to_locate_P', by=P'}];

\draw[name path=a_path_to_locate_Q'] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in (R) -- ($(R) +({\n1-90}:2.5)$);
\path[name path=another_path_to_locate_Q'] (B) -- (C);
\coordinate[name intersections={of=a_path_to_locate_Q' and another_path_to_locate_Q', by=Q'}];

\draw[latex-latex] let \p1=($(P')-(Q')$), \n1={atan(\y1/\x1)} in ($(P') +({\n1-180}:1)$) --  ($(Q') +(\n1:1)$);


%A right-angle mark is drawn at R.
\coordinate (U) at ($(R)!4mm!45:(Q')$);
\draw[dashed] (U) -- ($(R)!(U)!(Q')$);
\draw[dashed] (U) -- ($(R)!(U)!(P)$);


%The mark for the measure of the angle at the vertex D is drawn.
\draw[draw=blue] ($(D) +(0.3,0)$) arc (0:-60:0.3);
\node[anchor=150, inner sep=0, font=\footnotesize] at ($(D) +(-30:0.45)$){60{\makebox[0pt]{${}^\circ$}}};

%The mark for the measure of the acute angle at P is drawn.
\draw[blue] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in ($(Q) +(0.3,0)$) arc (0:\n1:0.3);
\draw let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in node[anchor={\n1-180}, inner sep=0, font=\footnotesize] at ($(Q) +({0.5*(\n1)}:0.45)$){$81^{\circ}$};

\draw[draw=blue] let \p1=($(P')-(Q')$), \n1={atan(\y1/\x1)} in ($(Q') +(-60:0.4)$) arc (-60:\n1:0.4);
\draw let \p1=($(P')-(Q')$), \n1={atan(\y1/\x1)} in node[anchor={\n1-180}, inner sep=0, font=\footnotesize] at ($(Q') +({0.5*(-60+\n1)}:0.45)$){$\theta$};


\end{tikzpicture}

\end{document}

答案1

这是 \mathrlap 版本。我还重做了$81^\circ$

\documentclass{amsart}
\usepackage{mathtools}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes}

\begin{document}

\begin{center}\Huge{\textbf{Sample of Geometry}}\end{center}\vskip0.3in

\begin{center}\Large{\textbf{For New York State Regents Test}}\end{center}\vskip0.25in

\noindent In the following figure, $\mathit{ABCD}$ is a parallelogram. Evaluate $\theta$.
\vskip0.2in

\noindent \hspace*{\fill}
\begin{tikzpicture}

%The vertices of a hexagon are located.
\path (0,0) coordinate (A) (4,0) coordinate (B) ($(B) +(120:3)$) coordinate (C) ($(C) +(-4,0)$) coordinate (D);
\draw (A) -- (B) -- (C) -- (D) -- cycle;


%The labels for A and B are typeset 1.5mm below side AB.
\coordinate (a_point_below_AB) at ($(A)!1.5mm!-90:(B)$);
\coordinate (another_point_below_AB) at ($($(B)!1.5mm!90:(A)$) +(0.5,0)$);
\path[name path=path_on_which_labels_for_A_and_B_are_typeset] (a_point_below_AB) -- (another_point_below_AB);

\path[name path=a_path_for_label_for_A] (A) -- ($(A) +(-60:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_A_and_B_are_typeset and a_path_for_label_for_A, by={label_for_A}}];
\node[anchor=north, inner sep=0] at (label_for_A){$A$};

\path[name path=a_path_for_label_for_B] (B) -- ($(B) +(-60:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_A_and_B_are_typeset and a_path_for_label_for_B, by={label_for_B}}];
\node[anchor=north, inner sep=0] at (label_for_B){$B$};


%The labels for C and D are typeset 1.5mm above side CD.
\coordinate (a_point_above_CD) at ($(C)!1.5mm!-90:(D)$);
\coordinate (another_point_above_CD) at ($($(D)!1.5mm!90:(C)$) +(-0.5,0)$);
\path[name path=path_on_which_labels_for_C_and_D_are_typeset] (a_point_above_CD) -- (another_point_above_CD);

\path[name path=a_path_for_label_for_C] (C) -- ($(C) +(120:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_C_and_D_are_typeset and a_path_for_label_for_C, by={label_for_C}}];
\node[anchor=south, inner sep=0] at (label_for_C){$C$};

\path[name path=a_path_for_label_for_D] (D) -- ($(D) +(120:0.5)$);
\coordinate[name intersections={of=path_on_which_labels_for_C_and_D_are_typeset and a_path_for_label_for_D, by={label_for_D}}];
\node[anchor=south, inner sep=0] at (label_for_D){$D$};



%P is a point a quarter of the way from A to B. A line through P is drawn so that the measure of the smaller
%angle formed from the line and AB is 81 degrees. Its intersection with CD is called Q. The midpoint of PQ
%is called R.
\coordinate (P) at (1,0);
\draw[name path=a_path_to_locate_Q] (P) -- ($(P) +(81:3.5)$);
\path[name path=another_path_to_locate_Q] (C) -- (D); 
\coordinate[name intersections={of=a_path_to_locate_Q and another_path_to_locate_Q, by=Q}];
\coordinate (R) at ($(P)!0.5!(Q)$);

\draw[latex-latex] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in ($(P) +({\n1-180}:1)$) --  ($(Q) +(\n1:1)$);


%The line perpendicular to PQ through R is drawn. The line intersects AD at P' and it
%intersects BC at Q'.
\draw[name path=a_path_to_locate_P'] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in (R) -- ($(R) +({\n1+90}:2.5)$);
\path[name path=another_path_to_locate_P'] (A) -- (D);
\coordinate[name intersections={of=a_path_to_locate_P' and another_path_to_locate_P', by=P'}];

\draw[name path=a_path_to_locate_Q'] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in (R) -- ($(R) +({\n1-90}:2.5)$);
\path[name path=another_path_to_locate_Q'] (B) -- (C);
\coordinate[name intersections={of=a_path_to_locate_Q' and another_path_to_locate_Q', by=Q'}];

\draw[latex-latex] let \p1=($(P')-(Q')$), \n1={atan(\y1/\x1)} in ($(P') +({\n1-180}:1)$) --  ($(Q') +(\n1:1)$);


%A right-angle mark is drawn at R.
\coordinate (U) at ($(R)!4mm!45:(Q')$);
\draw[dashed] (U) -- ($(R)!(U)!(Q')$);
\draw[dashed] (U) -- ($(R)!(U)!(P)$);


%The mark for the measure of the angle at the vertex D is drawn.
\draw[draw=blue] ($(D) +(0.3,0)$) arc (0:-60:0.3);
\node[anchor=150, inner sep=0, font=\footnotesize] at ($(D) +(-30:0.45)$) {$60^{\mathrlap{\circ}}$};

%The mark for the measure of the acute angle at P is drawn.
\draw[blue] let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in ($(Q) +(0.3,0)$) arc (0:\n1:0.3);
\draw let \p1=($(P)-(Q)$), \n1={atan(\y1/\x1)} in node[anchor={\n1-180}, inner sep=0, font=\footnotesize] at ($(Q) +({0.5*(\n1)}:0.45)$){$81^{\mathrlap{\circ}}$};

\draw[draw=blue] let \p1=($(P')-(Q')$), \n1={atan(\y1/\x1)} in ($(Q') +(-60:0.4)$) arc (-60:\n1:0.4);
\draw let \p1=($(P')-(Q')$), \n1={atan(\y1/\x1)} in node[anchor={\n1-180}, inner sep=0, font=\footnotesize] at ($(Q') +({0.5*(-60+\n1)}:0.45)$){$\theta$};

\end{tikzpicture}

\end{document}

演示

相关内容