Tenho a figura de um retângulo a ser exibido à direita de algum texto que o descreve. Atualmente, o retângulo está principalmente acima do texto (e à direita dele). Acho que seria apropriado ter o vértice superior alinhado com a borda superior da caixa que contém o texto.
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{calc}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in} \setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}
\begin{document}
\noindent
\begin{minipage}{4.75in}
\noindent {\textbf{1.) }}The area of a rectangle is 168 square inches, and its perimeter is 62 inches. What is the product of the magnitudes of its diagonals?
\begin{tabbing}
\hspace*{3em} \= \hspace{2.5in} \= \kill
\> {\textbf{a.) }}625 \> {\textbf{b.) }}300 \\
\> {\textbf{c.) }}200 \> {\textbf{d.) }}150 \\
\> {\textbf{e.) }}125
\end{tabbing}
\end{minipage}
\begin{tikzpicture}
%Vertices A, B, C, and D are located.
\path (0,0) coordinate (A) (20:{7/8}) coordinate (B) ($(B) +(110:3)$) coordinate (C) ($(C) +(-160:{7/8})$) coordinate (D);
\draw (A) -- (B) -- (C) -- (D) -- cycle;
%The diagonals are drawn.
\draw[dashed] (A) -- (C);
\draw[dashed] (B) -- (D);
%The length and width of the rectangle are typeset.
\node[anchor={20+90}, inner sep=0, font=\footnotesize] at ($($(A)!1.5mm!-90:(B)$)!0.5!($(B)!1.5mm!90:(A)$)$){$w$};
\node[anchor={110+90}, inner sep=0, font=\footnotesize] at ($($(B)!1.5mm!-90:(C)$)!0.5!($(C)!1.5mm!90:(B)$)$){$\ell$};
\end{tikzpicture}
\end{document}
Responder1
Para alinhar o topo da minipágina com o topo da imagem tikz, use:
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{calc}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in} \setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}
\begin{document}
\noindent
\begin{minipage}[t]{4.75in}
\noindent {\textbf{1.) }}The area of a rectangle is 168 square inches, and its perimeter is 62 inches. What is the product of the magnitudes of its diagonals?
\begin{tabbing}
\hspace*{3em} \= \hspace{2.5in} \= \kill
\> {\textbf{a.) }}625 \> {\textbf{b.) }}300 \\
\> {\textbf{c.) }}200 \> {\textbf{d.) }}150 \\
\> {\textbf{e.) }}125
\end{tabbing}
\end{minipage}
\begin{tikzpicture}[baseline=(current bounding box.north)]
%Vertices A, B, C, and D are located.
\path (0,0) coordinate (A) (20:{7/8}) coordinate (B) ($(B) +(110:3)$) coordinate (C) ($(C) +(-160:{7/8})$) coordinate (D);
\draw (A) -- (B) -- (C) -- (D) -- cycle;
%The diagonals are drawn.
\draw[dashed] (A) -- (C);
\draw[dashed] (B) -- (D);
%The length and width of the rectangle are typeset.
\node[anchor={20+90}, inner sep=0, font=\footnotesize] at ($($(A)!1.5mm!-90:(B)$)!0.5!($(B)!1.5mm!90:(A)$)$){$w$};
\node[anchor={110+90}, inner sep=0, font=\footnotesize] at ($($(B)!1.5mm!-90:(C)$)!0.5!($(C)!1.5mm!90:(B)$)$){$\ell$};
\end{tikzpicture}
\end{document}
Na verdade, isso alinha a parte superior da imagem tikz com a parte inferior do arquivo 1)
. Para alinhar ao topo, 1)
adicione algo como
\path (current bounding box.north) ++(0,-.6\baselineskip) coordinate (align);
e [baseline=(align)]
também se pode usar \raisebox{0.6\baselineskip}{...}
.
Responder2
adicione a opção [b] na minipágina
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\noindent
\begin{minipage}[b]{4.75in}
\noindent {\textbf{1.) }}The area of a rectangle is 168 square inches, and its perimeter is 62 inches. What is the product of the magnitudes of its diagonals?
\begin{tabbing}
\hspace*{3em} \= \hspace{2.5in} \= \kill
\> {\textbf{a.) }}625 \> {\textbf{b.) }}300 \\
\> {\textbf{c.) }}200 \> {\textbf{d.) }}150 \\
\> {\textbf{e.) }}125
\end{tabbing}
\end{minipage}
\begin{minipage}[b]{2in}
\begin{tikzpicture}
%Vertices A, B, C, and D are located.
\path (0,0) coordinate (A) (20:{7/8}) coordinate (B) ($(B) +(110:3)$) coordinate (C) ($(C) +(-160:{7/8})$) coordinate (D);
\draw (A) -- (B) -- (C) -- (D) -- cycle;
%The diagonals are drawn.
\draw[dashed] (A) -- (C);
\draw[dashed] (B) -- (D);
%The length and width of the rectangle are typeset.
\node[anchor={20+90}, inner sep=0, font=\footnotesize] at ($($(A)!1.5mm!-90:(B)$)!0.5!($(B)!1.5mm!90:(A)$)$){$w$};
\node[anchor={110+90}, inner sep=0, font=\footnotesize] at ($($(B)!1.5mm!-90:(C)$)!0.5!($(C)!1.5mm!90:(B)$)$){$\ell$};
\end{tikzpicture}
\end{minipage}
\end{document}
na verdade, não gosto desses layouts com minipáginas, então faça isso diretamente com o tikz ajustando a posição dos nós
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,positioning}
\begin{document}
\begin{tikzpicture}
\node(fig){\begin{tikzpicture}
%Vertices A, B, C, and D are located.
\path (0,0) coordinate (A) (20:{7/8}) coordinate (B) ($(B) +(110:3)$) coordinate (C) ($(C) +(-160:{7/8})$) coordinate (D);
\draw (A) -- (B) -- (C) -- (D) -- cycle;
%The diagonals are drawn.
\draw[dashed] (A) -- (C);
\draw[dashed] (B) -- (D);
%The length and width of the rectangle are typeset.
\node[anchor={20+90}, inner sep=0, font=\footnotesize] at ($($(A)!1.5mm!-90:(B)$)!0.5!($(B)!1.5mm!90:(A)$)$){$w$};
\node[anchor={110+90}, inner sep=0, font=\footnotesize] at ($($(B)!1.5mm!-90:(C)$)!0.5!($(C)!1.5mm!90:(B)$)$){$\ell$};
\end{tikzpicture}};
\node[below left =0em of fig.north west, text width=4.75in]{
\noindent {\textbf{1.) }}The area of a rectangle is 168 square inches, and its perimeter is 62 inches. What is the product of the magnitudes of its diagonals?
\begin{tabbing}
\hspace*{3em} \= \hspace{2.5in} \= \kill
\> {\textbf{a.) }}625 \> {\textbf{b.) }}300 \\
\> {\textbf{c.) }}200 \> {\textbf{d.) }}150 \\
\> {\textbf{e.) }}125
\end{tabbing}
};
\end{tikzpicture}
\end{document}