Thanks for the suggestion, Taco's \molecule macro works.
There is a similar problem for Units (with \usemodule[units]) that appears
in headings, table of contents and list of figure captions, etc.
Sample code:
\usemodule[units]
\starttext
\placecontent
\section{1 \Square\Centi\Meter}
Hello world! 1 \Square\Centi\Meter
\section{$1\Square\Centi\Meter$}
Hello world! $1\Square\Centi\Meter$
\section{$1 {\rm cm^2}$}
Hello world! $1 {\rm cm^2}$
\stoptext
Units appear normally in text. But only the primary dimension "m" appeared
in heading/list, while power/prefix are lost.
In this case, I was able to trace down in the source code a little bit.
In core-syn.tex, there is:
\setupsynonyms
[\v!unit]
[\c!textstyle=\dimension]
And \dimension is supposed to be invoked here:
\def\processsynonym#1#2#3%
{\begingroup % anders in mathmode lege \hbox, zie eenheden
\ifsynonymmeaning
\synonymmeaningfalse
\doattributes{\??sm#1}\c!synonymstyle\c!synonymcolor{#3}%
\else
\explicithmode
\doattributes{\??sm#1}\c!textstyle\c!textcolor{#2}%
\fi
\endgroup}
However, in the case of heading/lists, \dimension is not called. I don't
understand the part about \doattributes, and couldn't trace further. Thank
you.
Regards,
shenchen
On 12/24/07 7:06 AM, "Mojca Miklavec"
The code is too complex for me to be able to understand what's going on (but it seems like a problem which should be fixed, I agree). I'm using an "ugly" piece of code from the wiki instead of the module http://wiki.contextgarden.net/Chemistry (bottom of the page) when I need to typeset simple chemistry. I also needed a formula to apear in titiles and it worked really nice.
Mojca