# "Patch failed" in EMNLP Style Template

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.

• 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 patch can not find box Apr 24 '19 at 21:45
• @DavidCarlisle I am not allowed to modify the .sty file (according to conference rules), hence my question whether it is also possible to fix this problem without changing the file. Apr 26 '19 at 12:40
• The conference rules were not expecting latex to change and break their style file, the style simply will not work with current latex so change your copy it will work the same way on anew latex as the unchanged class 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 class. Apr 26 '19 at 13:32
• I got the same problem when I compile the paper with the ACL2020 style file on my MacBook and Windows 10. latex template link. To solve it, I delete '\errmessage{\noexpand patch failed}' in the last braces — no error message in both computers and overleaf. Nov 23 '19 at 3:33

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.

• Note that this still holds for EMNLP 2020 Mar 12 '20 at 0:37
• @drevicko could you report it to them? if they change \errmessage to \wlog it will just log that the patch failed in new releases, but still do the patch in old releases and will work the same way in either case. Jun 10 '20 at 7:52
• done Jun 18 '20 at 0:09

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
%%e.agirre@ehu.es or Sergi.Balari@uab.es
%% 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 ...

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 ...

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.

• the latex format has % \changes{v1.4d}{2018/11/28}{Unbox \cs{@outputbox} to preserve boxing so in recent formats that patch will fail as it has already been applied essentially. Apr 24 '19 at 20:45
• Your guess is correct: overleaf uses 2017/03/14 v6.85a whereas the version on my computer is 2018/11/30 v6.88e. After removing the patch, everything works fine. Apr 26 '19 at 12:37
• \@combinedblfloats (and the change that makes the patch fail) are not in the files listed by \listfiles it is a change in the latex format. Jun 10 '20 at 8:03