在我的文本中从 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}