[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#23102: Wrong usage of underscore in .tex files
From: |
Tassilo Horn |
Subject: |
bug#23102: Wrong usage of underscore in .tex files |
Date: |
Mon, 28 Mar 2016 11:46:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) |
Angelo Graziosi <angelo.graziosi@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
Description: math, \url, and \href in GNU AUCTeX
Bye,
Tassilo