ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Bad interaction between new interpretation of underscore and modules
Date: Thu, 13 Jan 2011 17:43:47 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1101131743100.1271@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <AFD498F0-EA14-4B24-9C55-56A35BC02CBE@gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1462 bytes --]

On Thu, 13 Jan 2011, Wolfgang Schuster wrote:

>
> Am 13.01.2011 um 17:18 schrieb Mathieu Boespflug:
>
>> Hi all,
>>
>> today's beta introduced a really strange problem. Consider two source files:
>>
>> definitions.tex:
>> \startmodule[definitions]
>> \def\lambdax{\lambda_x}
>> \stopmodule[definitions]
>>
>> main.tex:
>> \usemodule[definitions]
>> \starttext
>> blah $\lambdax$ blah.
>> \stoptext
>>
>> This results in the following compile error:
>>
>> ! Undefined control sequence.
>> \lambdax ->\lambda_x
>>
>> l.5 blah $\lambdax
>>                  $ blah.
>> ?
>>
>> However, if you change "\usemodule[definitions]" into "\input
>> definitions" instead, then there is no compile error! My understanding
>> is that the underscore is a valid character for macro names now
>> outside of math mode, which is what is causing the problem. But I
>> really don't understand what magic is going on in the modules code to
>> trigger this.
>>
>> I would be very interested in an explanation of what is going on.
>
> You need \normalsubscript in your module. You define a command and
> in this case it doesn’t matter that you plan to use it in math mode,
> the _ is now a normal letter like “a” and this won’t change when you
> call \lambdax in your document.
>
> Write
>
>  \def\lambdax{\lambda\normalsubscript x}
>
> and it will work again.

Untested:

\def\lambdax{\math{\lambda_x}}

should also work.

Aditya

[-- Attachment #2: Type: text/plain, Size: 486 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2011-01-13 22:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13 16:18 Mathieu Boespflug
2011-01-13 21:50 ` Wolfgang Schuster
2011-01-13 22:43   ` Aditya Mahajan [this message]
2011-01-14  0:14     ` Wolfgang Schuster
2011-01-14  9:15   ` Mathieu Boespflug
2011-01-14  9:32     ` Wolfgang Schuster
2011-01-14 10:09       ` Mathieu Boespflug
2011-01-14 11:01     ` Hans Hagen
2011-01-14 11:13       ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1101131743100.1271@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).