[OS X TeX] hyperref and apacite

Ross Moore ross at ics.mq.edu.au
Sun Apr 6 16:02:33 EDT 2008

Hello Salvatore,

On 07/04/2008, at 12:10 AM, Salvatore Enrico Indiogine wrote:
> Hi Ross!
> On 05/04/2008, Ross Moore <ross at ics.mq.edu.au> wrote:
>>  If you are having this problem, doubtless others will face it too,
>>  so having the correct fix will be quite useful.
>>  Please produce a minimal example, cut-down to include just 1 or 2
>>  citations and very little text, that still exhibits the error.

It works perfectly when you use:


Note that extra 'hyper' option.

Looking through  apacite.sty  you'll find coding:

%%%%%% Hyperref compatibility option %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (This does not work completely satisfactory, so
% is only a non-default option.)
\newif\if at hyper@APA at comp
  \@hyper at APA@comptrue % hyperref compatibility option is on
%%%%%% End Hyperref compatibility option %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

and further down, the coding that does the work:

%%                   COMPATIBILITY WITH HYPERREF                       
% Include experimental hyperref-compatibility code provided by Ross  
% if the hyper option is requested.
\if at hyper@APA at comp% hyperref compatibility option is on

It seems that I've worked on this problem before!

>>  Send it directly to me, if you like. I'll try to find some time  
>> to do
>>  detailed tracing, and determine exactly what is going wrong and why.
>>  Then devise a good fix.

In tracing your example, I did discover another problem though:

At line  1266  in the expansion of  \@@cite<#1>
there is an improperly coded test:

       {\ignorespaces #1\@BAP}%

This should really be:

       {\ignorespaces #1\@BAP}%

since otherwise when #1 is empty (as in your example)
the comparison is between tokens  \@empty  and  \else .

In fact the required result is achieved, but for the
wrong reason!

> I have reduced the bib and tex files to the minimum.  The error is
> still reproducible and occurs the same way using TeXShop,
> Aquamacs+AucTeX, or even command line.
> 1. run latex -> pdf created with correct references and hyperlinks,
> however citation is ()
> 2. run bibtex -> no error
> 3. run latex -> should still compile
> 4. run latex -> fails with always same error message.  Also the
> auxiliary files are now zero size.
> Hope it helps.
> Enrico
> -- 
> Enrico Indiogine
> Mathematics Education
> Texas A&M University
> hindiogine at gmail.com

Hope this helps,


Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114

More information about the MacOSX-TeX mailing list