Quantcast
Viewing latest article 3
Browse Latest Browse All 6

Answer by Werner for How do you create pull quotes?

Here is a much more manual approach, but perhaps similar in style to @YiannisLazarides' answer, for inserting a pull quote. It uses the \parshape primitive to adjust the indentation (or line width) on a per-line basis:

Image may be NSFW.
Clik here to view.
enter image description here

\documentclass{article}\usepackage[margin=1in]{geometry}% http://ctan.org/pkg/geometry\usepackage{graphicx}% http://ctan.org/pkg/graphicx\usepackage{xcolor}% http://ctan.org/pkg/xcolor\usepackage{eso-pic}% http://ctan.org/pkg/eso-pic\usepackage{lipsum}% http://ctan.org/pkg/lipsum\usepackage{multicol}% http://ctan.org/pkg/multicol\newcommand{\zindent}{0pt \linewidth}% full width/no indent\newcommand{\rindent}{0pt \dimexpr\linewidth-11em\relax}% right indent\newcommand{\lindent}{11em \dimexpr\linewidth-11em\relax}% left indent\newcommand{\leftquote}{\smash{\raisebox{-1em}{\makebox[2em][r]{\Huge\bfseries\textcolor{blue!50}\textquotedblleft}}}}%\newcommand{\rightquote}{\makebox[2em][l]{\smash{\raisebox{-1em}{\Huge\bfseries\textcolor{blue!50}\textquotedblright}}}}%\newcommand{\leftcorr}{% Left column correction  \parshape 15    \zindent \zindent \zindent    \rindent \rindent \rindent \rindent    \rindent \rindent \rindent \rindent    \rindent \rindent \rindent    \zindent%}\newcommand{\rightcorr}{% Right column correction  \parshape 13    \zindent    \lindent \lindent \lindent \lindent    \lindent \lindent \lindent \lindent    \lindent \lindent \lindent    \zindent%}\newcommand{\insertpullquote}{%  \AddToShipoutPictureFG*{%    \AtPageCenter{\vspace*{4em}\hspace*{-9em}%      \begin{minipage}[c]{18em}        \sffamily\llap{\leftquote}\large This is a pull quote that describes some really nifty stuff        about this page. It grabs your attention, and pulls you        right into the story. Hey, that's why they call it a        pull quote! The \texttt{lipsum}        package text doesn't make for a pleasant read. \hfill \rlap{\rightquote}      \end{minipage}    }%  }%}\begin{document}\begin{multicols}{2}\lipsum[1]\insertpullquote% Insert pull quote\leftcorr% Left correction\lipsum[2-5]\rightcorr% Right correction\lipsum[6]\lipsum[7]\lipsum[8]\end{multicols}\end{document}

With a prior knowledge of the placement, three things are required:

  1. Adding a right indentation in the left column (using \leftcorr in the MWE);
  2. Adding a left indentation in the right column (using \rightcorr in the MWE); and
  3. Inserting the content/pull quote (using \insertpullquote in the MWE).

Here is some detail regarding the above steps:

  1. The right indentation (or \leftcorr) is set over 15 lines; the first 3 are regular lines with 0pt indent stretching the entire \linewidth (therefore the 3 \zindents). The next 11 are indented 0pt, but only have a width of \linewidth-11em (therefore the 11 \rindents). The final line resets the paragraph alignment to the regular width (therefore the single \zindent).

  2. The same as the above, just over 13 lines, with a reverse usage of indentation and line width.

  3. This is just a bit of playing around with stuff - colour using xcolor, box movements using graphicx and overlaps \llap and \rlap. The pull quote is set in a box of width 18em with the text quotes on either side set in 2em overhung boxes. Hence the 11em indent/width modification in item (1) and (2) since the inner pull quote "spans" 22em (11em into each column).

As you can see, the code is not always that pretty, but it is definitely possible. I don't think the sequential way TeX parses code is meant to accommodate this kind of request easily (at the moment). That is, when you think about the way boxes have to be laid out on the page, knowledge of already set boxes is unknown to TeX without any manual intervention.

Page layout in multi-column mode was provided by the multicol package, although it might just as well have been provided using a twocolumn document class option. eso-pic provided the means to position an item on the page during page shipout (via \AddToShipoutPictureFG* and \AtPageCenter), although manual placement or placement via something like tikz or wrapfig would also have been possible.

The xcolor package provided some colour, while lipsum supplied the dummy text. geometry added some page real estate. None of these packages may be required in your end product.


Viewing latest article 3
Browse Latest Browse All 6

Trending Articles