latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
125 stars 34 forks source link

bidi and tikz: stray punctuation lead to lua error #197

Closed u-fischer closed 1 year ago

u-fischer commented 1 year ago

As reported here https://tex.stackexchange.com/q/665471/2388, stray punctuation chars in a tikz picture lead to lua errors if bidi is used:

\documentclass{article}

\usepackage[bidi=basic]{babel}
\babelprovide[main,import]{hebrew}
\babelfont{rm}{FreeSans}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
; %or some other punctuation like . or !
\end{tikzpicture}
\end{document}

gives

warning  (hpack filter): error: ...e/2022/texmf-dist/tex/generic/babel/babel-bid
i-basic.lua:345: attempt to index a nil value (field '?')

.
\endpgfpicture ...globally \endgroup \hss \egroup 
                                                  \pgf@restore@layerlist@fro...
l.151 \end{tikzpicture}                     

A char like a works fine (and gives the expected Missing character: There is no a (U+0061) in font nullfont! message).