[NTG-context] equivalent to \newcommand{...}{\ensuremath{...}}

j. van den hoff veedeehjay at googlemail.com
Tue Dec 9 16:25:57 CET 2014


On Tue, 09 Dec 2014 16:12:08 +0100, Aditya Mahajan <adityam at umich.edu>  
wrote:

> On Mon, 8 Dec 2014, j. van den hoff wrote:
>
>> new to `context' and my first question to the list: how can I achieve  
>> the following (`latex') behaviour:
>>
>> \newcommand{\km}{\ensuremath{K_m}}
>> We can now use \km\ in the body text as well as in this
>> \begin{equation}
>>    \km = 1
>> \end{equation}
>> display equation.
>
> As a side remark, you should normally avoid using lowercase commands  
> like \km (especially if they are small) as you may inadvertently  
> overwrite an inbuilt TeX command (e.g., if you redefine \span or \omit,  
> amongst others). Unlike LaTeX, ConTeXt does not halt at the redefinition  
> of these commands; it simply spews a warning. Personally, I find that a

is this behavior configurable (I think I'd rather prefer `latex' behavior  
here
and still use lowercase abbreviations until I hit a real names clash)

> safer alternative is to use uppercase or camelcase words to define your  
> own commands: either \KM or \Km. This way you avoid conflict with  
> inbuilt commands.

understood.

>
> If you are using macros for abbreviations, you can also use the  
> following:
>
> \definesynonyms[mathnotation][mathnotations][\infull]
>
> \mathnotation [KM] {\mathematics{K_m}} {Viscosity of membrane}
>
> \starttext
>
> \placelistofmathnotations
>
> \section{Test}
>
> We can use \KM\ to denote \infull{KM}.
>
> \startformula
>    \KM = 10
> \stopformula
>
> \stoptext

really thanks a lot for this tip. this seems to be the way to go for any  
"serious" document. (and `viscosity of membrane' is tight, but not right:  
it's a metabolic rate (which could be influenced by membrane permeability)  
in my context ;-))

joerg

>
> This way, you get a list of notation for free.
>
> Aditya
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry  
> to the Wiki!
>
> maillist : ntg-context at 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
> ___________________________________________________________________________________


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the ntg-context mailing list