ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* typesetting underscore
@ 2008-01-12 16:24 Gour
  2008-01-12 17:59 ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Gour @ 2008-01-12 16:24 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 825 bytes --]

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: typesetting underscore
  2008-01-12 16:24 typesetting underscore Gour
@ 2008-01-12 17:59 ` Aditya Mahajan
  2008-01-12 19:11   ` Gour
  2008-01-13 22:47   ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Aditya Mahajan @ 2008-01-12 17:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: typesetting underscore
  2008-01-12 17:59 ` Aditya Mahajan
@ 2008-01-12 19:11   ` Gour
  2008-01-12 22:07     ` Aditya Mahajan
  2008-01-13 22:47   ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Gour @ 2008-01-12 19:11 UTC (permalink / raw)
  To: ntg-context

On Sat, 12 Jan 2008 12:59:39 -0500 (EST)
Aditya Mahajan <adityam@umich.edu> 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 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: typesetting underscore
  2008-01-12 19:11   ` Gour
@ 2008-01-12 22:07     ` Aditya Mahajan
  0 siblings, 0 replies; 7+ messages in thread
From: Aditya Mahajan @ 2008-01-12 22:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 12 Jan 2008, Gour wrote:

> On Sat, 12 Jan 2008 12:59:39 -0500 (EST)
> Aditya Mahajan <adityam@umich.edu> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: typesetting underscore
  2008-01-12 17:59 ` Aditya Mahajan
  2008-01-12 19:11   ` Gour
@ 2008-01-13 22:47   ` Hans Hagen
  2008-01-13 23:10     ` Aditya Mahajan
  2008-01-14  8:10     ` Jean Magnan de Bornier
  1 sibling, 2 replies; 7+ messages in thread
From: Hans Hagen @ 2008-01-13 22:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: typesetting underscore
  2008-01-13 22:47   ` Hans Hagen
@ 2008-01-13 23:10     ` Aditya Mahajan
  2008-01-14  8:10     ` Jean Magnan de Bornier
  1 sibling, 0 replies; 7+ messages in thread
From: Aditya Mahajan @ 2008-01-13 23:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: typesetting underscore
  2008-01-13 22:47   ` Hans Hagen
  2008-01-13 23:10     ` Aditya Mahajan
@ 2008-01-14  8:10     ` Jean Magnan de Bornier
  1 sibling, 0 replies; 7+ messages in thread
From: Jean Magnan de Bornier @ 2008-01-14  8:10 UTC (permalink / raw)
  To: ntg-context

Le 13 janvier à 23:47:12 Hans Hagen <pragma@wxs.nl> écrit notamment:

| 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 -)
>

[...]

As far as I can see, \nonknuthmode_ or \nonknuthmode{_} produces a wider "_" than
\textunderscore{} does. 
-- 
Jean
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-14  8:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-12 16:24 typesetting underscore Gour
2008-01-12 17:59 ` Aditya Mahajan
2008-01-12 19:11   ` Gour
2008-01-12 22:07     ` Aditya Mahajan
2008-01-13 22:47   ` Hans Hagen
2008-01-13 23:10     ` Aditya Mahajan
2008-01-14  8:10     ` Jean Magnan de Bornier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).