考虑两个 LaTeX 文件。
第一个(test1.tex):
\documentclass[12pt]{article}
% extra packages
\usepackage[margin=0.5in]{geometry}
\usepackage{expex}
\usepackage{polyglossia}
\usepackage{setspace}
% dimensions
\newlength{\defparindent}
\setlength{\defparindent}{\parindent}
\setlength{\parindent}{0pt}
% custom ling styles
\definelingstyle{Text}{aboveexskip=0pt,belowexskip=0pt,
belowglpreambleskip=0pt,aboveglftskip=0pt,glwordalign=center,
glftpos=right,glhangstyle=none,ssratio=.60,
everygla=\arabicfont\Large,everyglb=\englishfont\normalsize,
everyglft=\englishfont\normalsize}
% font
\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}
\newfontfamily\englishfont{Linux Libertine Display O}
\pagestyle{empty}
\setmainlanguage{english}
\setotherlanguage{arabic}
\begin{document}
\onehalfspacing
\exdisplay[lingstyle=Text]
\begin{Arabic}
\begingl
\gla
عائِلَةُ مازِن نَجّار
//
\glb
\textenglish{nuclear family} Mazen Najjar
//
\glft
\textenglish{Mazen Najjar's Family}
//
\endgl
\end{Arabic}
\end{document}
第二个(test2.tex):
\documentclass[12pt]{article}
% extra packages
\usepackage[margin=0.5in]{geometry}
\usepackage{expex}
\usepackage{polyglossia}
\usepackage{setspace}
% dimensions
\newlength{\defparindent}
\setlength{\defparindent}{\parindent}
\setlength{\parindent}{0pt}
% custom ling styles
\definelingstyle{Text}{aboveexskip=0pt,belowexskip=0pt,
belowglpreambleskip=0pt,aboveglftskip=0pt,glwordalign=center,
glftpos=right,glhangstyle=none,ssratio=.60,
everygla=\arabicfont\Large,everyglb=\englishfont\normalsize,
everyglft=\englishfont\normalsize}
% font
\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}
\newfontfamily\englishfont{Linux Libertine Display O}
\pagestyle{empty}
\setmainlanguage{english}
\setotherlanguage{arabic}
\begin{document}
\onehalfspacing
\exdisplay[lingstyle=Text]
\begin{Arabic}
\begingl
\gla
عائِلَةُ مازِن نَجّار
//
\glb
\textenglish{nuclear family} Mazen Najjar
//
\glft
\begin{english}
Mazen Najjar's Family
\end{english}
//
\endgl
\end{Arabic}
\end{document}
使用 GNU diff 查看差异:
$ diff -u test1.tex test2.tex
--- test1.tex 2017-03-11 23:55:32.914015840 -0600
+++ test2.tex 2017-03-11 23:55:37.630039225 -0600
@@ -41,7 +41,9 @@
\textenglish{nuclear family} Mazen Najjar
//
\glft
-\textenglish{Mazen Najjar's Family}
+\begin{english}
+Mazen Najjar's Family
+\end{english}
//
\endgl
\end{Arabic}
两个文件的输出不同。为什么?
答案1
为了在 test1.tex 中得到你想要的东西,只需添加\raggedleft
到 下的自定义 lingstyle即可everyglft
。
% custom ling styles
\definelingstyle{Text}{aboveexskip=0pt,belowexskip=0pt,
belowglpreambleskip=0pt,aboveglftskip=0pt,glwordalign=center,
glftpos=right,glhangstyle=none,ssratio=.60,
everygla=\arabicfont\Large,everyglb=\englishfont\normalsize,
everyglft=\englishfont\normalsize\raggedleft}