latex3 / babel

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

Incorrect link box in end of line if it is preceded by a non-Arabic character #207

Closed seloumi closed 1 year ago

seloumi commented 1 year ago

This example shows the problem

\documentclass{article}
\usepackage{hyperref}
\usepackage[bidi=basic]{babel}
\babelprovide[import, main]{arabic}
\babelfont{rm}{Amiri}

\begin{document}

\begin{figure}
\centering
\rule{4cm}{4cm}
\caption{test}
\label{im}
\end{figure}

A
\ref{im}   % Wrong 

تجريب A
\ref{im}   % Wrong

تجريب
\ref{im}   % Fine

A
\ref{im} . % Wrong

A
\ref{im} B % Fine

\end{document}

image

jbezos commented 1 year ago

I’m reopening the issue because the current fix is somewhat simplistic and only works with some typical cases.