[Tex/LaTex] Right aligning a quote with extra indentation

epigraphshorizontal alignmentindentationquoting

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 (note — flush to the right margin):

HAVE

But what I want it to look like is like this (note — inset from the right margin):

WANT

Best Answer

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.

Related Question