TransWikia.com

"Patch failed" in EMNLP Style Template

TeX - LaTeX Asked by vauge on April 3, 2021

I was trying to use the LaTeX files for the EMNLP 2019 conference (download link can be found here), but when I try to compile the provided example .tex file, it doesn’t work and I get the following error for file emnlp-ijcnlp-2019.sty:

Line 455: patch failed ...x}{}{errmessage{noexpand patch failed}}

Interestingly, the Overleaf template using the identical .sty file works just fine, so I assume this is not an issue in the .sty file, but rather an issue with my local environment.

In case this is relevant, I am using pdflatex on Windows 10.

What may cause this error message to appear, and how can I fix it? Is it possible to fix this problem without changing the .sty file?


What I have tried so far:

I’ve looked up the corresponding line (and the two lines above), which read:

% DK/IV: Workaround for annoying hyperref pagewrap bug 
RequirePackage{etoolbox}
patchcmd@combinedblfloats{box@outputbox}{unvbox@outputbox}{}{errmessage{noexpand patch failed}}

A quick search revealed this comment from which the lines above seem to be taken.

I have the etoolbox package installed and I’ve also tried the following MWE instead of the example .tex file, which gives the same error:

documentclass[11pt,a4paper]{article}
usepackage[hyperref]{emnlp-ijcnlp-2019}

begin{document}
...
end{document}

Unfortunately, I cannot provide a MWE for the .sty file as I don’t really understand its contents.

2 Answers

In your local copy of the package, just delete the line

patchcmd@combinedblfloats{box@outputbox}{unvbox@outputbox}{}{errmessage{noexpand patch failed}}

and you will get the intended result, since 2018 latex releases the original source already has unvbox so patchcmd can not find the box to replace.

The LaTeX sources document the change as:

% changes{v1.4d}{2018/11/28}{Unbox cs{@outputbox} to preserve boxing

In comments you mention that you are not allowed to change the package, but that rule was written to ensure you do not change the document design by editing the .sty file.

The conference rules were not expecting latex to change and break their file. The code simply will not work with current latex so change your copy: it will work the same way on anew latex as the unchanged file with the patch will work on an old one.

So you can still submit your article they don't need to "know" that you changed the local copy of the package, although you could report it to them referencing this answer.

Correct answer by David Carlisle on April 3, 2021

Because I do not have an Overleaf account please do the following test:

Add the line listfiles as the first line to the file emnlp2019.tex:

%
% File emnlp2019.tex
%
%% Based on the style files for ACL 2019, which were
%% Based on the style files for EMNLP 2018, which were
%% Based on the style files for ACL 2018, which were
%% Based on the style files for ACL-2015, with some improvements
%%  taken from the NAACL-2016 style
%% Based on the style files for ACL-2014, which were, in turn,
%% based on ACL-2013, ACL-2012, ACL-2011, ACL-2010, ACL-IJCNLP-2009,
%% EACL-2009, IJCNLP-2008...
%% Based on the style files for EACL 2006 by 
%%[email protected] or [email protected]
%% and that of ACL 08 by Joakim Nivre and Noah Smith

listfiles % <====================================================
documentclass[11pt,a4paper]{article}
usepackage[hyperref]{emnlp-ijcnlp-2019}
usepackage{times}
usepackage{latexsym}
...

Now compile three times on Overleaf and check the resulting log file emnlp2019.log at the end for a list of used packages and versions. I'm very sure you will find an older version of hyperref listed ...

Please add this list to your question.

Then compile the same file emnlp2019.tex with the added listfile on your computer. Once again check the resulting log file and search for the used version of hyperref. I'm sure it is newer ...

Please add the resulting list of used packages and versions to your question too!

The reason for my guess is the following code in the used sty file:

% DK/IV: Workaround for annoying hyperref pagewrap bug 
RequirePackage{etoolbox}
patchcmd@combinedblfloats{box@outputbox}{unvbox@outputbox}{}{errmessage{noexpand patch failed}}

As you can see in the comment above the used patchcmd there was a bug in an older version of hyperref (which one is not named, that would be really helpful!). The used patch wants to correct is, but on your current computer system the patch failed, because

  • command @combinedblfloats can not be found or
  • command box@outputbox can not be found to be changed to unvbox@outputbox

For a quick test do the following:

  1. create a new directory.
  2. copy all files from the zip file in your given link into that directory.
  3. Add listfiles to the template Tex file emnlp2019.tex
  4. comment on the shown lines above in the file emnlp-ijcnlp-2019.sty and
  5. recompile the file emnlp2019.tex

Error gone? Okay, the patch seems to be no longer needed.

Error still there? Contact the maintainer of the zip file and report the bug you found.

Answered by Mensch on April 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP