biblatex icon indicating copy to clipboard operation
biblatex copied to clipboard

biblatex tries to patch no longer existing ifthenelse commands

Open u-fischer opened this issue 2 years ago • 5 comments

As we just discovered biblatex error with the LaTeX in our develop branch: after a change in ifthen.sty it no longer could patch \ifthenelse. (We fixed that but it shows the general problems of such patches: they rely on internals that you can't really control. biblatex should perhaps consider not to use \ifthenelse (it is slow anyway ...).)

While looking at this I saw that the patch mentions also \HyOrg@ifthenelse and \NROrg@ifthenelse. Both commands have been removed some time ago from hyperref and nameref so they can be remove from biblatex too.

u-fischer avatar Mar 23 '24 16:03 u-fischer

Ah. I can look into not using \ifthenelse, but I we can't really control what contributed styles do. Many will have copied standard code that uses \ifthenelse and probably won't move away from it. I'm a bit worried about the patch though. Surely it was there for a reason. Can we get the same result via a more official interface?

moewew avatar Mar 23 '24 16:03 moewew

Can we get the same result via a more official interface?

I looked into that, and wondered if we can add \TE@hook directly, but the problem is that xifthen (which introduced this hook) defines it with \newcommand and so would error if ifthen would define it too.

The easiest for you would be if xifthen adapts its code and appends to \TE@hook if that is already defined. Then biblatex wouldn't have to change anything and ifthen could simply add the hook too.

u-fischer avatar Mar 23 '24 16:03 u-fischer

Hmm. xifthen looks a bit unmaintained, though, judging by https://github.com/JosselinNoirel/xifthen/issues, so I'm not sure how realistic that is...

moewew avatar Mar 23 '24 16:03 moewew

I've moved all standard styles away from \ifthenelse constructs in https://github.com/plk/biblatex/compare/dev...moewew:biblatex:patches.

But this does not actually solve the underlying issue. We have to continue to patch \ifthenelse because we cannot afford to break all third-party styles and existing code using \ifthenelse. So where do we go from here?

moewew avatar Apr 04 '24 16:04 moewew