# Align right (hfil) doesn't work for me [duplicate]

I am using TEXShop working at a MAC and I don't really know what I am doing, I am just trying to fill a template. But I want to add something that the template does not offer; align a section to the far right. So I have the following:

\chapter{Introduction}

% I need the following to be aligned at the far right
\begin{quote}
\hfil Lorem ipsum dol, \\
\hfil John Doe, Lorem\\[1ex]
\end{quote}
% Until here

% And here the normal paragraph begins
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt


But it doesn't really work. Any ideas?

## marked as duplicate by Werner, Jesse, Fran, Masroor, Adam LiterJun 10 '14 at 3:48

• Remove all those hfils and add \raggedleft after \begin{quote}. How about using some dedicated packages for for producing chapter quotes? – user11232 Jun 10 '14 at 0:19
• Welcome to the site! It'd be great if you could create a small, complete Minimum Working Example :) – cmhughes Jun 10 '14 at 0:32
• Thanks! I think it finally works with all the answers below! – ddmichael Jun 10 '14 at 0:50
• It's seems like you're after something like (possible duplicate): “Inspirational” quote at start of chapter – Werner Jun 10 '14 at 0:59

I think you are trying to put some chapter quotes. It is better to use some dedicated packages for this. epigraph is one of them.

\documentclass{book}
\usepackage{epigraph}
\usepackage{kantlipsum}
\begin{document}
\chapter{Introduction}
\epigraph{Lorem ipsum dol, consecteture adipisicing elit.}{John Doe, Lorem}
\kant
\end{document}


You can easily customize things:

\documentclass{book}
\usepackage{epigraph}
\usepackage{kantlipsum}
\begin{document}
\chapter{Introduction}
\renewcommand{\textflush}{flushright}
\setlength{\epigraphrule}{0pt}
\setlength{\epigraphwidth}{0.5\textwidth}
\epigraph{Lorem ipsum dol, consecteture adipisicing elit.}{John Doe, Lorem}
\kant
\end{document}


If you are using either scrbook or memoir they offer the same functionality as built in feature.

• Amazing, it works! Any ideas on how I can make the quote box a little larger? Because if you add a little longer text it doesn't fit each line. Thanks! – ddmichael Jun 10 '14 at 0:50
• @ddmichael Uae \setlength{\epigraphwidth}{0.5\textwidth} as in updated answer. Change 0.5\textwidth suitably. – user11232 Jun 10 '14 at 1:09

You can use flushright or tabular:

\documentclass{article}

\begin{document}

\begin{quote}
\begin{flushright}
Lorem ipsum dol, \\
John Doe, Lorem\\[1ex]
\end{flushright}
\end{quote}

\begin{tabular}{r}
Lorem ipsum dol, \\