![比迪语多语脚注的两个问题](https://linux22.com/image/323335/%E6%AF%94%E8%BF%AA%E8%AF%AD%E5%A4%9A%E8%AF%AD%E8%84%9A%E6%B3%A8%E7%9A%84%E4%B8%A4%E4%B8%AA%E9%97%AE%E9%A2%98.png)
mainlanguage
这个 MWE 显示了我在使用多语种(阿拉伯语、otherlanguage
英语)脚注时遇到的两个问题。
请注意脚注中的标点符号在数字旁边的位置是如何反转的;还请注意字体大小是基于阿拉伯字体大小,而不是脚注所在的英语字体环境。我认为第一个问题(标点符号)一定是个错误。第二个问题可能是故意的,但我不知道。
输出是这样的。
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic, Scale = 3]{Times New Roman}
\newfontfamily\englishfont[Script=Latin]{Times New Roman}
\begin{document}
\begin{english}
This is a sentence with a footnote. \LTRfootnote{\textenglish{English 1; 2, 3:
This has the correct font size and the correct punctuation}}
This is a second sentence with a footnote. \LTRfootnote{English 1; 2, 3:
The punctuation has been mixed and the font size is based on the scaled-up Arabic 3 size}
\end{english}
\end{document}
答案1
这个问题可以用以下最小的例子来说明:
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\arabicfont[Script=Arabic]{Times New Roman}
\newfontfamily\englishfont[Script=Latin]{Times New Roman}
\begin{document}
\englishfont
English 1; 2, 3:
The punctuation has been mixed and the font size is based on the scaled-up Arabic 3 size
\bigskip
\arabicfont
English 1; 2, 3:
The punctuation has been mixed and the font size is based on the scaled-up Arabic 3 size
\end{document}
当字体包含 时Script=Arabic
,XeTeX 引擎会执行一些 unicode bidi。在引擎层面,这不是一个错误,而是一个功能。
该bidi
软件包仅提供\LTRfootnote
命令,并未设置任何字体,因此无法为设置正确字体是 polyglossia 的缺陷\LTRfootnote
。我不知道 poly 中的字体设置是如何工作的……但您可以这样做:
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic, Scale = 3]{Times New Roman}
\newfontfamily\englishfont[Script=Latin]{Times New Roman}
\makeatletter
\renewcommand\@makefntext[1]{%
\parindent 1em%
\noindent
\hb@[email protected]{\hss\@makefnmark}\englishfont#1}
\makeatother
\begin{document}
\begin{english}
This is a sentence with a footnote. \LTRfootnote{\textenglish{English 1; 2, 3:
This has the correct font size and the correct punctuation}}
This is a second sentence with a footnote. \LTRfootnote{English 1; 2, 3:
The punctuation has been mixed and the font size is based on the scaled-up Arabic 3 size}
\end{english}
\end{document}
请注意,这不是一个完美的解决方案。