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?
  1. \documentclass{article}
  2.  
  3. \usepackage{wrapfig}
  4.  
  5. \newcommand{\pq}{\begin{wrapfigure}{o}[1cm]{7cm}\list{}{\leftmargin 0.1cm}\vspace{-0.2in}\item[]\fontfamily{phv}\selectfont\large}
  6. \newcommand{\pqend}{\vspace{-0.20in}\endlist\end{wrapfigure}}
  7. \newenvironment{pullquote}{\pq}{\pqend}
  8.  
  9. \begin{document}
  10.  
  11. The thought of writing at the time with no spelling correction,
  12. grammar correction, or in fact corrections of any
  13. kind. It is remarkable that there are not too
  14. many spelling errors yet, although the content
  15. could definitely be improved. We pull bits
  16. from the aether for you.
  17. It is remarkable that there are not too
  18. many spelling errors yet, although the content
  19. could definitely be improved. We pull bits
  20. from the aether for you. It is remarkable that there are not too
  21. many spelling errors yet, although the content
  22. could definitely be improved. We pull 10789 bits
  23. from the aether for you.
  24.  
  25. \begin{pullquote}
  26. %\pq
  27. To be or not to be, that is the question.
  28. Or at least that was the question until you killed me.
  29. %\pqend
  30. \end{pullquote}
  31.  
  32. The thought of writing at the time with no spelling correction,
  33. grammar correction, or in fact corrections of any
  34. kind. It is remarkable that there are not too
  35. many spelling errors yet, although the content
  36. could definitely be improved. We pull bits
  37. from the {\ae}ther for you.
  38. It is remarkable that there are not too
  39. many spelling errors yet, although the content
  40. could definitely be improved. We pull bits
  41. from the aether for you. It is remarkable that there are not too
  42. many spelling errors yet, although the content
  43. could definitely be improved. We pull 10789 bits
  44. from the aether for you.
  45.  
  46. \end{document}

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

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.

  1. \documentclass[11pt,a4paper]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[latin1]{inputenc}
  4. \usepackage[english]{babel}
  5. \usepackage{blindtext,calc,multicol,wrapfig}
  6.  
  7. \begin{document}
  8. \begin{multicols}{2}
  9. \blindtext
  10. \begin{wrapfigure}[6]{r}[.5\width+.5\columnsep]{6cm}
  11. \centering
  12. \begin{minipage}{5cm}
  13. \large
  14. "The quick brown fox jumps over the sleazy dog. The quick brown fox jumps over the sleazy dog."
  15. \end{minipage}
  16. \end{wrapfigure}
  17. \blindtext[2]
  18.  
  19. \begin{wrapfigure}[6]{l}[.5\width+.5\columnsep]{6cm}
  20. \vfill
  21. \end{wrapfigure}
  22. \blindtext
  23. \end{multicols}
  24. \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

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests