我在 Beamer 中使用 Nicematrix 和 Polyglossia 时,遇到了一种奇怪的交互,特别是与命令 \Block 结合使用时。如果命令 \setotherlanguages{arabic} 被注释掉,则显示的代码在 XeLaTeX 中可以完美编译,但是当注释被删除并重新编译代码(超过三次)时,我们得到的结果就是图中显示的内容。
\documentclass[11pt,dvipsnames,svgnames,x11names,xcolor=table]{beamer}
\mode<presentation>
\usepackage{amsmath}
\usepackage{amssymb,gensymb,siunitx,units}
\usepackage{amsthm}
\usepackage{mathrsfs}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{unicode-math}
\setmathfont{XITSMath-Regular.otf}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary {intersections,arrows.meta,positioning,shapes.geometric}
\usetikzlibrary {decorations.pathmorphing,trees,backgrounds,patterns}
\usetikzlibrary{plotmarks}
\usepackage{multicol}
\usepackage{nicematrix}
\usepackage{booktabs,multirow}
\usepackage{calc}
\usepackage{fmtcount}
\usepackage{float,wrapfig}
\usepackage{rotating}
\usepackage{graphicx}
\graphicspath{{../ImgLinEng/}}
\usepackage{caption}
\usepackage{natbib}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguages{arabic}
\setmainfont{Bodoni 72}[
SmallCapsFont={Caslon Book BE},
]
\setsansfont{Noto Sans}
\setmonofont[Scale=MatchLowercase]{American Typewriter}
\newfontfamily\ipafont{Doulos SIL}
\newfontfamily\arabicfont[Script=Arabic]{Noto Naskh Arabic}
\pgfplotsset{compat=newest}
\begin{document}
\begin{frame}
\frametitle{Mean values for $F_{1}$ and $F_{2}$ of Central Catalan vowels}
\centering
\begin{NiceTabular}{lrr}
\CodeBefore \rowcolor{gray!9}{1-2}
\Body
\toprule
\Block[c]{1-3}{Central Catalan}\\
\Block[c]{1-1}{Vowel} & \Block[c]{1-1}{$F_{1}$} & \Block[c]{1-1}{$F_{2}$}\\\midrule
{\ipafont [i]} & \SI{334}{\hertz} & \SI{2078}{\hertz}\\
{\ipafont [u]} & \SI{394}{\hertz} & \SI{960}{\hertz}\\
{\ipafont [o]} & \SI{489}{\hertz} & \SI{1047}{\hertz}\\
{\ipafont [ɔ]} & \SI{608}{\hertz} & \SI{1125}{\hertz}\\
{\ipafont [a]} & \SI{730}{\hertz} & \SI{1358}{\hertz}\\
{\ipafont [ɛ]} & \SI{581}{\hertz} & \SI{1700}{\hertz}\\
{\ipafont [e]} & \SI{450}{\hertz} & \SI{1839}{\hertz}\\
\bottomrule
\end{NiceTabular}
\end{frame}
\end{document}