+ as plain vanilla math character
Dear all, I'm wondering how to typeset a sequence of pluses such that each plus is placed with "normal" math character spacing around it ... In this snippet I guess a plus (or at least the majority of pluses) is simply treated as a binary operator with appropriate spacing: --- \def\ket#1{\lvert#1\rangle} \starttext Note the spacing in \startformula \startmathalignment \NC\ket{+}\NR \NC\ket{++}\NR \NC\ket{+++}\NR \NC\ket{++++}\NR \NC\ket{000}\NR \stopmathalignment \stopformula \stoptext --- Cheerio, Oliver
Oliver Buerschaper wrote:
Dear all,
I'm wondering how to typeset a sequence of pluses such that each plus is placed with "normal" math character spacing around it ... In this snippet I guess a plus (or at least the majority of pluses) is simply treated as a binary operator with appropriate spacing:
This should normally work, but it depends on the current math encoding (see the math-xxx.tex files in the distribution): \definemathcharacter [+] [ord] [mr] ["2B] % [bin] is default Best wishes, Taco
Hi Taco,
This should normally work, but it depends on the current math encoding (see the math-xxx.tex files in the distribution):
\definemathcharacter [+] [ord] [mr] ["2B] % [bin] is default
Just tried this but to no avail :-( It seems like the definition isn't found at all: --- \def\ket#1{\lvert#1\rangle} \startmathcollection[default] \definemathcharacter [myplus] [ord] [mr] ["2B] \stopmathcollection \starttext Note the spacing in \startformula \startmathalignment \NC\ket{+}\NR \NC\ket{++}\NR \NC\ket{+++}\NR \NC\ket{++++}\NR \NC\ket{\myplus\myplus\myplus\myplus}\NR \NC\ket{000}\NR \stopmathalignment \stopformula \stoptext --- Is this caused by some wrong math encoding scheme? Or is there something else that I miss? Puzzled, Oliver
Oliver Buerschaper wrote:
Hi Taco,
This should normally work, but it depends on the current math encoding (see the math-xxx.tex files in the distribution):
\definemathcharacter [+] [ord] [mr] ["2B] % [bin] is default
Just tried this but to no avail :-(
Probably because "+" is done already.
\startmathcollection[default] \definemathcharacter [myplus] [ord] [mr] ["2B] \stopmathcollection
This will work, except that you need \definemathsymbol, not \definemathcharacter. \startmathcollection[default] \definemathsymbol [myplus] [ord] [mr] ["2B] \stopmathcollection Best wishes, Taco
\startmathcollection[default] \definemathcharacter [myplus] [ord] [mr] ["2B] \stopmathcollection
This will work, except that you need \definemathsymbol, not \definemathcharacter.
\startmathcollection[default] \definemathsymbol [myplus] [ord] [mr] ["2B] \stopmathcollection
That's it, stupid me ... now it works like a charm. Many thanks! Oliver
participants (2)
-
Oliver Buerschaper
-
Taco Hoekwater