I need to use the ACL latex style, and I would like to use the hyperref package, but it changes the way bibliography items look like in the pdf. Minimal Working Example is the following:
- download the ACL style files http://acl2012.org/call/sub01.asp
- see the bib item styles in the pdf:
Alfred V. Aho and Jeffrey D. Ullman. 1972. The Theory of Parsing, Translation and Compiling, volume 1. Prentice-Hall, Englewood Cliffs, NJ.
- add line
\usepackage{hyperref}
in the preamble - compile, and see how reference syle changed:
[Aho and Ullman1972] Alfred V. Aho and Jeffrey D. Ullman. 1972. The Theory of Parsing, Translation and Compiling, volume 1. Prentice-Hall, Englewood Cliffs, NJ.
I did not find any option for the hyperref
package to prevent this change, any idea is welcome
Thanks,
Max
Best Answer
The problem is that
acl2012.sty
redefines the internal command\@lbibitem
in a way thathyperref
is not aware of one. As a result, whenhyperref
is used, what gets printed is the key of the citation.One work around is as follows. The
hyperref
redefinition uses a command\@BIBLABEL
which is by standard set to the default\@biblabel
via a\providecommand*
. This is convenient, since\providecommand*
will only make the definition provide the command is not already defined. Thus what we can do is define\@BIBLABEL
beforehyperref
is loaded, to produce an empty text. This is achieved by:i.e. we set
\@BIBLABEL
to a command\@emptybiblabel
, which in turn just ignores its argument. This code is enclosed between\makeatletter / \makeatother
because of the symbol@
in the command names.Putting this together in a cut-down version of the
acl2012.tex
sample document gives:In the
pdf
the links from the citations still lead to the corresponding citations.