ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Marco Patzer <homerow@lavabit.com>
To: context <ntg-context@ntg.nl>
Subject: Re: Wrong results for chemical structures and reactions
Date: Tue, 2 Oct 2012 12:16:27 +0200	[thread overview]
Message-ID: <20121002121627.26853e53@homerow> (raw)
In-Reply-To: <20121002115026.5b4f19f3@sole>

2012-10-02 Alan BRASLAU <alan.braslau@cea.fr>:

> Try the following:
> 
> \starttext
> 
> \startchemicalformula
>  \chemical{2H_2}
>  \chemical{+}
>  \chemical{O_2}
>  \chemical{->}
>  \chemical{2H_2O}
> \stopchemicalformula

\chemical{->} is not rendered correctly.

> \startchemicalformula
>  \chemical{2H_2}
>  \chemical{PLUS}
>  \chemical{O_2}
>  \chemical{GIVES}
>  \chemical{2H_2O}
> \stopchemicalformula

The spacing is wrong. The following yields to better spacing:

\startchemicalformula
 \chemical{2H_2}
 \chemical{PLUS}
 \chemical{}
 \chemical{O_2}
 \chemical{GIVES}
 \chemical{}
 \chemical{2H_2O}
\stopchemicalformula

> \startchemicalformula
>   \chemical{A}
>   \chemical{GIVES}
>   \chemical{B}
>   \chemical{EQUILIBRIUM}
>   \chemical{C}
>   \chemical{MESOMERIC}
>   \chemical{D}
> \stopchemicalformula

Same spacing problem, workaround: \chemical{}

> \setupchemical
>     [width=fit,
>      height=fit,
>      scale=small,
>      size=small]
> 
> \hbox{
> \startchemical
>     \chemical[ONE,Z0,DB1,SB46,MOV1,Z0,SB28][C,C]
> \stopchemical
> \startchemicalformula
>     \chemical{PLUS}
> \stopchemicalformula
> \startchemical
>     \chemical[ONE,Z0,SB146,Z6][N,H]
> \stopchemical
> \startchemicalformula
>     \chemical{GIVES}
> \stopchemicalformula
> \startchemical
>     \chemical[ONE,Z07,SB1357,MOV1,Z0,SB27,MOV2,Z0,SB13][C,H,C,N]
> \stopchemical
> }

Worse than before.

> 3. I believe that the syntax should be rationalized, but I will have to
> discuss this further with Hans. Normally, commands have keywords
> between [] and text to be typeset between {}. This would mean
> \startchemical
> 	\chemical[ONE,Z0,SB146,Z6]{N}{H}
> \stopchemical
> 
> Alternatively:
> \startchemical
> 	\chemical[ONE,Z0=N,SB146,Z6=H]
> \stopchemical
> but currently this puts "N" and "H" into lowercase as "n" and "h"
> as a side effect of the way that Hans wrote the lua code.

If you redo the syntax: My suggestion would be to try to reduce the
use of the string “chemical” if that's feasible.

> How to deal with inline equations, as in \chemical{2H_2,+,O_2,->,2H_2O}?
> I would think that it could work as does math mode:
> \chemical{2H_2 + O_2 -> 2H_2O} (no commas) with spaces (or none)
> delimiting the keywords.

That looks more practical.

> Hans will have to answer me on this. We need to be a bit patient,

I don't need that now. For the current project all structures look
fine (ugly hacks included :). You may consider my comments above
when you (or Hans) are redoing the code. Thanks for the
\startchemicalformula hint, that was the missing piece.

> as I'm sure that he is currently VERY busy preparing for EuroTeX 2012!

Sure. Unfortunately I cannot come, I can't get a week off and for
1-2 days it's too far.


Marco

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

      parent reply	other threads:[~2012-10-02 10:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02  7:40 Marco Patzer
2012-10-02  8:06 ` Alan BRASLAU
2012-10-02  8:36   ` Marco Patzer
     [not found] ` <20121002115026.5b4f19f3@sole>
2012-10-02 10:16   ` Marco Patzer [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=20121002121627.26853e53@homerow \
    --to=homerow@lavabit.com \
    --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).