GNU bug report logs -
#23102
Wrong usage of underscore in .tex files
Previous Next
Full log
Message #14 received at 23102 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Angelo Graziosi <angelo.graziosi <at> alice.it> writes:
Hi Angelo and John,
>>> Attached is how Emacs displays the usage of underscore out of
>>> mathematics and friends, for example:
>>
>>> \href{http://www.foo.it/bla_bla.html}{BLA_BLA}
>>
>> I'm pretty sure that the underscore in BLA_BLA here is incorrect LaTeX.
>> Shouldn't it be BLA\_BLA, which does display correct in latex-mode?
Well, the plain underscore in BLA_BLA is indeed wrong but the plain
underscore in the URL *is* correct though escaping it with \ is also
permitted.
> Yes, it works but it is only a workaround in my opinion: treating an
> url string as in mathematics seems wrong to me.
>
> I found no example suggesting to use \_ in \href{}{} or \url{} commands.
Right, you don't need to use \_ in \url{} or \href's 1st argument.
Interestingly, stock `latex-mode' displays the argument of \url{} as
verbatim without subscripting the character after the _. It should do
the same with the first argument of \href.
> I tried with Atom Editor and its language-latex package, and the above example
> (BLA_BLA...) is displayed as expected from me. See attachment.
GNU AUCTeX does the same: _ has only subscript semantics in math mode.
[Screenshot from 2016-03-28 11-35-18.png (image/png, attachment)]
[Message part 3 (text/plain, inline)]
Bye,
Tassilo
This bug report was last modified 3 years and 123 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.