mais divertido com espaçamento dentro da tabela --- setspace

mais divertido com espaçamento dentro da tabela --- setspace

o espaçamento vertical é bruxaria, pelo que posso dizer. Eu coloquei tudo o que pude pensar que poderia forçar o conteúdo do ambiente de explicação a ser bem espaçado verticalmente. Funciona no texto principal. As próprias macros dentro do ambiente de explicação também estão funcionando. infelizmente, a definição do ambiente em si não funciona quando está dentro da tabela. huh?

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

o que eu fiz de errado (desta vez)??

Responder1

O espaçamento entre linhas de um parágrafo é feito quando o TeX divide o parágrafo em linhas. Isto aconteceno finaldo parágrafo.

No caso da pergunta, o ambiente explainusa \setstretch{0.1}e \footnotesize. No final do meio ambiente, o parágrafo ainda não terminou, mas o meio ambiente sim. Portanto as configurações locais do ambiente são perdidas e o parágrafo final na próxima linha vazia utiliza as configurações que estão ativasdepois(= antes, = fora) do ambiente.

Como Barbara Beeton disse em seuComente, \parna parte final ajuda (se estiver ok, se o ambiente terminar o parágrafo).

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

informação relacionada