#624735 Displays \it with an italic '\'

#624735#3
Date:
2011-05-01 01:56:20 UTC
From:
To:
In auctex mode, \it displays as italic, including the backslash.  An
italic backslash ends up looking a lot like a pipe.  Please don't
italicize the backslash.

Thanks,
Josh Triplett

#624735#8
Date:
2011-05-01 19:43:51 UTC
From:
To:
forwared 624735 auctex-devel@gnu.org

Josh Triplett <josh@joshtriplett.org> wrote:

Is this still the case in recent auctex?

Regards, Frank

#624735#13
Date:
2011-05-01 20:13:31 UTC
From:
To:
* Frank Küster (2011-05-01) writes:

Yes.  But only if the \it is not preceded by an opening brace.

#624735#18
Date:
2011-05-01 22:47:18 UTC
From:
To:
I only run auctex from the Debian package, and this represents the
latest version in unstable.  A quick check upstream suggests that 11.86
represents the latest upstream release as well.  So, yes? :)

- Josh Triplett

#624735#23
Date:
2011-05-03 19:08:33 UTC
From:
To:
Ralf Angeli <angeli@caeruleus.net> wrote:

So you would actually call it a feature?

Regards, Frank

#624735#28
Date:
2011-05-09 19:40:39 UTC
From:
To:
* Frank Küster (2011-05-03) writes:

I'd say yes.  Fontifying the whole macro looks more consistent to me
than fontifying only the part after the backslash.

#624735#33
Date:
2011-05-09 20:02:14 UTC
From:
To:
Doing so makes the '\' look like a '|'.

- Josh Triplett

#624735#38
Date:
2011-05-09 20:15:45 UTC
From:
To:
* Josh Triplett (2011-05-09) writes:

I'm using DejaVu Sans Mono with a size of 17 pixels here and the two
characters can be distinguished easily.  Maybe the font you are using is
suboptimal?

Also, in which context or use case would it be a big problem if the
characters where not easily distinguishable?

#624735#43
Date:
2011-05-10 06:45:53 UTC
From:
To:
DejaVu Sans Mono here as well.  I can distinguish the characters, but I
wouldn't say "easily"; it takes staring at the unusual-looking italic
'\' more than once. :)

In my case, I encountered this problem when staring at a complex TeX
macro, which ran several commands in a row, along the lines of
\foo\it\bar\baz.  The italic '\' characters caused by the formatting of
\it caused me quite a bit of confusion when trying to decipher it, until
I figured out that they really did represent backslashes.  It took me
some time to parse the \it in the first place, since I didn't see the
characteristic '\'.

- Josh Triplett

#624735#48
Date:
2011-05-14 19:03:37 UTC
From:
To:
* Josh Triplett (2011-05-10) writes:

You'll have the same problem with something like \foo{\it\bar}.  And in
Emacs' standard LaTeX mode it will be the same even without the braces.

Anyway, the font locking in AUCTeX always fontifies the whole macro,
including the backslash.  I don't think it would be a good idea to break
this habit for one particular case.

In case this is really a huge problem for you, you can change the call
to `store-match-data' in `font-latex-match-command-in-braces' from

		(store-match-data (list (point) (point)
					(point) (point)
					cbeg cend))

to

		(store-match-data (list (point) (point)
					(point) (point)
					(1+ cbeg) cend))