Unable to supress ligatures in headings which are set in Caps
With a current luaotfload (version 2.96) you can disable the ligatures in the SmallCapsFeatures:
\documentclass[%
a4paper,
DIV=9,
fontsize=14pt,
parskip=half-
]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}[%
Ligatures=Common,
SmallCapsFeatures=
{Letters=UppercaseSmallCaps,
Ligatures=CommonOff}, %disable ligatures
]
\setkomafont{disposition}{\rmfamily}
\usepackage[tracking=true]{microtype}
\SetTracking{encoding=*,shape=sc}{160}
\RedeclareSectionCommand[%
font={\scshape\mdseries\Large}
]{section}
\RedeclareSectionCommand[%
font={\mdseries\Large}
]{subsection}
\begin{document}
\section{Berufliche Praxis}
Berufliche Praxis\par
ff fl fi
\end{document}
Here is an automated approach that reconditions the arguments of \section
to look for specified ligatures, such as fl
and to replace them with, for example, f\kern0ptl
.
In the MWE, look for the lines between \makeatletter
and \makeatother
for the approach.
As an aside, I actually used the same method to also increase the default kern of the space character in small-caps section titles.
Shown for ligatures fl
and ff
. Can easily add more as needed.
EDITED to handle star sections/toc.
% !TeX program = lualatex
% !TeX encoding = UTF-8 Unicode
\documentclass[%
a4paper,
DIV=9,
fontsize=14pt,
parskip=half-
]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}[%
Ligatures=Common,
SmallCapsFeatures={Letters=UppercaseSmallCaps},
]
\setkomafont{disposition}{\rmfamily}
\usepackage[tracking=true]{microtype}
\SetTracking{encoding=*,shape=sc}{160}
\usepackage[ngerman]{selnolig}
\RedeclareSectionCommand[%
font={\scshape\mdseries\Large}
]{section}
\RedeclareSectionCommand[%
font={\mdseries\Large}
]{subsection}
\makeatletter
\usepackage{listofitems}
\expandafter\def\csname{fl}lig\endcsname{f\kern0ptl}% fl
\expandafter\def\csname{ff}lig\endcsname{f\kern0ptf}% ff
\expandafter\def\csname{ }lig\endcsname{\hspace{11pt}}% INCREASE SPACE KERN
\setsepchar{fl||ff|| }% CONCATENATE THE DESIRED LIGATURES WITH || "OR"
\let\svsection\section
\renewcommand\section{\@ifstar{\starsection}{\nostarsection}}
\newcommand\starsection[1]{%
\tmptitle{#1}%
\svsection*{\tmp}%
}
\newcommand\nostarsection[2][\relax]{%
\tmptitle{#2}%
\if\relax#1\relax\svsection[#2]{\tmp}\else%
\svsection[#1]{\tmp}%
\fi%
}
\newcommand\tmptitle[1]{%
\readlist\myligs{#1}%
\def\tmp{}%
\foreachitem\x\in\myligs{%
\expandafter\g@addto@macro\expandafter\tmp\expandafter{\x}%
\ifnum\xcnt<\listlen\myligs[]\relax
\expandafter\expandafter\expandafter\g@addto@macro
\expandafter\expandafter\expandafter\tmp
\expandafter\expandafter\expandafter{%
\csname{\myligssep[\xcnt]}lig\endcsname}%
\fi
}%
}
\makeatother
\begin{document}
\tableofcontents
\hrulefill
\section[blah Berufliche]{Berufliche Praxis}
\section{Hoffähige Praxis}
\subsection{Berufliche Praxis}
\end{document}
Of course, I shouldn't mention the crazy stuff you can do with this approach. But I will. Adding these lines (and the xcolor
package):
\expandafter\def\csname{e}lig\endcsname{\kern3pt\textcolor{red}{e}\kern1pt}
\setsepchar{fl||ff|| ||e}% CONCATENATE THE DESIRED LIGATURES WITH || "OR"
produces this result: