如何使图形中的底部水平线段与环境底部对齐minipage
?有两个顶点B
和,以及需要没有高度的C
线段的长度。我认为该命令被忽略了。(我也尝试使用。)BC
\smash
\makebox[0pt]{$B$}
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\begin{document}
\noindent \begin{minipage}[b]{3in}
\vskip0pt
\noindent \raggedright{\textbf{5.) }Evaluate $\displaystyle{\left\vert \overline{\mathit{BD}} \right\vert + \left\vert \overline{\mathit{BE}} \right\vert - \left\vert \overline{\mathit{AB}} \right\vert}$.
}
\begin{tabbing}
\hspace*{3em} \= \kill
\> \textbf{a.) }$3 + 2\sqrt{3}$ \\
\> \textbf{b.) }$4 + 3\sqrt{2}$ \\
\> \textbf{c.) }$4 + 9\sqrt{2}$ \\
\> \textbf{d.) }$3 + 10\sqrt{2}$ \\
\> \textbf{e.) }$5 + 9\sqrt{3}$
\end{tabbing}
\end{minipage}
%
\hspace{-1.25cm}
%
\begin{tikzpicture}[baseline=(current bounding box.south)]
%A pentagon with two right angles is drawn.
\path (0,9/4) coordinate (A) (0,0) coordinate (B) (12/4,0) coordinate (C) (12/4,5/4) coordinate (D) (9/4,9/4) coordinate (E);
\draw (A) -- (B) -- (C) -- (D) -- (E) -- cycle;
\draw (B) -- (D);
\draw (B) -- (E);
%The vertices are labeled.
\node[anchor=south, inner sep=0] at ($(A) +(0,0.15)$){$A$};
\node[anchor=north, inner sep=0] at ($(B) +(0,-0.15)$){$\smash[b]{B}$};
\node[anchor=north, inner sep=0] at ($(C) +(0,-0.15)$){$\smash[b]{C}$};
\node[anchor=west, inner sep=0] at ($(D) +(0.15,0)$){$D$};
\node[anchor=south, inner sep=0] at ($(E) +(0,0.15)$){$E$};
%A right-angle mark is drawn at A.
\coordinate (U_1) at ($(A)!3.25mm!45:(B)$);
\draw (U_1) -- ($(A)!(U_1)!(B)$);
\draw (U_1) -- ($(A)!(U_1)!(E)$);
%A right-angle mark is drawn at B.
\draw ($(B)!3.25mm!(A)$) coordinate (S) -- ($(S)!3.25mm!90:(B)$) coordinate (T) -- ($(T)!3.25mm!90:(S)$);
%A right-angle mark is drawn at C.
\coordinate (U) at ($(C)!3.25mm!-45:(B)$);
\draw (U) -- ($(B)!(U)!(C)$);
\draw (U) -- ($(C)!(U)!(D)$);
%The lengths of some of the the sides of the pentagon are typeset.
\node[anchor=south, inner sep=0, font=\scriptsize] at ($($(A)!0.5!(E)$) +(0,0.1)$){9};
\node[anchor=north, inner sep=0, font=\scriptsize] at ($($(B)!0.5!(C)$) +(0,-0.1)$){12};
\node[anchor=west, inner sep=0, font=\scriptsize] at ($($(C)!0.5!(D)$) +(0.1,0)$){5};
\node[anchor={atan(-4/3)-90}, inner sep=0, font=\scriptsize] at ($($(D)!0.5!(E)$) +({atan(-4/3)+90}:0.1)$){5};
\end{tikzpicture}
\end{document}
答案1
我认为baseline=(B)
这就是你需要的。你可以baseline
简单地定义图片的,baseline=<coord>
它将与基线对齐minipage
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\begin{document}
\noindent \begin{minipage}[b]{3in}
\vskip0pt
\noindent \raggedright{\textbf{5.) }Evaluate $\displaystyle{\left\vert \overline{\mathit{BD}} \right\vert + \left\vert \overline{\mathit{BE}} \right\vert - \left\vert \overline{\mathit{AB}} \right\vert}$.
}
\begin{tabbing}
\hspace*{3em} \= \kill
\> \textbf{a.) }$3 + 2\sqrt{3}$ \\
\> \textbf{b.) }$4 + 3\sqrt{2}$ \\
\> \textbf{c.) }$4 + 9\sqrt{2}$ \\
\> \textbf{d.) }$3 + 10\sqrt{2}$ \\
\> \textbf{e.) }$5 + 9\sqrt{3}$
\end{tabbing}
\end{minipage}
%
\hspace{-1.25cm}
%
\begin{tikzpicture}[baseline=(B)]
%A pentagon with two right angles is drawn.
\path (0,9/4) coordinate (A) (0,0) coordinate (B) (12/4,0) coordinate (C) (12/4,5/4) coordinate (D) (9/4,9/4) coordinate (E);
\draw (A) -- (B) -- (C) -- (D) -- (E) -- cycle;
\draw (B) -- (D);
\draw (B) -- (E);
%The vertices are labeled.
\node[anchor=south, inner sep=0] at ($(A) +(0,0.15)$){$A$};
\node[anchor=north, inner sep=0] at ($(B) +(0,-0.15)$){$\smash[b]{B}$};
\node[anchor=north, inner sep=0] at ($(C) +(0,-0.15)$){$\smash[b]{C}$};
\node[anchor=west, inner sep=0] at ($(D) +(0.15,0)$){$D$};
\node[anchor=south, inner sep=0] at ($(E) +(0,0.15)$){$E$};
%A right-angle mark is drawn at A.
\coordinate (U_1) at ($(A)!3.25mm!45:(B)$);
\draw (U_1) -- ($(A)!(U_1)!(B)$);
\draw (U_1) -- ($(A)!(U_1)!(E)$);
%A right-angle mark is drawn at B.
\draw ($(B)!3.25mm!(A)$) coordinate (S) -- ($(S)!3.25mm!90:(B)$) coordinate (T) -- ($(T)!3.25mm!90:(S)$);
%A right-angle mark is drawn at C.
\coordinate (U) at ($(C)!3.25mm!-45:(B)$);
\draw (U) -- ($(B)!(U)!(C)$);
\draw (U) -- ($(C)!(U)!(D)$);
%The lengths of some of the the sides of the pentagon are typeset.
\node[anchor=south, inner sep=0, font=\scriptsize] at ($($(A)!0.5!(E)$) +(0,0.1)$){9};
\node[anchor=north, inner sep=0, font=\scriptsize] at ($($(B)!0.5!(C)$) +(0,-0.1)$){12};
\node[anchor=west, inner sep=0, font=\scriptsize] at ($($(C)!0.5!(D)$) +(0.1,0)$){5};
\node[anchor={atan(-4/3)-90}, inner sep=0, font=\scriptsize] at ($($(D)!0.5!(E)$) +({atan(-4/3)+90}:0.1)$){5};
\end{tikzpicture}
\end{document}
答案2
格诺特和萨利姆·布他的评论和回答困扰了我几秒钟,所以我花了更多时间来讨论题外话:如何让你的 MWE 更简洁:)
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,quotes,intersections}
\begin{document}
\noindent
\begin{minipage}[b]{3in}
\textbf{5.)} Evaluate
$\displaystyle{\left\vert \overline{\mathit{BD}} \right\vert + \left\vert \overline{\mathit{BE}} \right\vert - \left\vert \overline{\mathit{AB}} \right\vert}$.
\begin{tabbing}
\hspace*{3em} \= \kill
\> \textbf{a.) }$3 + 2\sqrt{3}$ \\
\> \textbf{b.) }$4 + 3\sqrt{2}$ \\
\> \textbf{c.) }$4 + 9\sqrt{2}$ \\
\> \textbf{d.) }$3 + 10\sqrt{2}$ \\
\> \textbf{e.) }$5 + 9\sqrt{3}$
\end{tabbing}
\end{minipage}
%
\hspace{-1.25cm}
%
\begin{tikzpicture}[baseline=(B),
auto,
every edge quotes/.style={font=\scriptsize,swap}
]
%A pentagon with two right angles is drawn.
%The vertices are labeled.
\path (0,9/4) coordinate[label=$A$] (A) (0,0)
coordinate[label=below:$B$] (B) (12/4,0)
coordinate[label=below:$C$] (C) (12/4,5/4)
coordinate[label=right:$D$] (D) (9/4,9/4)
coordinate[label=$E$] (E);
%The lengths of some of the the sides of the pentagon are typeset.
\draw (A) -- (B) to["12"] (C) to["5"] (D) to["5"] (E) to["9"] cycle
(B) -- (D)
(B) -- (E);
%A right-angle mark is drawn at A.
\draw ($(A)+(0,-0.3)$) -| ($(A)+(0.3,0)$);
%A right-angle mark is drawn at B.
\draw ($(B)+(0,0.3)$) -| ($(B)+(0.3,0)$);
%A right-angle mark is drawn at C.
\draw ($(C)+(0,0.3)$) -| ($(C)+(-0.3,0)$);
\end{tikzpicture}
\end{document}
结果与萨利姆·布回答。