# Right aligning a quote with extra indentation

I want to insert a quote into a document, have it aligned to the right, italic, with some extra indentation from the right margin, this is what i've managed so far:

\documentclass{book}
\usepackage{lipsum}
\begin{document}

\hfill\textit{This is a very boring,}

\hfill\textit{text without any substance} {\vspace{0.5em}}

\hfill\textit{A future book}

\hfill\textit{Ann Onymous}

\lipsum[5]

\end{document}


This is what it looks like:

But what I want it to look like is like this:

-
Welcome to TeX.sx! – egreg Feb 20 '13 at 11:30

You should, first of all, define an environment (or command) for this, so you can change the formatting in all epigraphs with a single change to the definition.

Your aim can be achieved with a tabular; specify right alignment, no padding on the left and a 2em padding on the right, so the tabular argument should be

@{} r @{\hspace{2em}}


Here's the definition.

\newenvironment{myepigraph}
{\par\hfill\itshape
\begin{tabular}{@{}r@{\hspace{2em}}}} % 2em from the right margin
{\end{tabular}\par\medskip}


Then your epigraph can be typeset with

\begin{myepigraph}
This is a very boring,\\
text without any substance\\[1.5ex]
A future book\\
Ann Onymous
\end{myepigraph}


However, you should look at the epigraph package that has many features for this kind of things.

-

Besides using a tabular environment, you could use, e.g., the epigraph package or my quoting package:

• The \epigraph command provides a cleaner syntax for the case at hand (specify the quoted text in the first argument, the source in the second argument), but it seems there's no easy way to add indentation to a right-aligned quote.

• The quoting environment is normally used for quotes within the running text (so you have to manually separate quote text and source [EDIT: or define a myquote environment that takes the source as additional argument]), but it allows to specify additional indentation.

\documentclass{book}

\usepackage{epigraph}
\setlength{\epigraphwidth}{0.35\linewidth}
\setlength{\epigraphrule}{0pt}
\renewcommand*{\textflush}{flushright}
\renewcommand*{\epigraphsize}{\normalsize\itshape}

\usepackage{quoting}

\newcommand*{\myquotingsource}{}
\newenvironment{myquoting}[1]{%
\renewcommand*{\myquotingsource}{#1}
\begin{quoting}[font={itshape,raggedleft},leftmargin=0.5\linewidth,rightmargin=2em]%
}{%
\par\medskip
\myquotingsource
\end{quoting}%
}

\usepackage{lipsum}

\begin{document}

\epigraph{This is a very boring text without any substance.}{A future book\\Ann Onymous}

\lipsum[5]

\begin{myquoting}{A future book\\Ann Onymous}
This is a very boring text without any substance.
\end{myquoting}

\lipsum[5]

\end{document}


-