Quebra de espaço em branco espúria exibe matemática em \small

Quebra de espaço em branco espúria exibe matemática em \small

Posso colocar a matemática de exibição no meio de um parágrafo de texto usando \[...\], mas gostaria que a matemática usasse o tamanho da fonte small. Se eu agrupar o bloco de exibição na {\small...}segunda metade do parágrafo, começando com a palavra "séculos", começa com uma pequena quantidade de espaços em branco indesejados. Isso desaparece se eu remover o {\small...}. insira a descrição da imagem aqui

\documentclass{article}

\begin{document}
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
{\small\[
A / B + C = D
\]}
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
\end{document}

Acho que estou fazendo isso da maneira errada. Ajuda?

Responder1

Você conseguedoisespaços espúrios: um no início da linha, que é mais evidente, mas também um espaço vertical mais estreito acima da tela do que abaixo, porque você está usando o salto acima pertencente a \small, mas o salto abaixo pertencente a \normalsize.

Você pode emular o comportamento padrão:

\documentclass{article}

\begin{document}

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
{\par\penalty\predisplaypenalty\small\[
A / B + C = D
\]\par}\penalty\postdisplaypenalty\noindent
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.

\end{document}

insira a descrição da imagem aqui

Você poderia definir um vardisplaymathambiente:

\makeatletter
\newenvironment{vardisplaymath}[1][\small]
 {\par\penalty\predisplaypenalty\begingroup#1\begin{displaymath}}
 {\end{displaymath}\par\endgroup\penalty\postdisplaypenalty
  \@endparenv}
\makeatletter

Exemplo completo:

\documentclass{article}

\makeatletter
\newenvironment{vardisplaymath}[1][\small]
 {\par\penalty\predisplaypenalty\begingroup#1\begin{displaymath}}
 {\end{displaymath}\par\endgroup\penalty\postdisplaypenalty
  \@endparenv}
\makeatletter

\begin{document}

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
\begin{vardisplaymath}
A / B + C = D
\end{vardisplaymath}
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
\begin{vardisplaymath}[\footnotesize]
A / B + C = D
\end{vardisplaymath}
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.

\end{document}

insira a descrição da imagem aqui

Isso pode ser ajustado para sempre obter os parâmetros de \normalsize.

Obrigado ao Tobi por sugerir uma melhoria.

Uma abordagem mais simples que não requer mergulhar em detalhes como \penalty\postdisplaypenalty(necessário para evitar quebras de página após a exibição) e evitar os pulos acima e abaixo \normalsizeé

\newsavebox{\vardisplaymathbox}
\newenvironment{vardisplaymath}[1][\small]
  {\begin{displaymath}\begin{lrbox}{\vardisplaymathbox}
   #1$\displaystyle}
  {$\end{lrbox}\usebox{\vardisplaymathbox}\end{displaymath}%
   \ignorespacesafterend}

O resultado com esta definição é

insira a descrição da imagem aqui

informação relacionada