ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* PPCHTEX: bonds overlaps the radicals groups
@ 2015-09-27 17:00 DesdeChaves
  2015-09-28 12:01 ` Alan BRASLAU
  0 siblings, 1 reply; 3+ messages in thread
From: DesdeChaves @ 2015-09-27 17:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 368 bytes --]

Some time ago I wrote the code attached to create random branched organic
molecules. However, with recent versions of Context the carbon-carbon bonds
overwrites the radicals. How can I fix this?

Another question: is there a way to change the bonds color? I would like to
 blank some radicals and bonds and ask the students to draw it.

Thanks and have a nice sunday.

[-- Attachment #1.2: Type: text/html, Size: 463 bytes --]

[-- Attachment #2: teste.tex --]
[-- Type: application/x-tex, Size: 2501 bytes --]

[-- Attachment #3: screenshot_01.jpg --]
[-- Type: image/jpeg, Size: 65801 bytes --]

[-- Attachment #4: 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] 3+ messages in thread

* Re: PPCHTEX: bonds overlaps the radicals groups
  2015-09-27 17:00 PPCHTEX: bonds overlaps the radicals groups DesdeChaves
@ 2015-09-28 12:01 ` Alan BRASLAU
       [not found]   ` <CAPBmU9HRsFT6MnAkPWa73256r-t+vgh6aHPo4A6r5_Uy0dNbfg@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Alan BRASLAU @ 2015-09-28 12:01 UTC (permalink / raw)
  To: DesdeChaves; +Cc: mailing list for ConTeXt users

On Sun, 27 Sep 2015 18:00:23 +0100
DesdeChaves <desdechaves@gmail.com> wrote:

> Some time ago I wrote the code attached to create random branched
> organic molecules. However, with recent versions of Context the
> carbon-carbon bonds overwrites the radicals. How can I fix this?

The mkiv chemistry module (replacing the mkii PPCHTEX code) uses
tighter spacing around the nodes, which looks nicer with single atomic
symbols. You are placing CH and CH_2 groups so it is necessary to
increasing the spacing at these spots. One trick could be:
  \chemical [ONE,.2MOV1]
which moves .2 bond lengths in the x-direction.

You also need to pay attention to the automatic alignment of symbols,
in particular when using ONE. For Z0 is centered, Z1 is right adjusted,
Z5 is left adjusted... One can explicitly fix the alignment using:
  \chemical [ONE,simalign=lft,Z1]
(MetaPost alignment keys) but it is much easier to leave simalign=auto
and to choose appropriate nodes (using [ONE,MOV1,Z0] rather than
[ONE,Z1] for example).


> Another question: is there a way to change the bonds color? I would
> like to blank some radicals and bonds and ask the students to draw it.

\chemical [rulecolor=red,ONE,B]

Of course, it is a "global" so you will need to use multiple calls in
order to color particular bonds.

Alan
___________________________________________________________________________________
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] 3+ messages in thread

* Re: PPCHTEX: bonds overlaps the radicals groups
       [not found]   ` <CAPBmU9HRsFT6MnAkPWa73256r-t+vgh6aHPo4A6r5_Uy0dNbfg@mail.gmail.com>
@ 2015-09-28 15:20     ` Alan BRASLAU
  0 siblings, 0 replies; 3+ messages in thread
From: Alan BRASLAU @ 2015-09-28 15:20 UTC (permalink / raw)
  To: DesdeChaves; +Cc: mailing list for ConTeXt users

On Mon, 28 Sep 2015 15:37:27 +0100
DesdeChaves <desdechaves@gmail.com> wrote:

> I try inserting several \chemical[ONE, .2MOV1] statements in some key
> places, but without success. Can you provide me a very simple example?

The idea is to draw the bond, then move, then the atom:

\chemical [ONE,SB5,Z5,.2MOV1,Z0,.2MOV1,SB1,1.2MOV1,Z0] [H_3C,CH_2,CH_2]

a bit sloppy, perhaps, but such is the syntax.
On the other hand, one can make multiple calls to \chemical, thus
making the code more readable.

Alternately, one can shorten the bond segments which are defined as
[.25,.75] of the bond length, but this turns out to be less aesthetic
than adding small moves.

One could imagine also to draw the text inside a framed box using a
white background, as in
\framed[frame=off,background=color,backgroundcolor=white]{\chemical{CH_2}}
but I do not like this solution at all.


I suppose that we could modify the underlying MP code to avoid
extending any bond over the text box, but this would impose that the
user draw the nodes before the bonds and would surely fail as one
builds molecules in segments (unless the user be fully aware of the
drawing process). We decided that this would be worse.

Alan
___________________________________________________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2015-09-28 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-27 17:00 PPCHTEX: bonds overlaps the radicals groups DesdeChaves
2015-09-28 12:01 ` Alan BRASLAU
     [not found]   ` <CAPBmU9HRsFT6MnAkPWa73256r-t+vgh6aHPo4A6r5_Uy0dNbfg@mail.gmail.com>
2015-09-28 15:20     ` Alan BRASLAU

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