From: Shen Chen <ShenChen@nus.edu.sg>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Chemistry in lists
Date: Mon, 24 Dec 2007 13:54:26 +0800 [thread overview]
Message-ID: <C3956A92.10C52%ShenChen@nus.edu.sg> (raw)
In-Reply-To: <6faad9f00712231506o15617410h9c43d83a28b6cf7a@mail.gmail.com>
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" <mojca.miklavec.lists@gmail.com>
wrote:
>
> 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
>
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2007-12-24 5:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-22 8:10 Shen Chen
2007-12-23 23:06 ` Mojca Miklavec
2007-12-24 5:54 ` Shen Chen [this message]
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=C3956A92.10C52%ShenChen@nus.edu.sg \
--to=shenchen@nus.edu.sg \
--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).