Subject: Re: bug#58233: Latex style files shifts code with underscores

From: uzibalqa <[email-masked]>
Date: Sun, 02 Oct 2022 15:28:20 +0000

Sent with Proton Mail secure email.

------- Original Message -------
On Sunday, October 2nd, 2022 at 12:41 PM, Lars Ingebrigtsen <[email-masked]> wrote:

> uzibalqa [email-masked] writes:
> 
> > I am working on some latex style files and have noticed that code with underscores gets displayed
> > as subscript notation (characters get shifted downwards) rather than showing code as it should be.
> > 
> > Consequently, the following looks extremely weird.
> > 
> > \cs_new_protected:Nn \__hagbard_newtheorem_parent:nnn
> > {
> > \newtheorem{#1_inner}[#3]{\color{\l__hagbard_theorem_setcolor_tl}#2}
> > }
> > \cs_generate_variant:Nn \__hagbard_newtheorem_parent:nnn { VVV }
> 
> 
> I've managed to repress all knowledge of .sty files I once had.
> 
> Emacs currently uses latex-mode to display .sty files. In LaTeX,
> underscores aren't allowed in identifiers like this, are they?
> 
> So it seems like the solution here would be to default
> tex-fontify-script to nil in .sty files, which seems to fix this
> specific problem. But the fontification is still pretty weird:
> 
> 
> I.e., if this is valid .sty syntax, then latex-mode doesn't really have
> support for it at all, I think?

It is the latest L3 Programming Layer Interface for Latex.