
Estoy intentando crear un entorno que no sangra el primer párrafo del texto dentro del entorno.
Mi último intento y el resultado correspondiente se muestran a continuación. Como puede ver, el primer entorno agregó un pequeño espacio horizontal al primer párrafo sin sangría. El segundo entorno no lo hizo, pero solo pude lograrlo agregando un %
carácter después \begin{env}
, que no debería ser necesario. ¿Cómo puedo omitir este espacio no deseado sin un %
carácter explícito?
\documentclass{minimal}
\newenvironment{env}{%
\noindent%
}{%
}%
\begin{document}
Some text. Some text. Some text. Some text. Some text. Some text.
Some text. Some text. Some text. Some text. Some text. Some text.
Some text. Some text. Some text. Some text. Some text. Some text.
\begin{env}
First paragraph inside environment.
Second paragraph inside environment.
\end{env}
\begin{env}%
First paragraph inside environment.
Second paragraph inside environment.
\end{env}
\end{document}
Respuesta1
Puedes usarignorespaces
\documentclass{article}
\newenvironment{env}{%
\noindent\ignorespaces%
}{%
}%
\begin{document}
Some text. Some text. Some text. Some text. Some text. Some text.
Some text. Some text. Some text. Some text. Some text. Some text.
Some text. Some text. Some text. Some text. Some text. Some text.
\begin{env}
First paragraph inside environment.
Second paragraph inside environment.
\end{env}
\begin{env}%
First paragraph inside environment.
Second paragraph inside environment.
\end{env}
\end{document}