bug-auctex
[Top][All Lists]
Advanced

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

bug#19589: 11.88; the `$' in environment variables triggers math mode sy


From: Arash Esbati
Subject: bug#19589: 11.88; the `$' in environment variables triggers math mode syntax highlighting
Date: Sun, 03 Mar 2024 15:36:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

"Blake C. Rawlings" <brawling@andrew.cmu.edu> writes:

> When I use environment variables (such as $HOME) in a .tex file, the $
> triggers math mode syntax highlighting.  The result is that the rest
> of the buffer, until the next $, is highlighted as if it were in math
> mode.  Some examples:
>
> \includegraphics{$HOME/path/to/graphic}
>
> \bibliography{$HOME/path/to/bib1,$HOME/path/to/bib2}
>
>
> I currently use the following hack to get around this behavior:
>
> \bibliography{%
>   $HOME/path/to/bib1,%$
>   $HOME/path/to/bib2,%$
> }
>
> where the second $ on each line "closes" the math mode for
> syntax-highlighting purposes, so at least the rest of the buffer is not
> affected.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.  And my apologies if you get this message twice.)

I don't think this is a bug.  AUCTeX doesn't handle the arguments of
\includgraphics or \bibliography as verbatim text, in contrast to
\verb|$HOME/path/to/graphic|.  So AUCTeX provides the %$ trick at the
end of line as a solution for your use case.

Therefore I'm closing this report.

Best, Arash





reply via email to

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