Re: [NTG-context] Formula starting with brackets

2016-09-13 Thread Hans Åberg

> On 13 Sep 2016, at 11:23, Mikael P. Sundqvist  wrote:
> 
> On Tue, Sep 13, 2016 at 11:17 AM, Hans Åberg  wrote:
>> In the example below, using latest ConTeXt, the bracket "[f]” does not show 
>> when using \startformula.

> I think it gets interpreted as an (optional) argument to \startformula.

Yes, I realized that.

> Try
> 
> \startformula\relax
>  [f] = B
> \stopformula

Yes, this works. Thanks for the suggestion.


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

Re: [NTG-context] Formula starting with brackets

2016-09-13 Thread Mikael P. Sundqvist
On Tue, Sep 13, 2016 at 11:17 AM, Hans Åberg  wrote:
> In the example below, using latest ConTeXt, the bracket "[f]” does not show 
> when using \startformula.
>
>
> \setupbodyfont[xits,10pt]
>
> \setupmathematics[lcgreek=normal, default=normal]
>
> \starttext
>
> \startformula
>   [f] = B
> \stopformula
>
> $$
> [f] = B
> $$
>
> \stoptext
>
>
> ___
> 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
> ___

I think it gets interpreted as an (optional) argument to \startformula. Try

\startformula\relax
  [f] = B
\stopformula

/Mikael
___
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
___

[NTG-context] Formula starting with brackets

2016-09-13 Thread Hans Åberg
In the example below, using latest ConTeXt, the bracket "[f]” does not show 
when using \startformula.


\setupbodyfont[xits,10pt]

\setupmathematics[lcgreek=normal, default=normal]

\starttext

\startformula
  [f] = B
\stopformula

$$
[f] = B
$$

\stoptext


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

Re: [NTG-context] Math letters in commands

2016-09-13 Thread Hans Åberg

> On 13 Sep 2016, at 07:57, Hans Hagen  wrote:

> sure, but when you do
> 
> \appendtoks
>  \catcode`\‘=\active
>  \def‘#1’{\csname #1\endcsname}
> \to …

FYI, this does not work for me; I must use LuaTeX \letcharcode:

\def\usemathcommand#1’{\csname #1\endcsname}

\appendtoks
  \catcode`‘=\activecatcode
  \letcharcode `‘ \usemathcommand
\to \everymathematics

Then “$” must be followed by a character other than ‘ for this command to be 
seen, but it works with “$$”.


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

Re: [NTG-context] Math letters in commands

2016-09-13 Thread Hans Åberg

> On 13 Sep 2016, at 07:57, Hans Hagen  wrote:
> 
> On 9/12/2016 10:02 PM, Hans Åberg wrote:

>> It does not happen with TeX using
>>  \catcode`\‘=\active
>>  \def‘#1’{\csname #1\endcsname}
> 
> sure, but when you do
> 
> \appendtoks
>  \catcode`\‘=\active
>  \def‘#1’{\csname #1\endcsname}
> \to ...
> 
> only tokens get added to the register ... so the ‘ after the \def is not 
> active (yet)
> 
> in addition when tex sees a $ it will look for a next token (in case it's a $ 
> for display mode) and it sees a quote (no everymath doen then) which it will 
> push back

OK. TeX does not parse the way I expected.


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