[Top][All Lists]

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

Re: \hyperref macro seems to confuse paren matching

From: Arash Esbati
Subject: Re: \hyperref macro seems to confuse paren matching
Date: Tue, 07 Jun 2022 09:43:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi Jean-Fran├žois,

jfbu <> writes:

> I reduced too much my example keeping the misfortune I wanted to show
> but forgetting about \hyperref syntax
> Here is a more complete close to minimal example
> ----
> \documentclass{article}
> \usepackage{hyperref}
> {\hyperref[sec]{{foo}{bar}}}%
> \begin{document}
> \end{document}
> ----

Thanks for raising this issue.  This is how your example above looks for
me (which I slightly changed) with 'emacs -Q':

PNG image

Note the fontification of '{{foo}' which is `font-latex-verbatim-face'
and due to this line in hyperref.el:

  (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperref")

This means that the content in the first mandatory argument is
considered verbatim and the '{' directly before 'foo' is ignored as a
brace (in terms of \begingroup) and from there things go in the wrong
direction.  It is unfortunate that \hyperref can be used like this:




AUCTeX currently caters for the former syntax and ignores the latter.
Maybe we should change this?  I think the latter will be more common.

What do others think?

Best, Arash

reply via email to

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