3

This question already has an answer here:

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 consecteture adipisicing elit.'' \\[1ex]
\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?

Here's a sample of how it initially looked

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

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.

  • 1
    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
1

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}

enter image description here

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}

enter image description here

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
2

You can use flushright or tabular:

\documentclass{article}

\begin{document}

\begin{quote}
\begin{flushright}
``Lorem ipsum dol, \\
consecteture adipisicing elit.'' \\[1ex]
John Doe, Lorem\\[1ex]
\end{flushright}
\end{quote}

\begin{tabular}{r}
``Lorem ipsum dol, \\
consecteture adipisicing elit.'' \\[1ex]
John Doe, Lorem\\[1ex]
\end{tabular}

\end{document}

enter image description here

  • Unfortunately that doesn't work. – ddmichael Jun 10 '14 at 0:57
  • @ddmichael I what sense doesn't it work? The MWE above does produce the image above which seems to be what you asked for? – Andrew Jun 10 '14 at 13:05
  • It produces the similar output with the one I've quoted above. I just did a copy paste of your code. It is highly probable that I am missing something though as I am fairly new to this. – ddmichael Jun 10 '14 at 17:38

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