![El ajuste de espacios en blanco falsos muestra matemáticas en \small](https://rvso.com/image/328820/El%20ajuste%20de%20espacios%20en%20blanco%20falsos%20muestra%20matem%C3%A1ticas%20en%20%5Csmall.png)
Puedo mostrar matemáticas en medio de un párrafo de texto usando \[...\]
, pero me gustaría que las matemáticas usen el tamaño de fuente small
. Si envuelvo el bloque de visualización en {\small...}
la segunda mitad del párrafo, comenzando con la palabra "siglos", comienza con una pequeña cantidad de espacios en blanco no deseados. Esto desaparece si elimino el archivo {\small...}
.
\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}
Supongo que estoy haciendo esto de manera incorrecta. ¿Ayuda?
Respuesta1
Usted obtienedosespacios falsos: uno al inicio de la línea, que es más evidente, pero también un espacio vertical más estrecho encima de la pantalla que debajo, porque estás usando el salto anterior correspondiente a \small
, pero el salto inferior correspondiente a \normalsize
.
Puedes emular el comportamiento estándar:
\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}
Podrías definir un vardisplaymath
entorno:
\makeatletter
\newenvironment{vardisplaymath}[1][\small]
{\par\penalty\predisplaypenalty\begingroup#1\begin{displaymath}}
{\end{displaymath}\par\endgroup\penalty\postdisplaypenalty
\@endparenv}
\makeatletter
Ejemplo 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}
Esto podría ajustarse para obtener siempre los parámetros de \normalsize
.
Gracias a Tobi por sugerir una mejora.
Un enfoque más simple que no requiere profundizar en detalles como \penalty\postdisplaypenalty
(necesario para evitar saltos de página después de la visualización) y mantener los saltos de arriba y de abajo \normalsize
es
\newsavebox{\vardisplaymathbox}
\newenvironment{vardisplaymath}[1][\small]
{\begin{displaymath}\begin{lrbox}{\vardisplaymathbox}
#1$\displaystyle}
{$\end{lrbox}\usebox{\vardisplaymathbox}\end{displaymath}%
\ignorespacesafterend}
El resultado con esta definición es