和\hyphenchar\font=\textendash

和\hyphenchar\font=\textendash

我使用 EB Garamond 字体。唯一困扰我很久的问题是连字符,它有点倾斜。是否可以将 EB Garamond 的连字符替换为其他字体(例如 Latin Modern 或 Times)中的字符?我已经尝试过“\hyphenchar”,但还没有找到合适的解决方案。

\documentclass[12pt]{report}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ebgaramond}

\begin{document}

How can I use the hyphen character from another font? It should be used in justified type even if the words are automatically hyphenated at the end of the line.

\end{document}

答案1

虽然我不认为在字体之间交换单个字符是明智之举,但有一种可能性——使用另一个角色对于连字符相同字体

将连字符替换为短破折号:

\documentclass[12pt]{report}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ebgaramond}

\begin{document}
\hyphenchar\font=\textendash
How can I use the hyphen character from another font? It should be used in justified type even if the words are automatically hyphenated at the end of the line.

\end{document}

\hyphenchar\font=\textendash

文本结束

定期hyphens

连字符

相关内容