小型页面环境前的垂直空间过多

小型页面环境前的垂直空间过多

如何获取“计算八边形的边长”之后的通常行间距和环境内容minipage?我知道如何将环境内容放在图表minipage的左侧TikZ,但我并不坚持使用minipage环境。

\documentclass[10pt]{amsart}
\usepackage{mathtools}

\begin{document}
\noindent \textbf{Calculation of the edge length of the octagon} \\
\noindent \begin{minipage}[t]{4.5in}
\vskip0pt
\noindent \raggedright{The sum of the measures of (interior) angles in the octagon \\
is $(8 - 2)180^{\circ} = 1080^{\circ}$, and so, the measure of the (interior)  \\
angles is $135^{\circ}$. The angles that are supplementary to the \\
(interior) angles of the octagon all have the same measure \\
--- $45^{\circ}$. So, the four right triangles at the corners of the \\
square are isosceles right triangles. If $x$ is the edge length \\
of the octagon,}
\end{minipage}
%
\hspace{-0.25cm}
%
\begin{tikzpicture}[baseline=(current bounding box.north)]

%A regular octagon is drawn.
\draw (0,{3/2-(3/2)*(sqrt(2)-1)}) coordinate (A) -- (0,{3/2+(3/2)*(sqrt(2)-1)}) coordinate (B)
-- ({3/2-(3/2)*(sqrt(2)-1)},3) coordinate (C) -- ({3/2+(3/2)*(sqrt(2)-1)},3) coordinate (D)
--  (3,{3/2+(3/2)*(sqrt(2)-1)}) coordinate (E) -- (3,{3/2-(3/2)*(sqrt(2)-1)}) coordinate (F)
-- ({3/2+(3/2)*(sqrt(2)-1)},0) coordinate (G) -- ({3/2-(3/2)*(sqrt(2)-1)},0) coordinate (H)
-- cycle;

%The vertices of the octagon are typeset.
\node[font=\footnotesize, anchor=east, inner sep=0] at ($(0,{3/2-(3/2)*(sqrt(2)-1)}) +(-0.15,0)$){$A$};
\node[font=\footnotesize, anchor=east, inner sep=0] at ($(0,{3/2+(3/2)*(sqrt(2)-1)}) +(-0.15,0)$){$B$};
\node[font=\footnotesize, anchor=south,inner sep=0] at ($({3/2-(3/2)*(sqrt(2)-1)},3) +(0,0.15)$){$C$};
\node[font=\footnotesize, anchor=south,inner sep=0] at ($({3/2+(3/2)*(sqrt(2)-1)},3) +(0,0.15)$){$D$};
\node[font=\footnotesize, anchor=west,inner sep=0] at ($(3,{3/2+(3/2)*(sqrt(2)-1)}) +(0.15,0)$){$E$};
\node[font=\footnotesize, anchor=west,inner sep=0] at ($(3,{3/2-(3/2)*(sqrt(2)-1)}) +(0.15,0)$){$F$};
\node[font=\footnotesize, anchor=north, inner sep=0] at ($({3/2+(3/2)*(sqrt(2)-1)},0) +(0,-0.15)$){$G$};
\node[font=\footnotesize, anchor=north, inner sep=0] at ($({3/2-(3/2)*(sqrt(2)-1)},0) +(0,-0.15)$){$H$};


%A triangle is inscribed in the octagon.
\draw[dashed] (A) -- (F);
\draw[dashed] (A) -- (C);
\draw[dashed] (C) -- (F);

\node[anchor=north, inner sep=0, font=small, font=\scriptsize] at ($($(A)!0.5!(F)$) +(0,-0.15)$){8};

\end{tikzpicture}
\end{document}

答案1

minipages(和\parboxes)已知具有基线跳过问题。为了得到你想要的东西,很容易避开它们(标记为下文)。如果你必须使用minipage,那么考虑添加\strut一些没有垂直v方向skip(标有C以下)。A是提供的原始输入,而最后一组比较显示了C

在此处输入图片描述

\documentclass{article}

\usepackage[margin=1in,landscape]{geometry}

\begin{document}


