latex3 / babel

The multilingual framework to localize LaTeX, LuaLaTeX and XeLaTeX
https://latex3.github.io/babel/
LaTeX Project Public License v1.3c
130 stars 35 forks source link

\babel@texpdf inconsistently defined #130

Closed wehro closed 3 years ago

wehro commented 3 years ago

The new \babel@texpdf command is defined as:

\def\babel@texpdf#1#2#3#4{%
  \ifx\texorpdfstring\@undefined
    \textormath{#1}{#2}%
  \else
    \texorpdfstring{\textormath{#1}{#3}}{#2}%
    % \texorpdfstring{\textormath{#1}{#3}}{\textormath{#2}{#4}}%
  \fi}

If \texorpdfstring is undefined, the second argument is used as math code, if the command is defined, the third argument is the math code, which is obviously inconsistent.

jbezos commented 3 years ago

Must be \textormath{#1}{#3}, indeed.