テーブル内のスペースをもっと楽しく --- setspace

テーブル内のスペースをもっと楽しく --- setspace

私の知る限り、垂直方向の間隔は魔法のようです。Explain 環境の内容を垂直方向に狭く間隔を空けるために考えられるあらゆることを試してみました。メイン テキストではうまくいきます。Explain 環境内のマクロ自体もうまくいきます。残念ながら、環境定義自体はテーブル内ではうまくいきません。えっ?

\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
}

関連情報