테이블 내부 간격이 더 재미있습니다. --- setspace

테이블 내부 간격이 더 재미있습니다. --- setspace

내가 아는 한 수직 간격은 마술이다. 나는 설명 환경 콘텐츠가 수직으로 촘촘하게 배치되도록 할 수 있다고 생각할 수 있는 모든 것을 넣었습니다. 본문에서 작동합니다. 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
}

관련 정보