如何刪除連字符後的分音符

如何刪除連字符後的分音符

引用維基百科:

在荷蘭語中,諸如 coëfficiënt 之類的拼寫是必要的,因為二合字母 oe 和 ie 通常分別代表簡單元音 [u] 和 [i]。然而,現在複合詞首選連字符,因此 zeeëend(海鴨)現在拼寫為 zee-eend。

因為分音符用於指示兩個字母不應被讀作二合字母,所以當以其他方式指示時(例如換行符處的連字符),應將其刪除。仍有連字符消除分音符的情況:「financiën」應連字符為'fi-nan-ci-en'

不幸的是,當使用

\usepackage{polyglossia}
\setdefaultlanguage{dutch}

該單字被連字符為“financi-ën”(當連字符出現在換行符處時)。是否有可能使 XeLaTeX/Polyglossia 在連字發生時消除分音符?

Polyglossia 手冊中特定於語言的選項並未提供此問題的解決方案。 Babel 手冊提到了\@trema宏,事實上,當使用 pdfLaTeX 和 Babel 時,financi"en在換行符處正確連字符(刪除分音符)。我確實找到了這個醜陋的駭客,但我相信應該有更好的解決方案。

答案1

如果全部「ë」就是這個意思,那麼一個可能的解決方法是重新定義ëto的意思"e

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[dutch]{babel}
\usepackage{newunicodechar}

\makeatletter
\newunicodechar{ë}{\@trema e}
\makeatother

\begin{document}

financiën coëfficiënt zeeëend    

\parbox{0pt}{\hspace{0pt}financiën coëfficiënt zeeëend}

\end{document}

\parbox{0pt}{...}是告訴 TeX 盡可能使用連字符的技巧。

在此輸入影像描述

有了 XeLaTeX,你babel以相同的方式使用,只需刪除對fontenc和 的呼叫inputenc

如果你想使用polyglossia,那麼這裡有一個方法:

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{dutch}
\usepackage{newunicodechar}

\makeatletter
\providecommand{\allowhyphens}{%
  \ifvmode\else\nobreak\hskip\z@skip\fi
}
\def\@trema#1{\allowhyphens\discretionary{-}{#1}{\"{#1}}\allowhyphens}

\newunicodechar{ë}{\@trema e}
\makeatother

\begin{document}

financiën coëfficiënt zeeëend

\parbox{0pt}{\hspace{0pt}financiën coëfficiënt zeeëend}

\end{document}

相關內容