# How to make \chapter and \part align right and get a quote under them?

Consider this example: http://jmvdveer.home.xs4all.nl/algol68g.pdf

Section and chapter titles are set so they align with the right margin, how do I do that? and more importantly, how do I make them align to left and right, depending on even and odd page?

If you scroll down to page "xi" (Preface), there's a quote from Blaise Pascal right under the chapter line. I seem to remember this was part of a Koma class, but I can't find it anymore how to get it. I believe there was an extra command to get things like qotes, etc, right under a \chapter{} or \part{}.

I'm using XeLaTeX, with the Koma classes.

• Thw quote could be set up a number of ways. The easiest way would by to use \hfill$\lbrace$\parbox and insert the line breaks by hand. Another \hfill inside the \parbox will right justify the name$\rbrace$ – John Kormylo Jul 28 '14 at 23:10
• @JohnKormylo I found the package [epigraph][1] which kinda does what I want, but the alignment is still an issue. [1]: ctan.org/tex-archive/macros/latex/contrib/epigraph – polemon Jul 29 '14 at 2:03

It appears no one has found a package that fits. Feel free to change the font styles. The hard part was getting the left and right braces aligned.

\documentclass{book}

\newsavebox{\tempbox}
\newlength{\tempheight}

\newcommand{\profundity}[3]% #1=quote, #2=source, #3=author
{\raggedright\textit{#1}\newline\textbf{#2}\hfill -\hfill #3}}%
\settodepth{\tempheight}{\usebox{\tempbox}}% distance from top baseline to bottom
\addtolength{\tempheight}{-.2\baselineskip}% distance from bottom baseline to bottom
\hfill$\lbrace$\usebox{\tempbox}\raisebox{-\tempheight}{$\rbrace$}\newline}

\begin{document}
\chapter{Preface}
\noindent\rule{\textwidth}{.5pt}

\profundity{Except for the hanging indentation, enumerate is for people who can't count.}%
{Personal Correspondence}{John Kormylo}

And now for something completely different.
\end{document}


If you wanted KOMA, add a MWE next time.