Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Patching 'ifthen' package failed #846

Closed
merkste opened this issue Dec 14, 2018 · 15 comments
Closed

Error: Patching 'ifthen' package failed #846

merkste opened this issue Dec 14, 2018 · 15 comments
Labels
external caused by non-biblatex component

Comments

@merkste
Copy link

merkste commented Dec 14, 2018

Hi,
since a couple of days I get the following error when compiling a document:

./main.tex:25: Package biblatex Error: Patching 'ifthen' package failed

I was not able to figure out the reason yet, but I suspect a recent TeXLive update introduces an incompatibility. Is this issue already known?

@moewew
Copy link
Collaborator

moewew commented Dec 14, 2018

Oh dear, that does not sound good. I'm using MikTeX so I'm a little bit behind with updates and have for example not yet received the new Dec. 2018 LaTeX format and I'm not seeing any warnings. Can you reproduce this issue with any document or do you have to do something specific? In the latter case could you be so kind to show us a short example document that reproduces the warning please? It would help greatly if you could also upload the complete .log file of the example LaTeX run.

@merkste
Copy link
Author

merkste commented Dec 14, 2018

It turns out, that pdfx is to blame:

\documentclass[11pt]{letter}

%%% PDF/A
\RequirePackage[a-1b]{pdfx}

\usepackage{biblatex}

\begin{document}
Lorem Ipsum
\end{document}

Reverting to pdfx to 1.5.84 fixes the problem.

@moewew
Copy link
Collaborator

moewew commented Dec 14, 2018

Ah thank you, that helps a lot. I'll try to find out what changed in pdfx 1.6 (https://tug.org/pipermail/tex-live-commits/2018-December/008057.html)

@merkste
Copy link
Author

merkste commented Dec 14, 2018

... and I just contacted the authors of pdfx. =)

@moewew
Copy link
Collaborator

moewew commented Dec 14, 2018

I have no idea what is going on here, but it does not seem to be a biblatex issue.

Take the following MWE

\documentclass{article}

\usepackage[a-1b]{pdfx}
\usepackage{ifthen}
\show\ifthenelse
\begin{document}
Lorem Ipsum
\end{document}

With pdfx 1.5.84 the \show command gives > ifthenelse=\long macro: and then the lengthy definition of the macro. But with 1.6 I just get > \ifthenelse=undefined. even though I have just loaded ifthen.

@moewew
Copy link
Collaborator

moewew commented Dec 14, 2018

As a temporary workaround you can try to load the package ifthen before pdfx. That made the error go away for me, but I'm not sure if everything will work as expected.

\documentclass[11pt]{letter}

\usepackage{ifthen}
\usepackage[a-1b]{pdfx}
\usepackage{biblatex}

\begin{document}
Lorem Ipsum
\end{document}

Likewise it helped to load biblatex before pdfx, but I'm not sure about the recommended loading order here. On a quick look at the pdfx documentation I could not find anything about recommended loading order. The fact that pdfx loads hyperref makes me think it should be late, but I'm not sure about the workings of the rest of the package.

Please let us know when you hear back from the pdfx developers.

@u-fischer
Copy link

pdfx loads xmpincl (which then loads ifthen) inside a group:

\begingroup
%% override the \ifpdf  check of  xmpincl  package
\ifxetex
 \pdftrue
\else\ifluatex
 \pdftrue
\fi\fi
\RequirePackage{xmpincl}
....

This is naturally completly wrong ...

@moewew
Copy link
Collaborator

moewew commented Dec 15, 2018

@u-fischer Thank you very much for digging into this. I guess it would be good to contact Ross Moore (is he the maintainer now?) about this. Have you already done this? Otherwise I'll send off a quick mail pointing him to this thread.

@merkste
Copy link
Author

merkste commented Dec 15, 2018

I've already contacted him and will point him to this thread. Thank you all for your investigation. I'd never found this myself.

@moewew
Copy link
Collaborator

moewew commented Dec 15, 2018

For now one of the workarounds that stay closest to the requirement to load pdfx as early as possible is probably

\documentclass[11pt]{letter}

\usepackage{ifthen}
\usepackage[a-1b]{pdfx}

\usepackage{biblatex}

\begin{document}
Lorem Ipsum
\end{document}

that way we only load one small-ish package before pdfx (and one that pdfx would load anyway - by proxy) and everything else can remain as is.

Question on TeX.SX: https://tex.stackexchange.com/q/465977/35864

@merkste OK, thanks for taking care of that.

@moewew moewew added the external caused by non-biblatex component label Dec 16, 2018
@TheTeXnician
Copy link

TheTeXnician commented Dec 25, 2018

Version 1.6.1 (2018/12/22) is on CTAN and does contain the following change log entry: "Fixed issue with ifthen package", so this issue can be closed.

@moewew
Copy link
Collaborator

moewew commented Dec 25, 2018

Thanks for the heads up. According to https://tug.org/pipermail/tex-live-commits/2018-December/008211.html the new code is

%%----------------------------------------------------------------------
%%  2018-12-16:   xmpincl  needs the  ifthen  package
%%  it should be loaded outside the grouping, else  biblatex  may barf
%%
\RequirePackage{ifthen}
\begingroup
%% override the \ifpdf  check of  xmpincl  package, inside the grouping
 \pdftrue
 \RequirePackage{xmpincl}

and still loads xmpincl inside a group (which I find problematic), but our woes are alleviated by loading ifthen explicitly outside that group.

I haven't tested v1.6.1 yet, because it hasn't arrived in MikTeX yet, but I trust this should solve this issue.

@u-fischer
Copy link

One really wonder about this \begingroup stuff - breaking other packages like this isn't right. xmpincl is so short that it should easy to extract the needed code for xetex and so avoid to use such tricks. But beside this the update seems to solve the problem for biblatex.

@moewew
Copy link
Collaborator

moewew commented Dec 31, 2018

pdfx v1.6.1 made it to MikTeX this morning. That means that the fixed version is now in both big TeX distributions. The MWEs from above all compile fine now.

Thanks to everyone involved for your help. Have a good 2019. 🎆

@moewew moewew closed this as completed Dec 31, 2018
@merkste
Copy link
Author

merkste commented Apr 26, 2019

@moewew thanks for all your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external caused by non-biblatex component
Projects
None yet
Development

No branches or pull requests

4 participants