18

Here's an example of terrible (and non-constant) leading in titles that is causing me trouble:

\documentclass[a4paper, 12pt]{memoir}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text,Numbers=OldStyle]{Cardo}

\begin{document}

\begin{titlingpage}
\begin{center} 
{ \fontsize{36pt}{72pt}\selectfont \bfseries A Title To Show Off The Poor Leading In Titles and How the aaaaaaaaaaaaaaaaaaaaa Skip in Fontsize is Ignored }
\end{center}
\end{titlingpage}

\end{document}

Note how the second argument in \fontsize is completely ignored. I've tried various things to fix this, to no avail. Firstly, why does it do this and, secondly, what can I do to fix it?

NOTE: I would post an example image, but I don't have enough reputation yet. Sorry.

2
  • 4
    Welcome to TeX.sx! As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again.
    – N.N.
    Commented Jul 10, 2012 at 19:42
  • Fantastic, thanks very much for the useful tip. Commented Jul 10, 2012 at 20:16

1 Answer 1

18
\begin{titlingpage}
\begin{center} 
\fontsize{36pt}{72pt}\selectfont\bfseries A Title To Show Off 
The Poor Leading In Titles and How the aaaaaaaaaaaaaaaaaaaaa
Skip in Fontsize is Ignored
\end{center}
\end{titlingpage}

The extra braces are not necessary, as the font size declaration will end with the environment (center) it's in.

A paragraph can have only one baselineskip; what happens with the extra braces is that when TeX evaluates the end-of-paragraph the effect of the font size declaration is already finished, so the baseline skip used is the default one.

In other cases the braces may be necessary, because the font change is not in some environment; issue \par before the closing brace in those situations.

Also \selectfont is not necessary, in this case, because \bfseries executes it anyway.

The image shows "before and after" removal of the extra braces.

enter image description here

5
  • Excellent, thanks very much for your help. The brackets were there because in my actual document there are multiple things within the center environment, but I never thought to remove them to see what happens. Commented Jul 10, 2012 at 20:17
  • @rbobbington Just add \par before the closing brace, as explained.
    – egreg
    Commented Jul 10, 2012 at 20:20
  • @rbobbington: I don’t know the {titelingpage} environment but I prefer to use \centering instead of {center} on {titlepage} since the latter doesn’t add extra white space, i.e. vertical skips before and after it.
    – Tobi
    Commented Jul 10, 2012 at 21:07
  • @Tobi I too thought about it. But it depends whether all elements are centered.
    – egreg
    Commented Jul 10, 2012 at 21:09
  • Sure, but even to center only some lines I use {\centering text\par} to have a better control of the white space with \vspace. I use {center} in the document body where the extra space is desirable. :)
    – Tobi
    Commented Jul 10, 2012 at 21:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .