3

i have the problem that the Hyphenation ist nor working correctly when i have loaded the Font Times New Roman.

I'm using LuaLaTex and here you can see my MWE:

\documentclass[%
a4paper,
12pt,
DIV=calc,
oneside,
parskip=half                
]
{scrreprt}

\usepackage[a4paper, left=3cm, right=2.5cm, top=2.5cm, bottom=2.5cm, includefoot]{geometry}

\usepackage{fontspec}
\usepackage{polyglossia}

\setdefaultlanguage{german}
\setmainfont{Times New Roman}

\begin{document}
Ligatures: fi fl ffl
whitespace Keynesian dwarfish calflike wolffish rufflike rooftop  \\ \\
Für die Autorisierung und Zugriffsverwaltung innerhalb und gegenüber dem X.500-Verzeichnisdienst wurden X.509-Zertifikate definiert, deren Zertifikatssyntax als \textit{Abstract Syntax Notation One} (ASN.1) bezeichnet wird.  Detailliertere Informationen zu ASN.1 sind zu entnehmen.
\end{document}

I tried also adding \hyphenation{X.500=Ver-zeich-nis-dienst} before \begin{document} but has no effect.

When i run the example without the command \setmainfont{Times New Roman} or use instead Times New Roman the Font Trebuchet MS, it is working fine.

So could this be a problem with the Times New Roman Font? Or where is the problem?

  • yes the word that did not hyphen correctly is X.500-Verzeichnisdienst. I tried to put inside \hypenationcommand but did not work. – Opa114 Mar 31 '16 at 19:30
  • 1
    By the way (and off-topic): do not use \\ \\ to create 'blank' space in your document. (I realize that you may be doing so just for this example.) – jon Mar 31 '16 at 19:44
  • \hyphenation{Ver-zeich-nis-dienst} did not work. and yes the `\`is only in this example - i don't use this either. – Opa114 Mar 31 '16 at 21:34
4

LaTeX normally doesn't hyphenate a "word" which has a hyphen in other places. Use the babelshorthand "= to allow hyphenation in the rest of the word. Regarding the font: Different fonts means different line breaking.

\documentclass[%
a4paper,
12pt,
DIV=calc,
oneside,
parskip=half
]
{scrreprt}

\usepackage[a4paper, left=3cm, right=2.5cm, top=2.5cm, bottom=2.5cm, includefoot]{geometry}

\usepackage{fontspec}
\usepackage[babelshorthands]{polyglossia}

\setdefaultlanguage{german}
\setmainfont{Times New Roman}

\begin{document}
Ligatures: fi fl ffl
whitespace Keynesian dwarfish calflike wolffish rufflike rooftop  \\ \\
Für die Autorisierung und Zugriffsverwaltung innerhalb und gegenüber dem X.500"=Verzeichnisdienst wurden X.509-Zertifikate definiert, deren Zertifikatssyntax als \textit{Abstract Syntax Notation One} (ASN.1) bezeichnet wird.  Detailliertere Informationen zu ASN.1 sind zu entnehmen.
\end{document}

enter image description here

|improve this answer|||||
3

It's not a problem with Times or any other font.

LuaTeX introduces new hyphenation features, but it doesn't change the fact that a character with zero \lccode ends the search for a word to hyphenate.

Thus \hyphenation{X.500=Ver-zeich-nis-dienst} does nothing at all, because .500 all have zero \lccode.

\documentclass[%
  a4paper,
  12pt,
  DIV=calc,
  oneside,
  parskip=half                
]
{scrreprt}

\usepackage[a4paper, left=3cm, right=2.5cm, top=2.5cm, bottom=2.5cm, includefoot]{geometry}

\usepackage{fontspec}
\usepackage{polyglossia}

\setdefaultlanguage{german}
\setmainfont{Times New Roman}

\begin{document}

\lccode`.=`. \lccode`5=5 \lccode`0=`0
\hyphenation{X.500=Ver-zeich-nis-dienst}

Ligatures: fi fl ffl

whitespace Keynesian dwarfish calflike wolffish rufflike rooftop

Für die Autorisierung und Zugriffsverwaltung innerhalb und gegenüber 
dem X.500-Verzeichnisdienst wurden X.509-Zertifikate definiert, deren 
Zertifikatssyntax als \textit{Abstract Syntax Notation One} (ASN.1) 
bezeichnet wird.  Detailliertere Informationen zu ASN.1 sind zu entnehmen.

\end{document}

enter image description here

|improve this answer|||||
  • but another problem: how can i hyphen this word: \textit{PolicyInformation}-Objekten in the sentence Die Erweiterung besteht aus einer Sequenz von einer oder mehreren \textit{PolicyInformation}-Objekten. It did not break the word because the first part is inside the \textit command. – Opa114 Mar 31 '16 at 21:51
  • 1
    @Opa114 For this you need the "= method. But how many times do you have such a beast? Just add \- where you need. – egreg Mar 31 '16 at 21:59
  • ok. not often yes, so maybe the best solution will be to use \- – Opa114 Mar 31 '16 at 22:02
  • Could you please link to documentation of these "new hyphenation features" LuaLaTeX introduces? – lblb Oct 8 '17 at 20:11
  • 1
    @lblb The LuaTeX manual, section 4.3 – egreg Oct 8 '17 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.