Faulty german hyphenation in XeLaTeX

hyphenationxetex

As you see in the picture beneath some words, not only "Gegenüberstellung" the hyphenation is not correct, at the right site of the paper. Unfortunately the different questions relating this topic here on TexExchange did not solve the issue. To help me out I use `Si-cher-heits-ma-nage-ment" but it's not practical for the whole document. XeLateX and System "Times new Roman" Font.

To be more precise: The word "Ge-gen-über-stel-lung" should break at "Ge-" or at least at "Gegen-". mostly it works but in every Section there will be a handful of Words where you need to do the break manually with Latex-Syntax: "Ge-gen-über-stel-lung" or it will be written to the edge of the paper or break to late in the middle like "Gegenüberstellung".

enter image description here

MWE:

\documentclass[12pt,oneside,titlepage,listof=totoc,bibliography=totoc]{scrartcl}
\usepackage[a4paper, left=4cm, right=2cm, top=4cm, bottom=2cm]{geometry}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{setspace}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\babelprovide[hyphenrules=ngerman-x-latest]{ngerman}
\usepackage[german=quotes,autostyle]{csquotes}
\usepackage{threeparttable}
\usepackage{longtable}
\usepackage{pdfpages}
\usepackage{appendix}
\usepackage{pdfsync}
\usepackage{blindtext}
\usepackage{fontspec}                   
\setmainfont{Times New Roman}
\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures=TeX}
\addtokomafont{sectionentry}{\mdseries} 
\setkomafont{sectioning}{\bfseries}     
\usepackage{anyfontsize}
\usepackage{ragged2e}
\newcommand{\capquelle}[1]{%
    \par\parbox{\captionwidth}{\raggedright\bigskip Quelle: #1}%
}
\usepackage{hvfloat}
\usepackage{footnote}
\usepackage[hang,multiple,bottom,stable]{footmisc} 
\setlength{\footnotesep}{2pt} 
\setlength{\footheight}{22cm} 
\setlength{\footnotemargin}{.8em} 
\interfootnotelinepenalty=9999 
\usepackage{nicefrac} 
\usepackage{multirow}
\usepackage{colortbl}
\usepackage{mdwlist}
\linespread{1.5}
\setlength{\parindent}{0mm}
\setlength{\parskip}{0.3em plus 0.5em minus 0.6em}
\input{app/skripte/weitereEbene}
\usepackage[printonlyused]{acronym}
\usepackage[intoc]{nomencl}
\renewcommand{\nomname}{Abkürzungsverzeichnis}
\setlength{\nomlabelwidth}{.50\textwidth}
\renewcommand{\nomlabel}[1]{#1 \dotfill}
\setlength{\nomitemsep}{-\parsep}
\makenomenclature
\fancypagestyle{plain}%
    \fancyhf{} 
    \fancyhead[C]{\thepage}
    \fancyfoot{}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt} 
\pagestyle{fancy} 
    \fancyhf{} 
    \fancyhead[C]{\thepage}
    \fancyfoot{}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
\begin{document}
    \renewcommand{\figurename}{Abbildung}           
    \pagenumbering{Roman}                           
\renewcommand{\refname}{Literaturverzeichnis}       
\newcolumntype{C}{>{\arraybackslash}X}              
\newpage
\restoregeometry 
\setcounter{page}{2} 
\tableofcontents
\newpage
\printnomenclature
\newpage
\listoffigures
\newpage
\pagenumbering{arabic}
\setcounter{page}{1}

\subsection{Aufbau}
Im zweiten Kapitel wird zunächst der Begriff \textit{Bring Your Own Device} (BYOD) definiert. Darauffolgend wird dargelegt welche Fokusse gesetzt werden sollen und Schlussfolgerungen gezogen, sowie eine Sicherheitsrichtlinie abgeleitet. Welche als Grundlage einer Gegenüberstellung mit etablierten Konzepten dient, sodass Strategien erörtert werden können. Darauffolgend wird in Kapitel Drei eine Diskussion der Vor- und Nachteile von \textit{Bring Your Own Device} aus unterschiedlichen Sichten.


\end{document}

Log (only warnings, because it's too long):

Class scrartcl Warning: Usage of package `fancyhdr' together
(scrartcl)              with a KOMA-Script class is not recommended.
(scrartcl)              I'd suggest to use 
(scrartcl)              package `scrlayer' or `scrlayer-scrpage', because
(scrartcl)              they support KOMA-Script classes.
(scrartcl)              With `fancyhdr' several features of class `scrartcl'
(scrartcl)              like options `headsepline', `footsepline' or command
(scrartcl)              `\MakeMarkcase' and the commands `\setkomafont' and
(scrartcl)              `\addtokomafont' for the page style elements need
(scrartcl)              explicite user intervention to work.
(scrartcl)              Nevertheless, using requested
(scrartcl)              package `fancyhdr' on input line 17.
----
Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language `German (new orthography)' into the format.

(babel)                Please, configure your TeX system to add them and
(babel)                rebuild the format. Now I will use the patterns
(babel)                preloaded for english instead on input line 47.

Package babel Info: \l@ngerman = using hyphenrules for english
(babel)             (\language0) on input line 48.
Package babel Info: Making " an active character on input line 121.
)))
(/usr/share/texlive/texmf-dist/tex/generic/babel/locale/de/babel-ngerman.tex
(/usr/share/texlive/texmf-dist/tex/generic/babel/locale/de/babel-german.tex
Package babel Info: Importing basic data for ngerman
(babel)             from babel-de.ini. Reported on input line 11.
))
(/usr/share/texlive/texmf-dist/tex/latex/csquotes/csquotes.sty
Package: csquotes 2019-12-06 v5.2j context-sensitive quotations (JAW)

(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2019/09/21 v2.5h e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count178
)
\csq@reset=\count179
\csq@gtype=\count180
\csq@glevel=\count181
\csq@qlevel=\count182
\csq@maxlvl=\count183
\csq@tshold=\count184
\csq@ltx@everypar=\toks25

Docker font install:

RUN && microdnf -y update \
    && microdnf -y install \
            texlive-scheme-basic \
...
        curl \
        cabextract \
        xorg-x11-font-utils \
        fontconfig \
        && rpm -i 'https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm' 

Best Answer

Like David Carlisle suggested a simple missing package was the reason. instead of using texlive-scheme-full I digged deeper and found, package texlive-hyphen-german was needed, if you choose using texlive-scheme-basic. With this package installed hyphenation works fine.

Related Question