GNU bug report logs - #41841
26.3; reftex and tikz's labels

Previous Next

Package: emacs;

Reported by: phs <at> lsv.fr

Date: Sat, 13 Jun 2020 21:27:02 UTC

Severity: normal

Found in version 26.3

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 41841-done <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: phs <phs <at> lsv.fr>
Cc: 41841-done <at> debbugs.gnu.org
Subject: Re: bug#41841: 26.3; reftex and tikz's labels
Date: Sun, 14 Jun 2020 22:17:10 +0200
phs <phs <at> lsv.fr> writes:

> It seems reftex mistakes labels in tikz nodes with genuine \label 's
> in LaTeX source.
>
> To reproduce:
>
> 1) open a buffer foo.tex in LaTeX mode
>
> 2) insert (via cut&paste) the following text
>
> \begin{figure}
> \begin{tikzpicture}
> \node at (0,0) [label={node 0}] % not a LaTeX label
> \end{tikzpicture}
> \caption{Figure that!}
> \label{myfigure} % only genuine label
> \end{figure}

Does adding "tikzpicture" to
reftex-label-ignored-macros-and-environments work?

--8<---------------cut here---------------start------------->8---
reftex-label-ignored-macros-and-environments is a variable defined in ‘reftex-vars.el’.
Its value is nil

  You can customize this variable.
  This variable was introduced, or its default value was changed, in
  version 24.4 of Emacs.

Documentation:
List of macros and environments to be ignored when searching for labels.
The purpose is to ignore environments and macros that use keyval
style label=foo arguments, but the label has a different meaning
than a \label{foo}.  Standard \label{...} definitions are never
ignored.

E.g., TikZ defines several macros/environments where [label=foo]
defines the label to be printed at some node or edge, but it’s
not a label used for referencing.

Note that this feature is only supported if you are using AUCTeX
and the functions ‘TeX-current-macro’ and
‘LaTeX-current-environment’ are bound.  Also note that this
feature might slow down the reftex parsing process for large TeX
files.
--8<---------------cut here---------------end--------------->8---

In what's going to become Emacs 27.1, we are a bit more conservative and
have a whitelist of environments in which we look for label=foo options.
There, the bug doesn't happen anymore, so I'm closing this bug.

Thanks,
Tassilo




This bug report was last modified 4 years and 343 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.