21

Possible Duplicate:
“Inspirational” quote at start of chapter

I'm using \documentclass[a4paper,12pt]{article}. How to do this beautiful quote by using \renewenvironment{quote} or having my own \newenvironment{myQuote}?

Quote

1 Answers1

22

I took Gonzalo Medina's second solution in his answer to "Inspirational" quote at start of chapter and changed the following:

  • Instead of using the memoir class, the epigraph package (from memoirs author) is loaded;

  • \epigraphfontsize is replaced with \epigraphsize;

  • The etoolbox package is used to patch the internal \@epitext command so that \itshape works.


\documentclass{article}

\usepackage{epigraph}

% \epigraphsize{\small}% Default
\setlength\epigraphwidth{8cm}
\setlength\epigraphrule{0pt}

\usepackage{etoolbox}

\makeatletter
\patchcmd{\epigraph}{\@epitext{#1}}{\itshape\@epitext{#1}}{}{}
\makeatother

\begin{document}

\section{Graph Theory}

\epigraph{``Begin at the beginning," the King said gravely, ``and go on till you come to the end: then stop."}{--- \textup{Lewis Carroll}, Alice in Wonderland}

\end{document}

enter image description here

lockstep
  • 250,273
  • Thanks this works so far, but how to do it 100% width, like \begin{quote}...\end{quote} would do it? (I don't need \section btw.) – guest453453 Aug 05 '12 at 10:40
  • 1
    @guest453453 I wouldn't redefine the quote environment because it might be needed for block quotes in the text body. BTW, quote uses a width of somehat less than 100%, and in my example you may change the value of the \epigraphwidth length. – lockstep Aug 05 '12 at 10:43
  • ok lockstep, but how can I do \newenvironment{myQuote} then (or full width like \begin{quote}...\end{quote} would do it if using \epigraph)? – guest453453 Aug 05 '12 at 10:45
  • The epigraph package offers an epigraphs environment where you write individual quotes using \qitem-- have a look at the manual. – lockstep Aug 05 '12 at 10:54
  • I got it working by doing \setlength\epigraphwidth{16cm}, thanks all. – guest453453 Aug 05 '12 at 10:59
  • @guest453453 You may also use \setlength\epigraphwidth{\textwidth}. – lockstep Aug 05 '12 at 11:00
  • Thanks a lot. This is the "work-around" needed for documentclass report as well. – Mads May 25 '15 at 11:41