[ This is an updated version of http://stackoverflow.com/questions/3233031/latex-defining-a-custom-wrapfig-environment ]
The wrapfig package interacts badly with the setup and teardown done by \begin and \end. Concretely, this is not typeset correctly:
\documentclass{article}
\usepackage{wrapfig}
\newenvironment{pullquote}
{\begin{wrapfigure}{o}{2in}\large}
{\end{wrapfigure}}
\begin{document}
\begin{pullquote}
Chicken chicken
\end{pullquote}
Chicken chicken chicken chicken,
chicken chicken chicken chicken.
Chicken chicken, chicken chicken
chicken chicken chicken chicken
chicken chicken chicken chicken.
\end{document}
The "pull quote" is displaced downward to the end of the document (or to the next wrapfigure, if any) and I get a warning about collisions between wrapping environments in the log file.
But this is typeset correctly (note the dirty-trick use of the internal macros defined by \newenvironment):
\documentclass{article}
\usepackage{wrapfig}
\newenvironment{pullquote}
{\begin{wrapfigure}{o}{2in}\large}
{\end{wrapfigure}}
\begin{document}
\pullquote
Chicken chicken
\endpullquote
Chicken chicken chicken chicken,
chicken chicken chicken chicken.
Chicken chicken, chicken chicken
chicken chicken chicken chicken
chicken chicken chicken chicken.
\end{document}
I am looking for concrete advice on how to fix this apparent bug in wrapfig, which AFAICT is unmaintained.