Hi! Yesterday I played a bit with emacs' muse mode which has option to 'publish' to ConTeXt, but its output was wailing when texeexec-ing due to use of \textunderscore (option in muse). Today I discussed the issue on muse mailing list, got help and the following remark: '...Context gurus don't seem to imagine you can use "_" elsewhere than in math mode btw'. I looked at ConTeXt docs (excursion and manual), as well as wiki on contextgarden, but was not able to find more about what is the status of underscore '_' char in ConTeXt and is the above remark true? My usage of '_' in muse document was for preparing tables of some library functions and, as it is often the case in software, there is usually some prefix for all library functions as eg. gtk_xxxxx for GTK+ toolkit. Sincerely, Gour
On Sat, 12 Jan 2008, Gour wrote:
Yesterday I played a bit with emacs' muse mode which has option to 'publish' to ConTeXt, but its output was wailing when texeexec-ing due to use of \textunderscore (option in muse).
Why does \textunderscore wail? \textunderscore should work fine.
Today I discussed the issue on muse mailing list, got help and the following remark: '...Context gurus don't seem to imagine you can use "_" elsewhere than in math mode btw'.
:) This is how it is done in plain TeX, and both LaTeX and ConTeXt follow this. If you do not use maths at all, you can say \catcode`\_ = 11 on the top of your file and then _ will be a letter in both text and math mode (which basically means that you will have to use \sb to get subscript in math mode. It is possible to define something along the lines of underscore.sty in latex, so that _ is treated as a letter in text mode, and as a subscript indicator in math mode, but, read below.
I looked at ConTeXt docs (excursion and manual), as well as wiki on contextgarden, but was not able to find more about what is the status of underscore '_' char in ConTeXt and is the above remark true?
My usage of '_' in muse document was for preparing tables of some library functions and, as it is often the case in software, there is usually some prefix for all library functions as eg. gtk_xxxxx for GTK+ toolkit.
Shouldn't such function names be written as \type{gtk_xxxx} when muse converts the document to ConTeXt? In that case the _ will be preserved. Aditya
On Sat, 12 Jan 2008 12:59:39 -0500 (EST)
Aditya Mahajan
Why does \textunderscore wail? \textunderscore should work fine.
See https://mail.gna.org/public/muse-el-discuss/2008-01/msg00001.html thread.
:) This is how it is done in plain TeX, and both LaTeX and ConTeXt follow this. If you do not use maths at all, you can say
\catcode`\_ = 11
on the top of your file and then _ will be a letter in both text and math mode (which basically means that you will have to use \sb to get subscript in math mode.
Hmm, not ideal...
It is possible to define something along the lines of underscore.sty in latex, so that _ is treated as a letter in text mode, and as a subscript indicator in math mode, but, read below.
I do not remember having ever problem with underscore in LaTeX.
Shouldn't such function names be written as \type{gtk_xxxx} when muse converts the document to ConTeXt? In that case the _ will be preserved.
Right. They will fix default in muse and use \type{_} as value for underscore. Thank you for your input. Sincerely, Gour
On Sat, 12 Jan 2008, Gour wrote:
On Sat, 12 Jan 2008 12:59:39 -0500 (EST) Aditya Mahajan
wrote: Why does \textunderscore wail? \textunderscore should work fine.
See https://mail.gna.org/public/muse-el-discuss/2008-01/msg00001.html thread.
This is just a mistake of the parser. Either _ should be translated to "\textunderscore "(\textunderscore followed by a space) or more precisely by \textunderscore{} or \_ .
I do not remember having ever problem with underscore in LaTeX.
Read the documentation of underscore.sty and you will know the trouble of using underscore in LaTeX (some of those are true for ConTeXt also).
Shouldn't such function names be written as \type{gtk_xxxx} when muse converts the document to ConTeXt? In that case the _ will be preserved.
Right. They will fix default in muse and use \type{_} as value for underscore.
No, the default should either be \_ or \letterunderscore{} (with the brackets). \type{_} will be influenced by \setuptype (or \setuptyping) and can give colored output also. Aditya
Aditya Mahajan wrote:
:) This is how it is done in plain TeX, and both LaTeX and ConTeXt follow this. If you do not use maths at all, you can say
\catcode`\_ = 11
or ... \nonknuthmode (there's also \donkunthmode -) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, 13 Jan 2008, Hans Hagen wrote:
Aditya Mahajan wrote:
:) This is how it is done in plain TeX, and both LaTeX and ConTeXt follow this. If you do not use maths at all, you can say
\catcode`\_ = 11
or ...
\nonknuthmode
(there's also \donkunthmode -)
Hey, somehow never noticed this one before. Aditya
Le 13 janvier à 23:47:12 Hans Hagen
| > :) This is how it is done in plain TeX, and both LaTeX and ConTeXt follow | > this. If you do not use maths at all, you can say | > | > \catcode`\_ = 11
| or ...
| \nonknuthmode
| (there's also \donkunthmode -)
[...] As far as I can see, \nonknuthmode_ or \nonknuthmode{_} produces a wider "_" than \textunderscore{} does. -- Jean
participants (4)
-
Aditya Mahajan
-
Gour
-
Hans Hagen
-
Jean Magnan de Bornier