LaTeX forum ⇒ GeneralPull quotes, wrapfig, newenvironment not working

LaTeX specific issues not fitting into one of the other forums of this category.
nwhitehe
Posts: 1
Joined: Mon Mar 24, 2008 11:57 pm

Pull quotes, wrapfig, newenvironment not working

Postby nwhitehe » Tue Mar 25, 2008 12:08 am

I'm trying to typeset pull quotes. So far I've found wrapfig which can place figures on the edge of pages and wrap text around them, which is nice.

After playing around with options for wrapfig, margins, and fonts, I found some commands that make nice looking pull quotes. The problem is that when I try to encapsulate the commands into an environment, it stops working correctly. The quote gets placed at the end, or on the next page, in a totally wrong position.

Summary:
When I do \pq some text \pqend, it works.
When I do \newenvironment{pullquote}{\pq}{\pqend} and then \begin{pullquote}some text\end{pullquote}, it stops working.

Here is a minimal example showing what happens, and the definitions of \pq and \pqend. Any ideas on what is going on?
\documentclass{article}

\usepackage{wrapfig}

\newcommand{\pq}{\begin{wrapfigure}{o}[1cm]{7cm}\list{}{\leftmargin 0.1cm}\vspace{-0.2in}\item[]\fontfamily{phv}\selectfont\large}
\newcommand{\pqend}{\vspace{-0.20in}\endlist\end{wrapfigure}}
\newenvironment{pullquote}{\pq}{\pqend}

\begin{document}

The thought of writing at the time with no spelling correction,
grammar correction, or in fact corrections of any
kind.  It is remarkable that there are not too
many spelling errors yet, although the content
could definitely be improved.  We pull bits
from the aether for you.
It is remarkable that there are not too
many spelling errors yet, although the content
could definitely be improved.  We pull bits
from the aether for you.  It is remarkable that there are not too
many spelling errors yet, although the content
could definitely be improved.  We pull 10789 bits
from the aether for you.

\begin{pullquote}
%\pq
To be or not to be, that is the question.
Or at least that was the question until you killed me.
%\pqend
\end{pullquote}

The thought of writing at the time with no spelling correction,
grammar correction, or in fact corrections of any
kind.  It is remarkable that there are not too
many spelling errors yet, although the content
could definitely be improved.  We pull bits
from the {\ae}ther for you.
It is remarkable that there are not too
many spelling errors yet, although the content
could definitely be improved.  We pull bits
from the aether for you.  It is remarkable that there are not too
many spelling errors yet, although the content
could definitely be improved.  We pull 10789 bits
from the aether for you.

\end{document}

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Pull quotes, wrapfig, newenvironment not working

Postby localghost » Sat Apr 05, 2008 6:24 pm

It took me some time but finally I've been able to work out an example for typesetting a pull quote. I must admit that I first had to inform myself about what a pull quotes is. But thanks to Wikipedia I got it [1]. Let me remark that this is a very sensible matter. But this example should work.

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext,calc,multicol,wrapfig}

\begin{document}
  \begin{multicols}{2}
    \blindtext
    \begin{wrapfigure}[6]{r}[.5\width+.5\columnsep]{6cm}
      \centering
      \begin{minipage}{5cm}
        \large
        "The quick brown fox jumps over the sleazy dog. The quick brown fox jumps over the sleazy dog."
      \end{minipage}
    \end{wrapfigure}
    \blindtext[2]

    \begin{wrapfigure}[6]{l}[.5\width+.5\columnsep]{6cm}
      \vfill
    \end{wrapfigure}
    \blindtext
  \end{multicols}
\end{document}

Note that have you to be very careful in adjusting the text around the wrapfigure environments to get a proper alignment. I adapted this example from the file "multiple-span.txt", which can be seen as some kind of documentation for the wrapfig package. The example should also work when using the twoclumn option for the document class instead of the multicols environment.

[1] Pull quote - Wikipedia, the free encyclopedia


Best regards and good luck
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “General”

Who is online

Users browsing this forum: No registered users and 10 guests