[Tex/LaTex] Annoyance in emacs LaTeX mode involved with syntax highlighting

bibtexemacsenvironments

I'm using the following command in a LaTeX file to explicitly call a style file:

\bibliographystyle{$BSTINPUTS/IEEEtran}

Unfortunately emacs detects this as me entering math mode, but the latex interpreter doesn't complain because it understands the context.

This is more of an annoyance than anything since it turns my entire base tex file a single color defeating the purpose of color syntax highlighting.

Does anyone know a piece of elisp i could use to either alter latex mode or my .emacs file? Alternatively does anyone know of a way to "escape" the behavior of the $ symbol yet still get the interpreter to understand that this is an env variable?

Best Answer

According to www.gnu.org/software/auctex/manual/auctex/Known-problems.html, this “color bleed” can be remedied by inserting a commented dollar sign (%$) at the next suitable end of line.

Related Question