0

I have some long one-word subsection titles that (partly) dont get hyphenated correctly in the title itself and the toc.

\documentclass[12pt,a4paper]{scrartcl}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage[ngerman]{babel}
\usepackage[left=2.5cm,right=2.5cm,
           top=2.5cm,bottom=2.5cm]
           {geometry}
\usepackage{sectsty,ragged2e}
\allsectionsfont{\RaggedRight}
\begin{document}
\tableofcontents
\section{Section}

\subsection{Ethyl (5\textit{R},6\textit{E},8\textit{E})-2-hydroxy-5-[(2-methoxyethoxy)methoxy]-\textit{N}-methoxy-\textit{N}-methyldeca-6,8-dienoat}

\subsection{Dimethyl 2-[(4\textit{S})-4-benzyl-2-oxo-1,3-oxazolidin-3-yl]-2-oxoethylphosphonat}

\end{document}

This MWE leads me to: enter image description here

2
  • Welcome to TeX.SE! Try with explicit hyphenation: \-
    – Mensch
    Aug 19, 2022 at 15:25
  • The hyphenation algorithm algorithm has problems with some of your texts. Try specifying where the hyphens could go. See the \hyphenation macro for use in the preamble. Aug 19, 2022 at 19:06

0

You must log in to answer this question.

Browse other questions tagged .