# AucTex region preview produces a document with ~10× more pages than the region preview should be. Cached preamble issue?

I define the following \locallabels{} command to localize labels and references to a certain part of my document

\makeatletter \AtBeginDocument{%
\let\origlabel@in@display\label@in@display
\let\origref\ref \let\origpageref\pageref \let\origlabel\label
\newcommand\locallabels[1]{%
\renewcommand\label[1]{\origlabel{#1##1}}%
\renewcommand\ref[1]{\origref{#1##1}}%
\renewcommand\pageref[1]{\origpageref{#1##1}}%
\renewcommand\label@in@display[1]{\origlabel@in@display{#1##1}}%
}} \makeatother


See this thread for a MWE.

However, when I define the following command based on my custom \locallabels,

\newcommand{\refalien}[3]{\locallabels{#1}\ref{#2}\locallabels{#3}}


which I use to reference labels outside a particular locallabels region of my document, why does AucTex region preview, in my non-MWE document, output a DVI that has about 10× more pages with barely any characters on each page? Does this have to do with a preamble-caching issue?

thanks

-
I think a MWE is in order, since I'm not sure what you mean by "interfere"... –  Werner Oct 3 '13 at 22:07