1

When I use ß in headings - which I want to be in small caps - it gets replaced by a double S. Is there a way to still have a ß there, which is also the same height as the other letters?

Just to clarify: I've modified the \sectionlinesformat this way so that I get small caps in the headers while displaying the text normal in the toc.

MWE:

\documentclass[10pt, oneside, numbers=noenddot]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage[osf]{newpxtext}
\usepackage[ngerman]{babel}

\setkomafont{chapter}{\huge\fontfamily{qpl}\selectfont\normalfont\lsstyle\scshape}
\setkomafont{section}{\large\fontfamily{qpl}\selectfont\normalfont\lsstyle\scshape}

\renewcommand*{\sectionlinesformat}[4]{#3 \MakeLowercase{#4}}

\addtokomafont{chapterentry}{\normalfont\lsstyle\scshape}

\begin{document}
    \tableofcontents
    \chapter{größe}
    \section{Größe}
\end{document}

EDIT: I've already tried the solution from Capital ẞ in LaTeX/XeTeX/lualatex/whatever, but this didn't work.

fuj36840
  • 550

3 Answers3

2

The expl3 language provides a function tl_upper_case:nn {language} {input}, where the language code de-alt converts ß to a großes Eszett.

\documentclass{minimal}
\usepackage{libertinus}

\ExplSyntaxOn
\newcommand\toUpper[1]{\tl_upper_case:nn{de-alt}{#1}}
\ExplSyntaxOff

\begin{document}

\toUpper{Frauenfußball}

\end{document}

Libertinus font sample

In newer systems, you could instead use \text_uppercase:nn. As of 2020, the documentation says that the second argument should be “a BCP 47 string,” but in fact only de-alt works, and de-DE-1996 as specified in the RFC does not. With the newer interfaces, you would therefore write:

\text_uppercase:nn {de-alt}{\text_expand:n{#1}}

The expl3 documentation claims that you can define your own mapping with \char_set_uccode:nn, but when I tested this with

\char_set_uccode:nn {`ß} {`ẞ}

within the same TeX group as a \tl_upper_case:n or text_uppercase:n, it still mapped ß to SS.

Davislor
  • 44,045
1

Well ß is in pdflatex a command, so yes you could locally redefine it. But to get a suitable size you would have to scale quite a lot and imho this looks simply bad:

\documentclass[10pt, oneside, numbers=noenddot]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage[osf]{newpxtext}

\begin{document}
{\scshape Aabc\textup{ß}abc{\upshape\fontsize{6.5pt}{6.5pt}\selectfont ß}abc}
\end{document}

enter image description here

Ulrike Fischer
  • 327,261
  • The problem with this approach is that the letter in both the chapter heading and the toc changes to the specified size – fuj36840 Jun 05 '20 at 14:16
  • @Johannes sure, As I think it is a bad idea I only try to demonstrate how bad it looks and not to implement a solution. – Ulrike Fischer Jun 05 '20 at 14:17
0

You need to use a font that provides the character you are expecting. In a lot of fonts, ß is replaced by SS in small caps, because this used to be the standard replacement. Check https://de.wikipedia.org/wiki/Gro%C3%9Fes_%C3%9F to see that only in 2008, the uppercase character was introduced to Unicode.

TobiBS
  • 5,240
  • 2
    SS is still the "standard replacement". It's both specified in Unicode as the uppercase variant and in the german spelling rules (The rule basically says: When writing in capitals, "SS" is used. Furthermore, the capital letter "ẞ" is also allowed.) – Marcel Krüger Jun 05 '20 at 13:46