[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Problem with RefTeX

From: Ralf Angeli
Subject: Re: [AUCTeX] Problem with RefTeX
Date: Thu, 18 Jun 2009 21:11:32 +0200

* Guy Durrieu (2009-06-16) writes:

> I wrote the following latex sequence (using the caption package):
> ---
> \begin{figure}[!ht]

Why do you use a figure environment if you don't want the content to

> \begin{center}
>    \begin{minipage}{0.5\textwidth}
>      \begin{center}
>        \includegraphics[scale=0.15]{and-3}
>      \end{center}
>      \captionof{figure}{Porte \textbf{\textit{and}} à trois entrées.}
>      \label{fig:3}
>    \end{minipage}\hfill
>    \begin{minipage}{0.5\textwidth}
>      \centering
>      \begin{tabular}{|c|c|c|c|c|}
>      \end{tabular}
>      \captionof{table}{Tests minimums pour une porte and à trois entrées.}
>      \label{tab:5}
>    \end{minipage}
> \end{center}
> \end{figure}
> ---
> because I needed two columns, with a figure (and a figure caption) on 
> the left and a table (with a table caption) on the right.
> That works (see capture), but RefTeX seems to get problems with that. 
> When I ask for a reference to a figure, I get
> ---
>  >               fig:3
> .                 NO MATCH FOR CONTEXT REGEXP
>  >               tab:5
> .                 NO MATCH FOR CONTEXT REGEXP
> ---

AFAICS RefTeX assumes that both labels belong to a figure environment
and tries to determine the context by searching for a \caption macro.
Since there is only a \captionof which RefTeX is not aware of, no
context information is found and displayed.

> and when I ask for a table reference, I get nothing for tab:5.

RefTeX determines the type of a label by looking at the environment or
macro the label is contained in.  In your case the nearest environment
RefTeX is aware of is the figure environment and therefore the label is
associated with that.  Since the labels in your case are both in
minipage environments you might have to write a custom parser as
described in (info "(reftex)Non-Standard Environments") if you want them
to show up in a different category.  You'd use the custom parser in a
new `reftex-label-alist' entry which would also allow you to specify a
method for determining the label context which is aware of \captionof.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]