Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

marked as duplicate by lockstep, Marco Daniel, Harish Kumar, Martin Schröder, Werner Aug 21 '12 at 18:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Welcome to TeX.sx! A tip: You can use backticks ` to mark your inline code as I did in my edit. –  Joseph Wright Aug 5 '12 at 10:09
    
No it's not duplicate because this is using article –  guest453453 Aug 5 '12 at 10:17
    
It's very close, but I'll try to come up with a solution. –  lockstep Aug 5 '12 at 10:20
add comment

1 Answer

up vote 10 down vote accepted

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

share|improve this answer
    
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 5 '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 5 '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 5 '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 5 '12 at 10:54
    
I got it working by doing \setlength\epigraphwidth{16cm}, thanks all. –  guest453453 Aug 5 '12 at 10:59
show 2 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.