![我改用多语系统来处理一些希伯来语文本,文本中的所有破折号都恢复为三个破折号](https://linux22.com/image/472242/%E6%88%91%E6%94%B9%E7%94%A8%E5%A4%9A%E8%AF%AD%E7%B3%BB%E7%BB%9F%E6%9D%A5%E5%A4%84%E7%90%86%E4%B8%80%E4%BA%9B%E5%B8%8C%E4%BC%AF%E6%9D%A5%E8%AF%AD%E6%96%87%E6%9C%AC%EF%BC%8C%E6%96%87%E6%9C%AC%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E7%A0%B4%E6%8A%98%E5%8F%B7%E9%83%BD%E6%81%A2%E5%A4%8D%E4%B8%BA%E4%B8%89%E4%B8%AA%E7%A0%B4%E6%8A%98%E5%8F%B7.png)
在我的文本中从 babel 切换到 plyglossia 似乎与 em 破折号(连续输入三个破折号)有关,现在被打印为三个破折号。
我认为多语能力的转变纯属偶然——是什么原因造成的呢?
\documentclass[12pt]{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily{\englishfont}{EB Garamond}
\newfontfamily{\hebrewfont}[Script=Hebrew]{Hadasim CLM}
\newfontfamily{\hebrewfontsf}[Script=Hebrew]{Miriam CLM}
\newfontfamily{\hebrewfonttt}[Script=Hebrew]{Miriam Mono CLM}
\title{Using Hebrew Fonts on Overleaf with polyglossia \\\texthebrew{דוגמא לגופני ברירת מחדל}}
\author{Foo}
\begin{document}
\maketitle
I don't know why it is doing this --- but I don't like it.
\end{document}
答案1
\newfontfamily
不加载\defaultfontfeatures
。
注意:我将希伯来字体更改为我拥有的字体。
\documentclass[12pt]{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily{\englishfont}{EB Garamond}[Ligatures=TeX]
\newfontfamily{\hebrewfont}{Raanana}[Script=Hebrew]
\newfontfamily{\hebrewfontsf}{Raanana}[Script=Hebrew]
\newfontfamily{\hebrewfonttt}{Raanana}[Script=Hebrew]
\title{Using Hebrew Fonts on Overleaf with polyglossia \\\texthebrew{דוגמא לגופני ברירת מחדל}}
\author{Foo}
\begin{document}
\maketitle
I don't know why it is doing this --- but I don't like it.
\end{document}
但使用起来要好得多\setmainfont
。
\documentclass[12pt]{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\setmainfont{EB Garamond}
\newfontfamily{\hebrewfont}{Raanana}[Script=Hebrew]
\newfontfamily{\hebrewfontsf}{Raanana}[Script=Hebrew]
\newfontfamily{\hebrewfonttt}{Raanana}[Script=Hebrew]
\title{Using Hebrew Fonts on Overleaf with polyglossia \\\texthebrew{דוגמא לגופני ברירת מחדל}}
\author{Foo}
\begin{document}
\maketitle
I don't know why it is doing this --- but I don't like it.
\end{document}
答案2
既然你提到了babel
,如果你决定坚持下去,以下是具体方法:
\documentclass[12pt]{article}
\usepackage[english, bidi=default]{babel}
\babelfont{rm}{EB Garamond}
\babelfont[hebrew]{rm}{Hadasim CLM}
\babelfont[hebrew]{sf}{Miriam CLM}
\babelfont[hebrew]{tt}{Miriam Mono CLM}
\title{Using Hebrew Fonts on Overleaf with Babel\\%
\foreignlanguage{hebrew}{דוגמא לגופני ברירת מחדל}}
\author{Foo}
\begin{document}
\maketitle
I don't know why it is doing this --- but I don't like it.
\end{document}