title: LaTeX - defining a custom 'wrapfig' environment
body: <p>I'm typesetting a book with LaTeX.  The text design includes pull quotes, which are supposed to look something like this:</p>
  
  <pre><code>Chicken chicken chicken chicken  -------------
  chicken chicken chicken chicken     CHICKEN
  chicken chicken chicken chicken     CHICKEN
  chicken chicken chicken chicken  -------------
  chicken chicken chicken chicken chicken chicken
  </code></pre>
  
  <p>So, <code>wrapfig.sty</code> seems like it has the basic mechanism I need, and I just need to define an environment that does the horizontal rules, centering, and larger type.  The problem is that wrapfigure doesn't seem to want to be nested in an environment definition.  If I have this in my text body it works</p>
  
  <pre><code>\begin{wrapfigure}{o}{2in}
  \large chicken chicken
  \end{wrapfigure}
  </code></pre>
  
  <p>but if I do this in the prologue</p>
  
  <pre><code>\newenvironment{pullquote}
    {\begin{wrapfigure}{o}{2in}\large}
    {\end{wrapfigure}}
  </code></pre>
  
  <p>and then I have</p>
  
  <pre><code>\begin{pullquote}
  chicken chicken
  \end{pullquote}
  </code></pre>
  
  <p>I get this error message:</p>
  
  <pre><code>Package wrapfig Warning: Collision between wrapping environments ...
  </code></pre>
  
  <p>the pull quote is typeset several paragraphs below where I want it (at the approximate location of the <em>next</em> pull quote, it looks like, or else at the end of the document) and the body text doesn't get wrapped around the pull quote.  What gives?  How do I make this work?</p>