latex2e
latex2e copied to clipboard
Vertical spacing with headings holding capital umlauts
Brief outline of the bug
Using a capital umlaut with \section
or \subsection
causes a vertical shift of the heading as it occupies more space than reserved. So using \section{Ä title}
instead of \section{A title}
leads to different vertical spacing and consequently maybe to differing paragraph or page breaks.
The first try using \strut
within the heading just shifts the problem to the first line after the heading. The naive approach with something like \newcommand*\naivestrut{\vphantom{\textsuperscript{\"A\"O\"U}}}
gives at least a uniform result.
Minimal example showing the bug
\RequirePackage{latexbug}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\begin{document}
\section{A title}
A \blindtext
\clearpage
\section{A title}
Ä \blindtext
\clearpage
\section{Ä title}
Ä \blindtext
\clearpage
\section{Ä title}
A \blindtext
\clearpage
\section{\strut A title}
A \blindtext
\clearpage
\section{\strut A title}
Ä \blindtext
\clearpage
\section{\strut Ä title}
Ä \blindtext
\clearpage
\section{\strut Ä title}
A \blindtext
\clearpage
\newcommand*\naivestrut{\vphantom{\textsuperscript{\"A\"O\"U}}}
\section{\naivestrut A title}
A \blindtext
\clearpage
\section{\naivestrut A title}
Ä \blindtext
\clearpage
\section{\naivestrut Ä title}
Ä \blindtext
\clearpage
\section{\naivestrut Ä title}
A \blindtext
\clearpage
\end{document}
Log file (required) and possibly PDF file
Why don't you enlarge \topskip?
I don't think it is a bug. Why should the code adapt to german? There are other languages with more accents which probably would need even more spaces. But changing section so that every language fits in, would create too much space for languages without accents. So what is needed is some strut that user can adapt to their needs.
A \topskip would show up in other places too @u-fischer where it would be noticeable and not desired.
It is, if you like, a deficiency of TeX itself which has a somewhat simpleminded model around \topskip and the like. So I agree the right approach is a strut in the heading that only affects the height. But it is nothing that can be implemented in standard classes without invalidating millions of documents as their pagination change. So bottom line it is "works as (badly) designed" and more elaborate classes are free to add such a strut in the configurations of headings.
One option in a given document would be to apply \smash to the section title (or only to the Ä?) It seems to give consistent spacing.
as a one-off yes, as a more general solution I think document classes should define headings so that they deploy a reasonable topskip that fits the fonts they use. for backwardcompatibility I don't see that anything can be done to the standard classes or to the default kernel code. That can only be done if we provide a new set of classes (in addition to existing ones)
As Frank correctly assumed, I was looking for a general solution to the problem. I had already implemented something in my classes, but originally used \strut
incorrectly, which may have resulted in a vertical baseline shift of the first line after the heading. Thanks to all for the suggestions. As far as I am concerned, the topic can be closed.
I'll keep it on long term as it is something to keep in mind.