GeneralPull quotes, wrapfig, newenvironment not working

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

Pull quotes, wrapfig, newenvironment not working

Post by nwhitehe »

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?

Code: Select all

Code, edit and compile here:
\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
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Recommended reading 2024:

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

Pull quotes, wrapfig, newenvironment not working

Post by localghost »

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.

Code: Select all

Code, edit and compile here:
\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}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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¹
Post Reply