12

I'd like to accomplish the following:

Ut convallis libero in   -------------------
urna ultrices accumsan. |                   |
Donec sed odio eros.    |  "an important    |
Donec viverra mi quis   |   quote that de-  |
quam pulvinar at        |   serves to be    |
malesuada arcu rhoncus. |   highlighted"    |
Cum sociis natoque      |   ---sourcename   |
                        |                   |
penatibus et magnis     |                   |
dis parturient montes,   -------------------
nascetur ridiculus mus. In rutrum accumsan 
ultricies. Mauris vitae nisi at sem facilisis 
semper ac in est.

So a quote-box, pull-quote or fact box (whatever you'd call it) that highlights a quote within a colored box, sticks to the right- or left-margin of the page and makes the text flow around it. I've searched around and found some topics that were a bit similar ( Block quote with big quotation marks and How do you create pull quotes? for instance), but not exactly. As you find this kind of style often within books, I was wondering if an existing package exist that does this for you.

grrrbytes
  • 3,855

1 Answers1

13

This is easily accomplished using the wrapfig package if you're willing to specify the "number of lines" occupied by the block-quote. Here's a small example using dummy text created by lipsum:

enter image description here

\documentclass{article}
\usepackage{wrapfig}% http://ctan.org/pkg/wrapfig
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\begin{wrapfigure}[25]{r}{.4\linewidth}
\fbox{\begin{minipage}{\dimexpr\linewidth-2\fboxrule-2\fboxsep}
\centering
``Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Proin ac tempus dui. Etiam non mattis neque. Maecenas tempor, 
massa a luctus sollicitudin, elit massa auctor velit, eu mattis 
lacus arcu nec est. Sed et lectus non tellus posuere consequat. 
Donec congue lacinia urna a iaculis. Cras id nisl sed sapien 
euismod rhoncus.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Proin ac tempus dui. Etiam non mattis neque. Maecenas tempor, 
massa a luctus sollicitudin, elit massa auctor velit, eu mattis 
lacus arcu nec est. Sed et lectus non tellus posuere consequat. 
Donec congue lacinia urna a iaculis. Cras id nisl sed sapien 
euismod rhoncus.''
\end{minipage}}
\end{wrapfigure}
\lipsum[1-2]
\end{document}
​

Read the wrapfig documentation for more information on the environment specification for wrapfigure.

Note that this will be problematic if the block-quote spans beyond the page boundary.

Werner
  • 603,163
  • thanks a lot. I have some difficulties to make it look good with multicols. It kind of screws up the layout. But it gives me some headstart. – grrrbytes Apr 17 '12 at 10:23
  • @Mixhael: You didn't mention the requirement/usage of multicols in your question. Follow-up questions like this are more than welcome! Please use the "Ask Question" link for your new question; there you can link back to this question to provide the background. – Werner Apr 17 '12 at 14:21