Re: [NTG-context] Chemistry in lists

2007-12-23 Thread Shen Chen
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 [EMAIL PROTECTED]
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
___


[NTG-context] Chemistry in lists

2007-12-22 Thread Shen Chen
Hi all,


I have some chemical formulae in chapter heading and figure captions,
typeset with the chemic module. The chemic module always uses roman font as
desired.

When I include them in table of contents and list of figures, the chemical
formulae appears in math italic font instead of roman font. See the
following code for example. Chemic Manual mentioned using \rm but it doesn't
seem to be the case. $\rm H_2O$ works fine in the list, but not
\chemical{H_2O}. Any suggestions? Thank you.

\usemodule[chemic]
\starttext

\writetolist[chapter]{}{ABC}
\writetolist[chapter]{}{$H_2O$}
\writetolist[chapter]{}{$\rm H_2O$}
\writetolist[chapter]{}{\chemical{H_2O}}
\completecontent

\stoptext


Regards,
shenchen

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


[NTG-context] Problem with chemistry in display mode

2007-10-09 Thread Shen Chen
Hi all, 

The following example with the chemical module complains that ! Argument of
\mtharrowfill has an extra }..

---
\usemodule[chemic]
\starttext
$$ \chemical{2H_2,PLUS,O_2,GIVES,2H_2O} $$
\stoptext
---

The result pdf looks fine, though. The annoying problem only occurs when
there's an arrow GIVES, and only in display mode.

I am using ConTeXt 2007.08.24, and the complete warning message is

---
! Argument of \mtharrowfill has an extra }.
inserted text 
\par
to be read again 
   }
\chemicaloutermolecule ...chemicalstyle {\strut #1
  }$}\doresetsubscripts
}\ma...

\dochemicalouterarrow ...\!!zeropoint \box 4\fi }
  \egroup
