0

I am working in a scrreprt file and I would like to have two things:

  1. in chapter, section and subsection headers to show the math symbol in a bold font like the normal text
  2. to still then show those chapter, section, subsection names in the table of contents in the usual font.

e.g. in \chapter{Hello $1$} the 1 should be displayed in bold font like the Hello and that whole header should be displayed in usual font in the toc.

Hope it's clear what I would like to have! Thanks and br!

2
  • Not that it helps, but is that really a good idea? What if there are both non-bold x and bold x in a formula, for example?
    – mickep
    Commented Jul 10, 2022 at 9:52
  • That doesn't happen in my case :-) Commented Jul 10, 2022 at 10:44

1 Answer 1

1

You can add \boldmath to disposition.

Of course, if you want math in titles, you must also disable sans serif.

\documentclass[egregdoesnotlikesansseriftitles]{scrreprt}

\addtokomafont{disposition}{\boldmath}

\begin{document}

\chapter{Example $x=1$}

\end{document}

enter image description here

With the default sans serif titles it would be

enter image description here

which is frankly unacceptable: inconsistent and largely awful.

11
  • Is there a command like \sansmath that could be hooked to the command in a similar way? (Disregarding any discussion about whether or not this is desirable.)
    – Gaussler
    Commented Jul 10, 2022 at 10:07
  • @Gaussler Not with Computer Modern fonts and coverage of math sans serif is not really good. Anyway, it would require quite extensive work for correctly defining a suitable math version.
    – egreg
    Commented Jul 10, 2022 at 10:26
  • Thanks, unfortunately it doesn't work...the math symbols in the headers are still shown in normal and not in bold font... Commented Jul 10, 2022 at 10:44
  • 1
    @HelloEveryone You need to show a minimal example. Let me guess: do you have \usepackage{mathptmx}?
    – egreg
    Commented Jul 10, 2022 at 12:19
  • Yes your guess is correct - I do use the mathptmx package! Gladly I can give you a minimal example later! Commented Jul 10, 2022 at 12:47

You must log in to answer this question.

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