Change Text Vertical Alignment in Title

2.8k views Asked by At

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.

Thanks!

1

There are 1 answers

1
Charles Stewart On BEST ANSWER

For the sake of getting this question off unanswered: there are a couple of approaches on the tex.sx qn Vertical Text Alignment in Title, where the solution you accepted redefines the Latex internal macro \@makechapterhead to lay out the chapter heading in the output; note that there are other internal macros that either define the text that can be used in headers/footers or set the line in the TOC, and these can similarly be redefined.

It's worth looking at the chapter styles in the Memoir class; Lars Maden's expose gives the standard styles built into the class, and shows how you can define some alternatives,