\p!compareprocessactionD ...ommalistelement {#3}#2
  \expandafter
\quitcommalis...

\next2 #1,-\p!dodoprocessaction {#1}
 \doprocesscommaitem
...
---


Thanks a lot,
shenchen

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


Re: [NTG-context] Problem with chemistry in display mode

2007-10-09 Thread Shen Chen
The fix works. Thanks a lot!

shenchen

On 10/10/07 1:59 AM, Aditya Mahajan [EMAIL PROTECTED] wrote:

 On Tue, 9 Oct 2007, Shen Chen wrote:
 
 Hi all,
 
 The following example with the chemical module complains that ! Argument of
 \mtharrowfill has an extra }..
 
 ---
 \usemodule[chemic]
 \starttext
 $$ \chemical{2H_2,PLUS,O_2,GIVES,2H_2O} $$
 \stoptext
 ---
 
 The result pdf looks fine, though. The annoying problem only occurs when
 there's an arrow GIVES, and only in display mode.
 
 This error is due to a change that I suggested in math-ext (for over
 and under arrows). I did not check that it breaks ppchtex. Here is a
 fix. Add this somewhere in your style file:
 
 \def\chemicalsingleouterarrow
{\dochemicalouterarrow
   {\hbox to \dimen2{\rightarrowfill\textstyle}}}
 
 \def\chemicaldoubleouterarrow
{\dochemicalouterarrow
   {\lower.5\ht0\vbox
  {\offinterlineskip
   \hbox to \dimen2{\rightarrowfill\textstyle}
   \hbox to \dimen2{\leftarrowfill\textstyle
 
 \def\chemicaltwintipouterarrow
{\dochemicalouterarrow
   {\hbox
  {\hbox to \dimen2{\rightarrowfill\textstyle}%
   \hskip-\dimen2
   \hbox to \dimen2{\leftarrowfill\textstyle
 
 
 Hans, this should be corrected in ppchtex. There are a few other
 chemistry modules that use arrowfills, which now needs an argument
 specifying the math mode in which arrow should be drawn.
 
 I will look into it, but I have examples of working chemical
 formulas.
 
 Aditya
 __
 _
 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
 __
 _

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


[NTG-context] Uppercase Greek in large fontsize

2007-08-20 Thread Shen Chen
Hi all,

I had a problem with typesetting uppercase Greek in large fontsize.
I am doing a screen presentation so I want to work with 18pt body font size.
But uppercase greek letters all disappear whenever I use anything bigger
than 12pt. All small case greek letter are fine, though. Wondering if there
is a simple fix to it. Thanks a lot!

\setupbodyfont[roman,18pt]
\starttext
Hello world!
$$\delta \Delta \alpha \Alpha \gamma \Gamma $$
\stoptext

Best regards,
Shen Chen

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


Re: [NTG-context] Uppercase Greek in large fontsize

2007-08-20 Thread Shen Chen
Thanks for the suggestion.
But \definebodyfontenvironment doesn't seem to have any effect.
I tried it on live.contextgarden.net, \Delta appear like a \prime.

shenchen

On 8/21/07 12:24 AM, Hans Hagen [EMAIL PROTECTED] wrote:

 Shen Chen wrote:
 Hi all,
 
 I had a problem with typesetting uppercase Greek in large fontsize.
 I am doing a screen presentation so I want to work with 18pt body font size.
 But uppercase greek letters all disappear whenever I use anything bigger
 than 12pt. All small case greek letter are fine, though. Wondering if there
 is a simple fix to it. Thanks a lot!
 
 \setupbodyfont[roman,18pt]
 \starttext
 Hello world!
 $$\delta \Delta \alpha \Alpha \gamma \Gamma $$
 \stoptext
 \definebodyfontenvironment[18pt]
 \setupbodyfont[18pt]
 Hello world!
 $$\delta \Delta \alpha \Alpha \gamma \Gamma $$
 
 -
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
   | www.pragma-pod.nl
 -
 __
 _
 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
 __
 _

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


Re: [NTG-context] Double integral and subscripts

2007-08-07 Thread Shen Chen
I am using ConTeXt ver: 2007.01.12, and \iint is not defined even when
newmat is imported. Taco's tip worked.

As I tried on live.contextgarden.net, which is running the latest ConTeXt,
\iint\limits_{...} works as intended.

Thank you.


On 8/5/07 10:10 PM, Aditya Mahajan [EMAIL PROTECTED] wrote:

 On Sun, 5 Aug 2007, Taco Hoekwater wrote:
 
 Shen Chen wrote:
 Hi all,
 
 I want to typeset double integral with subscript beneath the integral
 symbol.
 
 I found [EMAIL PROTECTED] for double integral, and used the usual \limits in
 plain tex:
 [EMAIL PROTECTED] x \ge 0,\NR 0 \le y \le T\stopsubstack}
 
 
 The subscript did go below the integral, but the two integral symbols are
 separate from each other. Any tips? Thanks a lot!
 
 $$
 [EMAIL PROTECTED]
 {\startsubstack x \ge 0,\NR 0 \le y \le \stopsubstack}
 $$
 
 (it should be possible to do this more elegant, though)
 
 \iint\limits should work correctly. It is based on the same macro in
 amsmath.
 
 If you always need \limits, I can provide an option for \displaylimits
 or \nolimits after int, iint, and iiint.
 
 I did not know about [EMAIL PROTECTED], and it looks horrible
 (\int\!\!\!\int). This should be replaced by \iint and triint should
 be replaced by iiint.
 
 Aditya
 __
 _
 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
 __
 _

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


[NTG-context] Double integral and subscripts

2007-08-05 Thread Shen Chen
Hi all,

I want to typeset double integral with subscript beneath the integral
symbol. 

I found [EMAIL PROTECTED] for double integral, and used the usual \limits in
plain tex:
[EMAIL PROTECTED] x \ge 0,\NR 0 \le y \le T\stopsubstack}

The subscript did go below the integral, but the two integral symbols are
separate from each other. Any tips? Thanks a lot!

Shenchen

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