TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the KOMA-Script scrbook class, and I want to have bold math in my section titles (to match the title text). For this I redefine \sectfont, and it works nicely.


The section titles in the table of contents and the headers are not changed. However, sometimes I do erroneously get bold math in the headers.

I think the problem occurs when the double-page is just full, so that any more text would result in an overflow, and there has to be another section after the current page (so that the next page starts with a section header). Also it only happens when I use line numbers from \usepackage{lineno}.

Is lineno incompatible with KOMA-Script? Is there a better way to get bold math fonts in section titles (but not in the TOC and headers)?

I can of course just disable the line numbers as I will with my final document, but this bug makes me suspect I am doing something wrong, and something else might break. Also, I can just stuff \nolinenumbers into my \sectfont and it seems to work, but if I'm doing something wrong and fragile, then that would be just fixing the symptoms. A MWE is below (compare the top of page 6 with page 4 and 8):







\chapter{Title $xyz$ containing $\chi^2$ math}
\section{Section $A$}
% this double-page is probably not full enough, but
% one more \blindtext will make it overflow

\section{Section $B$}
% this double-page exhibits the bug.

\section{Section $C$}
% this double-page is identical, but doesn't exhibit the bug,
% since there is no section after it (?)

% uncomment this and the bug appears for section C, too: 
%\section{Section $D$}
share|improve this question
Add \mathversion{normal} to the head font, e.g. \renewcommand\headfont{\mathversion{normal}\normalfont}. – Ulrike Fischer Mar 11 '14 at 10:10
Thanks, that worked! If you post it as an answer I can accept it. I guess using \mathversion{bold} in sectfont causes undefined behavior because it may or may not be invoked on a page, but there is nothing by default that undoes it - unlike \bfseries which is undone by \normalfont. – jdm Mar 11 '14 at 10:31
up vote 3 down vote accepted

Add \mathversion{normal} to the head font, e.g. \renewcommand\headfont{\mathversion{normal}\normalfont}.

share|improve this answer
And quite probably \addtokomafont{pageheadfoot}{\mathversion{normal}\normalfont} would work, too? – Speravir Mar 11 '14 at 20:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.