\noindent
\begin{minipage}[t]{.45\textwidth}
\noindent \textbf{A: Calculation of the edge length of the octagon} \\
\noindent \begin{minipage}[t]{4.5in}
\vskip0pt
\noindent \raggedright{The sum of the measures of (interior) angles in the octagon \\
is $(8 - 2)180^{\circ} = 1080^{\circ}$, and so, the measure of the (interior)  \\
angles is $135^{\circ}$. The angles that are supplementary to the \\
(interior) angles of the octagon all have the same measure \\
--- $45^{\circ}$. So, the four right triangles at the corners of the \\
square are isosceles right triangles. If $x$ is the edge length \\
of the octagon,}
\end{minipage}
\end{minipage}
\hfill
\begin{minipage}[t]{.45\textwidth}
\noindent\textbf{B: Calculation of the edge length of the octagon}

\noindent\raggedright The sum of the measures of (interior) angles in the octagon
is $(8 - 2)180^{\circ} = 1080^{\circ}$, and so, the measure of the (interior)
angles is $135^{\circ}$. The angles that are supplementary to the
(interior) angles of the octagon all have the same measure
--- $45^{\circ}$. So, the four right triangles at the corners of the
square are isosceles right triangles. If~$x$ is the edge length
of the octagon,
\end{minipage}

\bigskip

\noindent
\begin{minipage}[t]{.45\textwidth}
\noindent \textbf{A: Calculation of the edge length of the octagon} \\
\noindent \begin{minipage}[t]{4.5in}
\vskip0pt
\noindent \raggedright{The sum of the measures of (interior) angles in the octagon \\
is $(8 - 2)180^{\circ} = 1080^{\circ}$, and so, the measure of the (interior)  \\
angles is $135^{\circ}$. The angles that are supplementary to the \\
(interior) angles of the octagon all have the same measure \\
--- $45^{\circ}$. So, the four right triangles at the corners of the \\
square are isosceles right triangles. If $x$ is the edge length \\
of the octagon,}
\end{minipage}
\end{minipage}
\hfill
\begin{minipage}[t]{.45\textwidth}
\noindent\strut\textbf{C: Calculation of the edge length of the octagon}

\begin{minipage}[t]{4.5in}
\noindent\strut\raggedright The sum of the measures of (interior) angles in the octagon
is $(8 - 2)180^{\circ} = 1080^{\circ}$, and so, the measure of the (interior)
angles is $135^{\circ}$. The angles that are supplementary to the
(interior) angles of the octagon all have the same measure
--- $45^{\circ}$. So, the four right triangles at the corners of the
square are isosceles right triangles. If~$x$ is the edge length
of the octagon,
\end{minipage}
\end{minipage}

\bigskip

\noindent
\begin{minipage}[t]{.45\textwidth}
\noindent\textbf{B: Calculation of the edge length of the octagon}

\noindent\raggedright The sum of the measures of (interior) angles in the octagon
is $(8 - 2)180^{\circ} = 1080^{\circ}$, and so, the measure of the (interior)
angles is $135^{\circ}$. The angles that are supplementary to the
(interior) angles of the octagon all have the same measure
--- $45^{\circ}$. So, the four right triangles at the corners of the
square are isosceles right triangles. If~$x$ is the edge length
of the octagon,
\end{minipage}
\hfill
\begin{minipage}[t]{.45\textwidth}
\noindent\strut\textbf{C: Calculation of the edge length of the octagon}

\begin{minipage}[t]{4.5in}
\noindent\strut\raggedright The sum of the measures of (interior) angles in the octagon
is $(8 - 2)180^{\circ} = 1080^{\circ}$, and so, the measure of the (interior)
angles is $135^{\circ}$. The angles that are supplementary to the
(interior) angles of the octagon all have the same measure
--- $45^{\circ}$. So, the four right triangles at the corners of the
square are isosceles right triangles. If~$x$ is the edge length
of the octagon,
\end{minipage}
\end{minipage}

\end{document}

使用 s 的一个缺点minipage是,由于内容被装箱,它不会跨越页面边界。

答案2

在顶部的 内放置垂直空间minipage会导致 LaTeX 将小页面的最顶部放置在当前行的基线上。省略该垂直空间可让 LaTeX 将小页面内容第一行的基线放置在基线上。因此,删除该垂直空间,\vskip 0ptLaTeX 应该会按照您的要求执行。

如果您还需要将第一行文本的顶部与图形的顶部对齐,那么您可以将该图形放在小页面中并调整该图形的顶部:

\begin{minipage}[t]{2in}
\setbox0=\hbox{T} % tallest letter of the first line of other minipage
\vskip-\ht0
\begin{tikzpicture}[baseline=(current bounding box.north)]
...
\end{tikzpicture}
\end{minipage}

相关内容