# Vertical Text Alignment in Title

I'm trying to make a title format with a large chapter number, and then smaller text with the name of the title. The following code mostly does what I want:

\documentclass[12pt]{book}
\usepackage{fontspec}
\setromanfont[Mapping=tex-text]{Garamond}
\usepackage{titlesec}
\titleformat{\chapter}{\raggedright}
{\fontsize{72pt}{72pt}\selectfont\thechapter}{1em}{\huge}

\begin{document}
\chapter{A Short Title}
Lorem ipsum...
\chapter{A Very Long Title With Extra Words}
Lorem ipsum...
\end{document}


However, if the chapter title is longer than 1 line, the vertical alignment of the numeral is unpleasant. I'd love to tell the numeral to be vertically aligned so that the top of the numeral matches the top of the rest of the text on the line, as opposed to the current alignment, where the baseline of the numeral is aligned with the baseline of the remainder of the text.

I don't know what command would make this possible - and it's probable that there are lots better ways of solving this problem.

-

works for all cases:

\documentclass[12pt,openany]{book}
\usepackage{fontspec,tabularx}
\renewcommand\tabularxcolumn[1]{m{#1}}
\setromanfont[Mapping=tex-text]{Linux Biolinum O}
\newsavebox\CBox
\makeatletter
\vspace*{50\p@}%
\parindent \z@ \normalfont
\sbox\CBox{\fontsize{72pt}{74pt}\selectfont\thechapter}
\usebox\CBox & \Huge \bfseries #1
\end{tabularx}
\par\nobreak
\vskip 40\p@}
\makeatletter

\begin{document}
\chapter{A Short Title}
Lorem ipsum...
\chapter{A Very Long Title With Extra Words}
Lorem ipsum...
\chapter{A Very Long Title With Extra Words A Very Long Title With Extra Words}
Lorem ipsum...

\setcounter{chapter}{10}
\chapter{A Very Long Title With Extra Words A Very Long Title With Extra Words}
Lorem ipsum...
\end{document}

-
Thanks, this is exactly what I was hoping for. –  Bryan Catanzaro Feb 6 '11 at 4:18

Perhaps this approach by the »titlesec« package is something to start with.

\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[explicit]{titlesec}
\usepackage{lmodern}
\usepackage{lipsum}

\titleformat{\chapter}[hang]
{\raggedright}
{\parbox{0.2\textwidth}{\filright\fontsize{72pt}{72pt}\selectfont\thechapter}}
{0pt}
{\huge\parbox{0.8\textwidth}{\filright #1}}

\begin{document}
\chapter{A Short Title}
\lipsum[1]

\chapter{A Very Long Title With Extra Words}
\lipsum[2]
\end{document}


-
This is almost what I want - it looks fine when the chapter title is 2 lines long. But it's not quite what I was looking for when the chapter title is 1 or 3+ lines long. –  Bryan Catanzaro Feb 6 '11 at 4:18
a chapter title must not be 3+ lines long! –  Hedi Naily Nov 16 '13 at 19:41
@RecessionCone: The example has been improved correspondingly. –  Thorsten Donig Nov 17 '13 at 11:14