setotherlanguage{arabic} 使得 inline-tikz 不能被排版为内联

setotherlanguage{arabic} 使得 inline-tikz 不能被排版为内联
\documentclass{article}

\usepackage{fontspec}
\usepackage{tikz}
\usepackage{polyglossia}

\setmainlanguage{french}
\setotherlanguage{arabic} % comment that line, the problem disappears.

\setmainfont[Ligatures=TeX,
             Numbers=OldStyle]{Linux Libertine O}

\newfontfamily\arabicfont[Scale=MatchLowercase,
                          Script=Arabic]{Scheherazade}

\begin{document}
before tikz insertion  \tikz[baseline=-0.5ex]\draw(0,0)circle(1ex); afteeeeeeeeeeeeer
\end{document}

我认为这与阿拉伯语特别相关,我也使用希腊语和中文,这并不影响tikz

那个家伙

答案1

可能隐藏使用数学模式会强制一些方向节点进行干预。您可以保护里面的代码\mbox

\documentclass{article}

\usepackage{fontspec}
\usepackage{tikz}
\usepackage{polyglossia}

\setmainlanguage{french}
\setotherlanguage{arabic} % comment that line, the problem disappears.

\setmainfont[Ligatures=TeX,
             Numbers=OldStyle]{Linux Libertine O}

\newfontfamily\arabicfont[Scale=MatchLowercase,
                          Script=Arabic]{Scheherazade}

\begin{document}
before tikz insertion  \mbox{\tikz[baseline=-0.5ex]{\draw(0,0)circle(1ex);}} afteeeeeeeeeeeeer
\end{document}

相关内容