表内间距的更多乐趣---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
}

相关内容