# The hyperref package breaks AUCTeX preview with two different journal style files

The following LaTeX MWE compiles, but AUCTeX preview does not work. This file tests for two different journal style files. One is Bayesian Analysis, the other is Oxford Bioinformatics (links are to the LaTeX files for each journal). To switch between them, comment/uncomment the relevant lines at the top of the file.

Removing the hyperref package fixes the problem.

This is on Debian wheezy with AUCTeX 11.87 and both emacs 23.4.1 and emacs 24.3.1. Someone else tried it on Gentoo with auctex 11.87.2 emacs 24.3.1 and he said preview worked OK.

To start with, can anyone reproduce this? If so, do you have any idea what the problem might be? The Debian AUCTeX package is upstream with a few harmless looking patches added. I guess I could try without the patches.

% Comment/uncomment to switch between Bayesian Analysis and Bioinformatics.
\def\ba{}
%\def\bio{}

\ifdefined\ba
\documentclass[bib]{ba}
\else\ifdefined\bio
\documentclass{bioinfo}
\fi\fi

\usepackage{hyperref}
\begin{document}

$x=1$

\end{document}

• I cannot reproduce with dev version of AUCTeX + Emacs 24.3.1 on Debian testing. Probably a bug report to the bug-auctex mailing list would be more helpful. – giordano Jun 17 '14 at 21:32
• @giordano I get the same result with the elpa auctex 11.87.5 for emacs 24. I've got to wonder if the problem is perhaps not with auctex. – Faheem Mitha Jun 17 '14 at 21:46
• Try compiling from the terminal using the command reported in the output buffer. What do you get? – giordano Jun 17 '14 at 21:57
• @giordano what is a minimal emacs file in enable auctex/preview? I tried with -q but auctex/preview would not work normally. – Faheem Mitha Jun 17 '14 at 22:01
• It depends on how you installed AUCTeX. The Debian package is loaded before your init file and emacs -q definitely works, but IIRC that should suffice also for ELPA packages. – giordano Jun 17 '14 at 22:03