* bug#23102: Wrong usage of underscore in .tex files
@ 2016-03-23 23:30 Angelo Graziosi
2016-03-27 0:40 ` John Wiegley
2022-01-24 11:39 ` Lars Ingebrigtsen
0 siblings, 2 replies; 8+ messages in thread
From: Angelo Graziosi @ 2016-03-23 23:30 UTC (permalink / raw)
To: 23102
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
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}
here the underscore is not used to display a subscript as in $A_n$ so
the result, in my opinion, is wrong. At first sight, it is also almost
unreadable...
Angelo
[-- Attachment #2: emacs_wrong.png --]
[-- Type: image/png, Size: 5130 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#23102: Wrong usage of underscore in .tex files
2016-03-23 23:30 bug#23102: Wrong usage of underscore in .tex files Angelo Graziosi
@ 2016-03-27 0:40 ` John Wiegley
2016-03-27 19:53 ` Angelo Graziosi
2022-01-24 11:39 ` Lars Ingebrigtsen
1 sibling, 1 reply; 8+ messages in thread
From: John Wiegley @ 2016-03-27 0:40 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: 23102
>>>>> Angelo Graziosi <angelo.graziosi@alice.it> writes:
> 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?
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#23102: Wrong usage of underscore in .tex files
2016-03-27 0:40 ` John Wiegley
@ 2016-03-27 19:53 ` Angelo Graziosi
2016-03-28 9:46 ` Tassilo Horn
2016-03-29 6:52 ` John Wiegley
0 siblings, 2 replies; 8+ messages in thread
From: Angelo Graziosi @ 2016-03-27 19:53 UTC (permalink / raw)
To: John Wiegley; +Cc: 23102
[-- Attachment #1: Type: text/plain, Size: 834 bytes --]
Il 27/03/2016 01:40, John Wiegley ha scritto:
>>>>>> Angelo Graziosi <angelo.graziosi@alice.it> writes:
>
>> 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?
>
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.
I tried with Atom Editor and its language-latex package, and the above
example (BLA_BLA...) is displayed as expected from me. See attachment.
Anyway, if you think it is OK to use \_, you can close this bug report.
Angelo
[-- Attachment #2: atom_latex.png --]
[-- Type: image/png, Size: 6875 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#23102: Wrong usage of underscore in .tex files
2016-03-27 19:53 ` Angelo Graziosi
@ 2016-03-28 9:46 ` Tassilo Horn
2016-03-29 8:44 ` Angelo Graziosi
2016-03-29 6:52 ` John Wiegley
1 sibling, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2016-03-28 9:46 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: John Wiegley, 23102
[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]
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.
[-- Attachment #2: math, \url, and \href in GNU AUCTeX --]
[-- Type: image/png, Size: 6284 bytes --]
[-- Attachment #3: Type: text/plain, Size: 14 bytes --]
Bye,
Tassilo
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#23102: Wrong usage of underscore in .tex files
2016-03-27 19:53 ` Angelo Graziosi
2016-03-28 9:46 ` Tassilo Horn
@ 2016-03-29 6:52 ` John Wiegley
2016-03-29 8:42 ` Angelo Graziosi
1 sibling, 1 reply; 8+ messages in thread
From: John Wiegley @ 2016-03-29 6:52 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: 23102
>>>>> Angelo Graziosi <angelo.graziosi@alice.it> writes:
> I found no example suggesting to use \_ in \href{}{} or \url{} commands.
I guess those commands are special, which means latex-mode aught to treat them
as special as well, so I'll leave this open.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#23102: Wrong usage of underscore in .tex files
2016-03-23 23:30 bug#23102: Wrong usage of underscore in .tex files Angelo Graziosi
2016-03-27 0:40 ` John Wiegley
@ 2022-01-24 11:39 ` Lars Ingebrigtsen
1 sibling, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-24 11:39 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: 23102
Angelo Graziosi <angelo.graziosi@alice.it> writes:
> 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}
>
> here the underscore is not used to display a subscript as in $A_n$ so
> the result, in my opinion, is wrong. At first sight, it is also almost
> unreadable...
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
I've now fixed this in Emacs 29, but it's a kind of gross hack.
tex-mode doesn't seem to have that much infrastructure for handling
stuff like this, but I may be missing something.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-01-24 11:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-23 23:30 bug#23102: Wrong usage of underscore in .tex files Angelo Graziosi
2016-03-27 0:40 ` John Wiegley
2016-03-27 19:53 ` Angelo Graziosi
2016-03-28 9:46 ` Tassilo Horn
2016-03-29 8:44 ` Angelo Graziosi
2016-03-29 6:52 ` John Wiegley
2016-03-29 8:42 ` Angelo Graziosi
2022-01-24 11:39 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.