1

I just updated my LaTeX distribution to MacTex 2016 and also updated all my packages with the tlmgr update --all-command.

After that I recompiled a project of mine and didn't believe my eyes. My subsections, which were underlinded, are now double-underlined, but only under the numbers (-> screenshots).

I have coded them like this in the preamble, so that they are displayed in the same serif font as the text:

\addtokomafont{disposition}{\rmfamily}

\titleformat{\subsection}
    {\normalfont\scshape}
    {\thesubsection}
    {1.5em}
    {}

\subsectionfont{\normalfont\underline}

If I remove \underline from the last line of code, both underlines disappear.

This was the document before updating:

before updating

An this is after updating:

after updating

Do you have an idea why this happened? How can I remove the second underline?


Edit 1 - Added an MWE:

% -------------------------------------
% -----        PREAMBLE           -----
% -------------------------------------

% Set Document Class
\documentclass[12pt,a4paper]{scrartcl} 


% Layout & Language Packages & Options
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\usepackage{lmodern}
\usepackage{titlesec}
\usepackage{sectsty}

% Code to display subsections in the serif font
\addtokomafont{disposition}{\rmfamily}

\titleformat{\subsection}
    {\normalfont\scshape}
    {\thesubsection}
    {1.5em}
    {}

\subsectionfont{\normalfont\underline}


% -------------------------------------
% -----        DOCUMENT           -----
% -------------------------------------
\begin{document}
\section{Test Section}

\subsection{Test Subsection}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{document}

It compiles to this: pdf

Sam
  • 2,958

1 Answers1

1

Usage of package `titlesec' together(scrartcl) with a KOMA-Script class is not recommended.

But if you insist on using titlesec, you could use the solution https://tex.stackexchange.com/a/27337/36296 and do something like:

 \documentclass{scrartcl} 

\usepackage[explicit]{titlesec}
\usepackage[normalem]{ulem}

\titleformat{\subsection}
  {\normalfont\scshape}{}{0em}{\uline{\thesubsection\hspace*{1em}#1}}

\begin{document}
\section{Test Section}
\subsection{Test Subsection}
\end{document}

enter image description here