plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
518 stars 118 forks source link

biblatex tries to patch no longer existing ifthenelse commands #1348

Open u-fischer opened 7 months ago

u-fischer commented 7 months ago

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.

moewew commented 7 months ago

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?

u-fischer commented 7 months ago

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.

moewew commented 7 months ago

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 commented 7 months ago

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 commented 5 months ago

@u-fischer Do you have any guidance as to what we should do here to move forward. As I said above, we can move away from \ifthenelse and https://github.com/plk/biblatex/compare/dev...moewew:biblatex:patches does so, but that does not mean we can stop patching \ifthenelse, because third-party styles can still use \ifthenelse (and will realistically still do so for a very long time), so we still need to support biblatex commands there, which we do by patching \ifthenelse. As always, I'm happy to use a more official hook or a different route, but I don't think we can say "just don't use \ifthenesle" at the moment.