0

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' 
dhd80
  • 125
  • Make a small but complete example and show the log-file. – Ulrike Fischer Oct 10 '21 at 19:46
  • The preamble is incomplete as it is not shown what font you're selecting; in the image it's a kind of Times, I guess. It's impossible to help you if you don't show a way to reproduce your image. I tried and I can't. – egreg Oct 10 '21 at 20:04
  • 2
    You have used \usepackage[T1]{fontenc} but tagged the question {xetex} are you using xelatex? all hyphenation will be incorrect if you use T1 encoding with xelatex, delete the fontenc usage. – David Carlisle Oct 10 '21 at 20:14
  • Thanks for your interest. Unfortunately deleting \usepackage[T1]{fontenc} did not change hyphenations. I provided more Info above. – dhd80 Oct 10 '21 at 20:24
  • I tried to run the example but got ! LaTeX Error: File ``app/skripte/modsBiblatex2018.tex' not found. please provide an example that produces the bad hyphenation without error – David Carlisle Oct 10 '21 at 20:29
  • The original script has many dependencies, I already removed. I removed this one, too. – dhd80 Oct 10 '21 at 20:31
  • 2
    if I delete the bibliography lines that generate errors and not needed for this example i get this output which does not match what you show. – David Carlisle Oct 10 '21 at 20:31
  • Package babel Warning: No hyphenation patterns were preloaded for (babel) the language `German (new orthography)' into the format. means that somehow you have built a format that does not support German. you should be able to install texilve-full using your linux package manager – David Carlisle Oct 10 '21 at 20:35
  • Thanks, I installed texlive-scheme-basic and added the packages independently. I try to install the full package, it will take a moment. – dhd80 Oct 10 '21 at 20:43
  • What's wrong with hyphenating Gegenüberstellung as Gegenüber-stellung, as is done in the screenshot you posted? – Mico Oct 10 '21 at 21:00
  • 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" – dhd80 Oct 10 '21 at 21:06
  • 2
    unrelated but pdfsync is obsolete, synctex is now included directly. – Ulrike Fischer Oct 10 '21 at 21:09
  • @dhd80 - Please see the answer i just posted. As I show in the answer, babel has no problems finding all valid hyphenation points in both Gegenüberstellungand Sicherheitsmanagement, and it doesn't come up with any invalid hyphenation points. – Mico Oct 10 '21 at 21:16
  • Incidentally, why on earth are you loading the pdfsync package?? See this answer (shameless self-citation alert!) for an overview of what all can go wrong if one loads this wretched package. An excerpt from the package's user guide: "You should not use pdfsync on final documents because it can change the layout rather significantly (different page/line breaks are the most obvious changes)." I know of no redeeming feature of this package. In short, stop using this package. Now! – Mico Oct 10 '21 at 21:25
  • It worked! Thanks for your input. But I'm not sure it was DavidCarlisle or Mico's answer which fixed the issue. I will figure that out and post it. – dhd80 Oct 10 '21 at 21:35
  • @dhd80 - My money would be on David Carlisle's comments getting the job done... – Mico Oct 10 '21 at 22:05

1 Answers1

0

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.

dhd80
  • 125