Ich habe die Figur eines Rechtecks, das rechts neben einem beschreibenden Text angezeigt werden soll. Derzeit befindet sich das Rechteck größtenteils über dem Text (und rechts davon). Ich vermute, dass es angemessen wäre, den oberen Scheitelpunkt mit der oberen Kante des Felds auszurichten, das den Text enthält.
\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}
Antwort1
Um die Oberseite der Miniseite an der Oberseite des Tikzbilds auszurichten, verwenden Sie:
\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}
Tatsächlich richtet das die Oberseite des Tikzbilds an der Unterseite von aus 1)
. Um sie an der Oberseite von auszurichten, 1)
fügen Sie etwas wie
\path (current bounding box.north) ++(0,-.6\baselineskip) coordinate (align);
und [baseline=(align)]
Man kann auch verwenden \raisebox{0.6\baselineskip}{...}
.
Antwort2
Option [b] zur Miniseite hinzufügen
\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}
eigentlich gefallen mir diese Layouts mit Miniseiten nicht, also mache ich das direkt mit Tikz, indem ich die Position der Knoten anpasse
\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}