在 xepersian 加載時設定拉丁文本不帶 \lr

在 xepersian 加載時設定拉丁文本不帶 \lr

我的大學論文模板有問題,該模板採用波斯語並xepersian使用波斯字體加載包B Nazanin,問題出在B Nazanin字體上。如模板前言所示,我們有:

\settextfont{B Nazanin}
\setlatintextfont{Times New Roman}

並且B Nazanin不支援拉丁字元。我在環境之外的拉丁字符\lr變成正方形,如下所示:

在此輸入影像描述

\lr{}我寫了 4 章論文,每個拉丁文部分都很難使用。有沒有辦法更輕鬆地解決這個問題?

答案1

使用程式fribidiXeTeX。如果您在 Windows 上,您可以使用編譯後的版本由角斗彰著。否則,請自行從原始碼編譯。

如果test.tex包含

\documentclass{article}
\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont{Yas}
\let\fribidixetexLRE\lr
\let\fribidixetexRLE\rl
\let\fribidixetexlatinnumbers\lr
\let\fribidixetexnonlatinnumbers\rl
%BIDION
\begin{document}    
این یک پاراگراف «پارسی» است به نام Simple text و این یک عدد 0887 به لاتین است.
%BIDIOFF
\begin{equation}
1+2=3\label{eq:1}
\end{equation}
%BIDION
این فرمول شماره
\ref{eq:1}
است.
%BIDILTR
\begin{latin}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
\end{latin}
%BIDION
و ادامه متن که بعد از متن Lorem Imsum قرار می‌گیرد.
\end{document}
%BIDIOFF

透過跑步

fribidixetex -n test.tex -o test.ltx

您將獲得一個文件test.ltx,其中所有拉丁短文本都會自動放置在\lr.然後你需要運行

xelatex test.ltx

產生 pdf 輸出。

相關內容