表格內間距更有趣 --- setspace

表格內間距更有趣 --- setspace

據我所知,垂直間距是巫術。我已經放入了我能想到的所有可能迫使解釋環境內容緊密垂直間隔的內容。它在正文中起作用。解釋環境中的巨集本身也可以工作。唉,環境定義本身並不在表內。嗯?

\documentclass{article}

\usepackage{setspace}

\newenvironment{explain}{%
  \medskip\par%
  \renewcommand{\baselinestretch}{0.1}
  \setstretch{0.1}
  \large\mbox{X}\footnotesize
  }{%
}

\setstretch{0.1}


\begin{document}

\begin{table}

\begin{explain}
  This fails. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time.
\end{explain}

\end{table}

\begin{table}

  \renewcommand{\baselinestretch}{0.1}
  \setstretch{0.1}
  \large\mbox{Y}\footnotesize
  This works.  This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time.


\end{table}



\begin{explain}
  This works.  This is the time.  This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time. This is the time.
\end{explain}

\end{document}

我做錯了什麼(這次)?

答案1

當 TeX 將段落分成行時,段落的行距就完成了。有時候是這樣的在最後該段落的。

在問題的情況下,環境explain使用\setstretch{0.1}\footnotesize。環境結束時,段落還沒結束,但環境已經結束了。因此,環境的本地設定將會遺失,並且下一個空白行的段落末端將使用活動的設置(=之前,=外面)環境。

正如芭芭拉·比頓在她的書中所說評論\par最後部分有幫助(如果可以,如果環境結束該段落)。

\newenvironment{explain}{%
  \par
  \medskip
  ... \footnotesize
}{%
  \par
}

相關內容