有谁知道为什么将 Arno Pro 设置为主要字体时,连字似乎无法按预期工作?如果您使用 Garamond Premr Pro 尝试代码,一切都会按预期工作。
提前感谢您的任何提示!
\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}
答案1
(评论太长,因此作为答案发布)
以下简化版本的代码没有出现连字符问题。可能是某些文档类选项或您加载的某些包造成了一些干扰。
% !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}