2

Does anyone understand why hyphenation seems not to work as expected with Arno Pro set as main font? If you try the code with Garamond Premr Pro everything works as expected.

Thank you in advance for any tips!

\documentclass[%
  fontsize       = 11pt,% Schriftgröße
  paper          = a4,% Papierformat
  DIV            = 10,%
  BCOR           = 5mm,%
  pagesize       = luatex,%
]{scrreprt}

\usepackage[final]{microtype}
\usepackage{luaotfload}
\usepackage{fontspec}


\usepackage[babelshorthands = true,luatexrenderer=Harfbuzz]{polyglossia}% Sprachumschaltung
% Setup
\setmainlanguage[%
 spelling            = new,%
 latesthyphen    = true
]{german}


\newcommand{\sethyphenation}[2]{%
  \begin{otherlanguage*}{#1}\hyphenation{#2}\end{otherlanguage*}%
}

\setmainfont{Arno Pro}
%\setmainfont{Garamond Premr Pro}%[%


\sethyphenation{german}{Kom-man-di-tist-en-ver-samm-lung Ge-sell-schaf-ter-ver-samm-lung}
 \begin{document}

 \parbox{0pt}{Kommanditistenversammlung}  \vspace*{3cm}

 \parbox{0pt}{Gesellschafterversammlung}

 \end{document}
3
  • Thank you @DavidCarlisle, unfortunately I am using LuaLaTeX, i.e. that didn't solve the issue. Oct 22, 2021 at 10:00
  • 1
    actually I have deleted my comment luatex is obvious as you load luaotfload:-) (although there is no need to do that lualatex loads luaotfload already in the format even if you don't use fontspec) Oct 22, 2021 at 10:03
  • @DavidCarlisle thanks for the information. I will stop loading luaotfload from now on. :) Oct 22, 2021 at 10:07

1 Answer 1

3

(too long for a comment, hence posted as an answer)

The following, simplified version of your code experiences no hyphenation issues. Maybe some of the document class options or some of the packages you load are causing some interference.

enter image description here

% !TEX TS-program = lualatex
\documentclass[fontsize=11pt]{scrreprt}
\usepackage{fontspec}
\setmainfont{Arno Pro}

\usepackage{polyglossia}
\setmainlanguage{german}
\newcommand{\sethyphenation}[2]{%
  \begin{otherlanguage*}{#1}\hyphenation{#2}\end{otherlanguage*}}
\sethyphenation{german}{ Kom-man-di-tist-en-ver-samm-lung 
                         Ge-sell-schaf-ter-ver-samm-lung  }


%%% Instead of 'polyglossia', consider using 'babel':
\usepackage[ngerman]{babel}
\babelhyphenation{ kom-man-di-tist-en-ver-samm-lung 
                   ge-sell-schaf-ter-ver-samm-lung  }


\setlength\parindent{0pt}
\setlength\textwidth{1sp}

\begin{document}
Kommanditistenversammlung

\medskip
Gesellschafterversammlung
\end{document}
15
  • Thank you! It seems that loading ArnoPro as main font after polyglossia is causing the issue. However, it is weired to me that I get different results from different fonts loaded. Oct 22, 2021 at 11:05
  • 1
    @Roadrunner85 - Your comment raises a separate question: Why are you using the polyglossia package? Do give \usepackage[ngerman]{babel} and, if needed, \addto\extrasngerman{\hyphenation{kom-man-di-tist-en-ver-samm-lung ge-sell-schaf-ter-ver-samm-lung}} a try.
    – Mico
    Oct 22, 2021 at 11:07
  • 1
    @Mico Or better with \babelhyphenation. I wonder if in this particular case \babelpatterns is even better. Oct 22, 2021 at 12:07
  • @Mico honestly I have no specific reason for polyglossia. It was habit from the time when I worked with XeLaTeX. I am considering your suggestion to switch over to babel. Thank you. Just for your information: The MWE works as expected with babel instead of polyglossia. That should lead as to the conclusion that polyglossia has some kind of bug here, correct? Oct 22, 2021 at 13:24
  • @Mico you are loading the font before polyglossia and so use the node renderer. After it would use harfbuzz. (I don't have the font and can't try myself). Oct 22, 2021 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .