I am using tikz-qtree to draw syntax trees that go inside of gb4e examples.
I was very happy that I was able to get them to center by following this answer: Centering trees
However, I then decided that I wanted to use some Arabic text in my paper, so I loaded Arabic as the other language via polyglossia. Suddenly, none of my trees were centered. I'm guessing that the problem has something to do with loading bidi, which polyglossia does when you add a right-to-left language, but I'm not sure how to get around it.
Here is a MWE:
\documentclass{article}
\usepackage{tikz-qtree}
\usepackage{polyglossia}
\setmainlanguage{english}
% Uncomment the following line to see the problem behavior:
%\setotherlanguage{arabic}
\usepackage{gb4e}
\begin{document}
Here is an example tree that I want to be centered.
\begin{exe}
\ex
\hfil
\begin{tikzpicture}[baseline]
\Tree [.DP
[.D the ]
[.NP [.N center ] ] ]
\end{tikzpicture}
\hfil
\end{exe}
\end{document}


bidipackage (which is loaded bypolyglossiaif you select an RTL language like Arabic or Hebrew) is for use with XeLaTeX only, not LuaLaTeX, and so if your document requires Arabic, you should not use LuaLaTeX. And your sample document works fine with XeLaTeX for me. – Alan Munn Feb 20 '17 at 16:21tikzpicture? – Jason Zentz Feb 20 '17 at 17:01% !TEX encoding = UTF-8 Unicodeto the top of the file, does that change the behavior? – Jason Zentz Feb 20 '17 at 17:03polyglossia– Aidan Kaplan Feb 21 '17 at 01:56polyglossia, but notbidiso not for RTL scripts. Can you put\listfilesbefore\documentclassand post the list of files you get on the console/in the log? I can only think you have an old version of something or a stale confg file. – cfr Feb 21 '17 at 02:09gb4e'sexeenvironment or not. – Jason Zentz Feb 23 '17 at 17:37