Featured Book

LaTeX Beginners Guide

Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 16 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Pull quotes, wrapfig, newenvironment not working

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

Pull quotes, wrapfig, newenvironment not working

Postby nwhitehe on Tue Mar 25th, 2008

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  •  Open in writeLaTeX
\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
}
nwhitehe
 
Posts: 1
Joined: Mon Mar 24th, 2008

Re: Pull quotes, wrapfig, newenvironment not working

Postby localghost on Sat Apr 5th, 2008

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  •  Open in writeLaTeX
\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 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany


Return to General

Who is online

Users browsing this forum: No registered users and 16 guests