# Ignore space in defining environment

Let assume that I want to redefine the quotation environment putting the text in italic and inserting it between quotation marks. I have some problems in adjusting the space after the opening of quotation marks and before the closure of them.

With this code I obtain:

\documentclass{article}

\newenvironment{itquote}
{\begin{quotation}\itshape}
{''\end{quotation}}

\begin{document}

\begin{itquote}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris.
Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
\end{itquote}

\end{document}


And to fix the spacing I clearly have to put two % in this way:

\begin{itquote}%
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris.
Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.%
\end{itquote}


But I want to fix it inside the definition of the environment in the preamble without the two % symbols in the document, how can I do this?

I try also with \unskip but it works only for the the end:

\newenvironment{itquote}
{\begin{quotation}\itshape}
{\unskip''\end{quotation}}

• When the "begin" part of an environment ends with typeset text that starts a paragraph, add \ignorespaces. For the "end" part your way is correct. – egreg Jul 15 '13 at 15:20
• @egreg ops.. stupid question.. I din't know this command, thanks! – Red Jul 15 '13 at 15:24

In the \begin part you can use \ignorespaces (see egreg's comment), in the \end part a previous space can be undone by \unskip:

\documentclass{article}

\newenvironment{itquote}
{\begin{quotation}\itshape\ignorespaces}
{\unskip''\end{quotation}}

\begin{document}

\begin{itquote}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris.
Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
\end{itquote}

\end{document}


Remarks:

• \unskip removes the last skip space, that can also a vertical skip space. This can be prevented by \ifhmode\unskip\fi. It is not needed here, because there are bigger problems, if the environment contents ends with vertical space. The quotation mark would be out of place anyway.