ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [***SPAM***] Spacing and font problem with \chemical inside display math
@ 2012-12-13 14:41 Romain Diss
  2012-12-13 14:45 ` Romain Diss
  2012-12-13 15:30 ` Alan BRASLAU
  0 siblings, 2 replies; 5+ messages in thread
From: Romain Diss @ 2012-12-13 14:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

I found what I suppose to be a bug with the \chemical command:
- when one use \chemical inside display math, the spacing is wrong around the 
\chemical stuff. The font change inside \chemical also persists outside the 
command.
- if one enclose the \chemical command into curly braces, the font problem do 
not appear but the spaces are still wrong.
- if one put the \chemical command inside a \text{} command, ConTeXt stops 
with an error.
These problems do not occur in inline math.

Here is a minimal example:

%% START
\starttext

Chemical within inline math: \m{M(\chemical{CO_2})} or
\m{M(\text{\chemical{CO_2}})}. This works fine.

Chemical in display math: \startformula M(\chemical{CO_2}) \stopformula gives
some strange spacing and seems to modify the font outside \tex{chemical}.

Chemical in display math: \startformula M({\chemical{CO_2}}) \stopformula
corrects the font problem but still gives some strange spacing.

%Chemical inside \text in display math: \startformula 
%M(\text{\chemical{CO_2}}) \stopformula gives an error.

\stoptext
%% END

Anyone has an idea to solve this?

Thanks in advance.


-- 
Romain Diss
<romain.diss@yahoo.fr>
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Spacing and font problem with \chemical inside display math
  2012-12-13 14:41 [***SPAM***] Spacing and font problem with \chemical inside display math Romain Diss
@ 2012-12-13 14:45 ` Romain Diss
  2012-12-13 14:53   ` Andre Caldas
  2012-12-13 15:30 ` Alan BRASLAU
  1 sibling, 1 reply; 5+ messages in thread
From: Romain Diss @ 2012-12-13 14:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Strange, why did I get a spam tag on this message…

-- 
Romain Diss
<romain.diss@yahoo.fr>
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Spacing and font problem with \chemical inside display math
  2012-12-13 14:45 ` Romain Diss
@ 2012-12-13 14:53   ` Andre Caldas
  0 siblings, 0 replies; 5+ messages in thread
From: Andre Caldas @ 2012-12-13 14:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> Strange, why did I get a spam tag on this message…

The filter might have thought you were selling drugs... =o)


André Caldas.
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Spacing and font problem with \chemical inside display math
  2012-12-13 14:41 [***SPAM***] Spacing and font problem with \chemical inside display math Romain Diss
  2012-12-13 14:45 ` Romain Diss
@ 2012-12-13 15:30 ` Alan BRASLAU
  2012-12-13 23:24   ` [***SPAM***] " Romain Diss
  1 sibling, 1 reply; 5+ messages in thread
From: Alan BRASLAU @ 2012-12-13 15:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

We are currently in the process of a complete re-write of the chemical macros. In fact, we are almost finished and Hans is including the new macros in the beta (as fast as he can keep up with my changes...).

In your example, I see the spacing problem in display math but do not see the font problem. Maybe Hans can fix this extra spacing problem.

Rather than display math (as was suggested with ppchTeX), we have now introduced
\startchemicalformula
\stopchemicalformula
in order to "display" a chemical formula.

Also, I'm not sure why you might want to put \chemical{} within a \text command; may I suggest either \type{\chemical{CO_2}} or {\tt typewriter \chemical{CO_2}}, depending upon what you want to achieve.

Alan


On Thu, 13 Dec 2012 15:41:56 +0100
Romain Diss <romain.diss@yahoo.fr> wrote:

> Hi all,
> 
> I found what I suppose to be a bug with the \chemical command:
> - when one use \chemical inside display math, the spacing is wrong around the 
> \chemical stuff. The font change inside \chemical also persists outside the 
> command.
> - if one enclose the \chemical command into curly braces, the font problem do 
> not appear but the spaces are still wrong.
> - if one put the \chemical command inside a \text{} command, ConTeXt stops 
> with an error.
> These problems do not occur in inline math.
> 
> Here is a minimal example:
> 
> %% START
> \starttext
> 
> Chemical within inline math: \m{M(\chemical{CO_2})} or
> \m{M(\text{\chemical{CO_2}})}. This works fine.
> 
> Chemical in display math: \startformula M(\chemical{CO_2}) \stopformula gives
> some strange spacing and seems to modify the font outside \tex{chemical}.
> 
> Chemical in display math: \startformula M({\chemical{CO_2}}) \stopformula
> corrects the font problem but still gives some strange spacing.
> 
> %Chemical inside \text in display math: \startformula 
> %M(\text{\chemical{CO_2}}) \stopformula gives an error.
> 
> \stoptext
> %% END
> 
> Anyone has an idea to solve this?
> 
> Thanks in advance.

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [***SPAM***] Re: Spacing and font problem with \chemical inside display math
  2012-12-13 15:30 ` Alan BRASLAU
@ 2012-12-13 23:24   ` Romain Diss
  0 siblings, 0 replies; 5+ messages in thread
From: Romain Diss @ 2012-12-13 23:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: Text/Plain, Size: 1664 bytes --]

Thanks for your response,

Le jeudi 13 décembre 2012, vous avez écrit :
> In your example, I see the spacing problem in display math but do not see
> the font problem. Maybe Hans can fix this extra spacing problem.
I joined the pdf output I get with my minimal sample. The font problem occurs 
on line 3 where the last parenthesis is smaller than expected.

> Rather than display math (as was suggested with ppchTeX), we have now
> introduced \startchemicalformula
> \stopchemicalformula
> in order to "display" a chemical formula.
Yes but in my cases I do want a mathematic display and not an chemicalformula 
one because I want to express a mathematical formula where chemical formulas 
are indexes. As an example, considere the calculation of the molecular weight:
M(C6H12O6) = 6 M(C) + 12 M(H) + 6 M(O)

> Also, I'm not sure why you might want to put \chemical{} within a \text
> command; may I suggest either \type{\chemical{CO_2}} or {\tt typewriter
> \chemical{CO_2}}, depending upon what you want to achieve.
In fact, it's an habit I made when I used to put chemical formulas in 
subscript like in: m_{H20} = ... With \math{m_{\chemical{H_2O}}}, H2O was 
typed in normal font whereas with \math{m_{\text{\chemical{H_2O}}}}, it was 
typed in subscript font as expected. Did not test if it's still the case.

> We are currently in the process of a complete re-write of the chemical
> macros. In fact, we are almost finished and Hans is including the new
> macros in the beta (as fast as he can keep up with my changes...).
So I will wait for the new rewritten macros.

Thanks again.

-- 
Romain Diss
<romain.diss@yahoo.fr>

[-- Attachment #2: test-chemical.pdf --]
[-- Type: application/pdf, Size: 15666 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-13 23:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-13 14:41 [***SPAM***] Spacing and font problem with \chemical inside display math Romain Diss
2012-12-13 14:45 ` Romain Diss
2012-12-13 14:53   ` Andre Caldas
2012-12-13 15:30 ` Alan BRASLAU
2012-12-13 23:24   ` [***SPAM***] " Romain Diss

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).