3

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

ddmichael
  • 133

2 Answers2

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

Ross
  • 5,656
  • 2
  • 14
  • 38
  • Unfortunately that doesn't work. – ddmichael Jun 10 '14 at 00: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? –  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
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 00:50
  • @ddmichael Uae \setlength{\epigraphwidth}{0.5\textwidth} as in updated answer. Change 0.5\textwidth suitably. –  Jun 10 '14 at 01:09