8

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 – David Carlisle Apr 24 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. – vauge Apr 26 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. – David Carlisle Apr 26 at 13:32
8

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.

2

Because I do not have am overleaf account please do the following test:

Add the line \listfiles as 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 overleave 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 an bug in an older version of hyperref (which one is not named, that would be realy 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 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 not 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. – David Carlisle Apr 24 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. – vauge Apr 26 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.