0

@UlrikeFischer

The following MWE demonstrates awkward behaviour of LuaLaTeX bidi=basic with Tikz:

MWE 1 - Normal behaviour

\documentclass[tikz,margin=5cm]{standalone}
\usepackage{tikz}
%:Language
\usepackage[nil]{babel}
\babelprovide[import,main]{hebrew}
\babelprovide[import=en]{english}
\begin{document}
\begin{tikzpicture}[]
\node[
draw=red,
minimum size=1cm,
]
(a) at(0,0){A};
\node[
draw=red,
minimum size=1cm,
anchor=south east,
]
at (a.north west) {B};
\end{tikzpicture}
\end{document}

Which produces the following:

MWE1

When I add to babel options bidi=basic I get this:

MWE 2 - Awkward behaviour

\documentclass[tikz,margin=5cm]{standalone}
\usepackage{tikz}
%:Language
\usepackage[nil, bidi=basic]{babel}
\babelprovide[import,main]{hebrew}
\babelprovide[import=en]{english}
\begin{document}
\begin{tikzpicture}[]
\node[
draw=red,
minimum size=1cm,
]
(a) at(0,0){A};
\node[
draw=red,
minimum size=1cm,
anchor=south east,
]
at (a.north west) {B};
\end{tikzpicture}
\end{document}

MWE2

2
  • 2
    I would switch back to english at the begin of the tikzpicture, graphics and bidi are quite often problematic. Try with \AddToHook{env/tikzpicture/begin}{\selectlanguage{english} } (assuming a new latex. Mar 11 at 19:37
  • @Morzen Added to the bug tracker: github.com/latex3/babel/issues/121 . Graphics with bidi are complicated because mixing RTL with elements intrinsically LTR, combined in unpredictable ways, is far from trivial. Mar 12 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.