"Blake C. Rawlings" <brawl...@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



_______________________________________________
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to