latex3 / babel

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

LuaLaTeX + babel + hyperref: extraneous = #302

Open GMS103 opened 2 weeks ago

GMS103 commented 2 weeks ago

The following

\documentclass[french]{article}

\usepackage{babel}

\usepackage{hyperref}

\begin{document}

\section{A section{\NoAutoSpacing:} Blah}

Blah blah.

\end{document}

when compiled with LuaLaTeX gives

Screenshot 2024-06-13 at 23 18 03

(With XeLaTeX it works as expected.)

u-fischer commented 2 weeks ago

That is something babel-french would have to correct. They could e.g. do something like this

\documentclass[french]{article}

\usepackage{babel}
\providecommand\texorpdfstring[2]{#1}
\makeatletter
\DeclareRobustCommand*{\NoAutoSpacing}{%
  \texorpdfstring{\FB@spacing@off
  \ifFB@active@punct\shorthandoff{;:!?}\fi}{}%
}
\makeatother
\usepackage{hyperref}

\begin{document}

\section{A section{\NoAutoSpacing:} Blah}

Blah blah.

\end{document}
GMS103 commented 2 weeks ago

Thanks, Ulrike, I have sent a message to Daniel Flipo.

dflipo commented 2 weeks ago

Thanks Ulrike, I will include your patch asap, not before end of June as I am currently on holidays far away from home :-)