ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Drawing chemical structures
@ 2013-11-21 18:10 DesdeChaves
  2013-11-21 19:01 ` Alan Braslau
  2013-11-21 20:11 ` Alan Braslau
  0 siblings, 2 replies; 5+ messages in thread
From: DesdeChaves @ 2013-11-21 18:10 UTC (permalink / raw)
  To: ntg-context


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

Dear Sirs,

I'm trying to run some code from the ppchtex manual, however, the chemical
structures are not correctly drawn. See the example:
https://www.dropbox.com/s/w7v8kouc4glndf0/chemicerror.pdf.

I found this problem en Minimals (last version) and on TexLive 2013.


\setupbodyfont[11pt]
\usemodule[chemic]
\starttext


\startchemical[width=fit,scale=small,size=big]
\bottext{α-Glycerophosphate}
\chemical[ONE,SB1357,Z0357][\TL{α}{C},\SL{OPO\lohi{3}{2-}},H,H]
\chemical[MOV1,SB137,Z037][C,\SL{OH},H]
\chemical[MOV1,SB137,Z0137][C,H,\SL{OH},H]
\stopchemical



\definechemical[desoxyribose]
{\chemical[FIVE,FRONT,BB125,+SB3,-SB4,Z4][O]
\chemical[FIVE,FRONT,+R1235,+RZ1235][H,H,\SR{HOH_2C},OH]
\chemical[FIVE,FRONT,-R1235,-RZ1235][H,OH,H,H]}

\startchemical[height=6500,top=2000,bottom=2500,width=4500]
\chemical[desoxyribose]
\bottext{Desoxiribosa (dR)}
\stopchemical

\startchemical[height=4500,bottom=2500]
\bottext{$\alpha$-D-Fructofuranose}
\chemical
[FIVE,FRONT,BB125,+SB3,-SB4,Z4][O]
\chemical
[FIVE,FRONT,+R1235,+RZ1235][\SR{HO},H,\SR{HOH_2C},CH_2OH]
\chemical
[FIVE,FRONT,-R1235,-RZ1235][OH,H,\SR{HO},H,CH_2OH]
\stopchemical

\startchemical[height=4500,bottom=2500]
\chemical [FIVE,FRONT,B,R]
\chemical [+RZ1..5] [1,2,3,4,5]
\chemical [-RZ1..5] [a,b,c,d,e]
\stopchemical



\stoptext

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

[-- Attachment #2: 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

* Re: Drawing chemical structures
  2013-11-21 18:10 Drawing chemical structures DesdeChaves
@ 2013-11-21 19:01 ` Alan Braslau
  2013-11-21 20:11 ` Alan Braslau
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Braslau @ 2013-11-21 19:01 UTC (permalink / raw)
  To: desdechaves; +Cc: mailing list for ConTeXt users

Hello,

We have completely rewritten the chemical macros from ppchtex, taking
some liberty with some details of the syntax. I will look into your
examples to see what is going wrong.

Alan


On Thu, 21 Nov 2013 18:10:45 +0000
DesdeChaves <desdechaves@gmail.com> wrote:

> Dear Sirs,
> 
> I'm trying to run some code from the ppchtex manual, however, the
> chemical structures are not correctly drawn. See the example:
> https://www.dropbox.com/s/w7v8kouc4glndf0/chemicerror.pdf.
> 
> I found this problem en Minimals (last version) and on TexLive 2013.
> 
> 
> \setupbodyfont[11pt]
> \usemodule[chemic]
> \starttext
> 
> 
> \startchemical[width=fit,scale=small,size=big]
> \bottext{α-Glycerophosphate}
> \chemical[ONE,SB1357,Z0357][\TL{α}{C},\SL{OPO\lohi{3}{2-}},H,H]
> \chemical[MOV1,SB137,Z037][C,\SL{OH},H]
> \chemical[MOV1,SB137,Z0137][C,H,\SL{OH},H]
> \stopchemical
> 
> 
> 
> \definechemical[desoxyribose]
> {\chemical[FIVE,FRONT,BB125,+SB3,-SB4,Z4][O]
> \chemical[FIVE,FRONT,+R1235,+RZ1235][H,H,\SR{HOH_2C},OH]
> \chemical[FIVE,FRONT,-R1235,-RZ1235][H,OH,H,H]}
> 
> \startchemical[height=6500,top=2000,bottom=2500,width=4500]
> \chemical[desoxyribose]
> \bottext{Desoxiribosa (dR)}
> \stopchemical
> 
> \startchemical[height=4500,bottom=2500]
> \bottext{$\alpha$-D-Fructofuranose}
> \chemical
> [FIVE,FRONT,BB125,+SB3,-SB4,Z4][O]
> \chemical
> [FIVE,FRONT,+R1235,+RZ1235][\SR{HO},H,\SR{HOH_2C},CH_2OH]
> \chemical
> [FIVE,FRONT,-R1235,-RZ1235][OH,H,\SR{HO},H,CH_2OH]
> \stopchemical
> 
> \startchemical[height=4500,bottom=2500]
> \chemical [FIVE,FRONT,B,R]
> \chemical [+RZ1..5] [1,2,3,4,5]
> \chemical [-RZ1..5] [a,b,c,d,e]
> \stopchemical
> 
> 
> 
> \stoptext
___________________________________________________________________________________
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: Drawing chemical structures
  2013-11-21 18:10 Drawing chemical structures DesdeChaves
  2013-11-21 19:01 ` Alan Braslau
@ 2013-11-21 20:11 ` Alan Braslau
  2013-11-21 20:55   ` Aditya Mahajan
  1 sibling, 1 reply; 5+ messages in thread
From: Alan Braslau @ 2013-11-21 20:11 UTC (permalink / raw)
  To: desdechaves; +Cc: mailing list for ConTeXt users

Indeed, there have been a few changes,
several rationalizations of the syntax:

1. FIVE,FRONT has become FIVEFRONT
2. positions are numbered coherently with FIVE
   (previously they were shifted by one)
3. +R and -R have become LR and RR,
   to be coherent with the non-front structures.
4. Thus, +LSR and -RSR are the asymmetrically shortened
   versions drawing bonds.
5. One can still use dimensional measurements in the thousands,
   but it is preferable to use numbers close to unity, interpreted
   in units of the bond length.
6. The bounding box is by default fit (in ppchtex it was fixed
   4000x4000). Placing labels thus generally requires specifying
   a top or bottom dimension.

Below is your example, corrected.
(For some reason, unicode \alpha currently disappears - a font issue.
This worked early so is indeed a bug.)

A complete new manual has been written. We are currently hung on one or
two minor details that Hans and myself have not yet take care of - just
a question of getting around to it. Indeed, we NEED to release the new
manual...

Alan


\setupbodyfont[11pt]
\starttext

\startchemical[bottom=1.75,size=big,frame=on]
\bottext{\alpha-Glycerophosphate}
\chemical[ONE,SB1357,Z0357][\TL{\alpha}{C},\SL{OPO\lohi{3}{2-}},H,H]
\chemical[MOV1,SB137,Z037][C,\SL{OH},H]
\chemical[MOV1,SB137,Z0137][C,H,\SL{OH},H]
\stopchemical

\definechemical[desoxyribose]
{\chemical[FIVEFRONT,BB123,+SB4,-SB5,Z5][O]
\chemical[FIVEFRONT,+LSR1234,LRZ1234][OH,H,H,\SR{HOH_2C}]
\chemical[FIVEFRONT,+RSR1234,RRZ1234][H,H,OH,H]}

\startchemical[width=3.5,bottom=2,frame=on,axis=on]
\chemical[desoxyribose]
\bottext{Desoxiribosa (dR)}
\stopchemical

\startchemical[width=4,bottom=2,frame=on]
\bottext{$\alpha$-D-Fructofuranose}
\chemical[FIVEFRONT,BB123,+SB4,-SB5,Z5][O]
\chemical[FIVEFRONT,+LSR1234,LRZ1234][CH_2OH,\SR{HO},H,\SR{HOH_2C}]
\chemical[FIVEFRONT,-RSR123,RRZ123][OH,H,\SR{HO},H]
\stopchemical

\startchemical[frame=on]
\chemical [FIVEFRONT,B,+LSR,+RSR]
\chemical [LRZ1..5] [1,2,3,4,5]
\chemical [RRZ1..5] [a,b,c,d,e]
\stopchemical

\stoptext





On Thu, 21 Nov 2013 18:10:45 +0000
DesdeChaves <desdechaves@gmail.com> wrote:

> Dear Sirs,
> 
> I'm trying to run some code from the ppchtex manual, however, the
> chemical structures are not correctly drawn. See the example:
> https://www.dropbox.com/s/w7v8kouc4glndf0/chemicerror.pdf.
> 
> I found this problem en Minimals (last version) and on TexLive 2013.
> 
> 
> \setupbodyfont[11pt]
> \usemodule[chemic]
> \starttext
> 
> 
> \startchemical[width=fit,scale=small,size=big]
> \bottext{α-Glycerophosphate}
> \chemical[ONE,SB1357,Z0357][\TL{α}{C},\SL{OPO\lohi{3}{2-}},H,H]
> \chemical[MOV1,SB137,Z037][C,\SL{OH},H]
> \chemical[MOV1,SB137,Z0137][C,H,\SL{OH},H]
> \stopchemical
> 
> 
> 
> \definechemical[desoxyribose]
> {\chemical[FIVE,FRONT,BB125,+SB3,-SB4,Z4][O]
> \chemical[FIVE,FRONT,+R1235,+RZ1235][H,H,\SR{HOH_2C},OH]
> \chemical[FIVE,FRONT,-R1235,-RZ1235][H,OH,H,H]}
> 
> \startchemical[height=6500,top=2000,bottom=2500,width=4500]
> \chemical[desoxyribose]
> \bottext{Desoxiribosa (dR)}
> \stopchemical
> 
> \startchemical[height=4500,bottom=2500]
> \bottext{$\alpha$-D-Fructofuranose}
> \chemical
> [FIVE,FRONT,BB125,+SB3,-SB4,Z4][O]
> \chemical
> [FIVE,FRONT,+R1235,+RZ1235][\SR{HO},H,\SR{HOH_2C},CH_2OH]
> \chemical
> [FIVE,FRONT,-R1235,-RZ1235][OH,H,\SR{HO},H,CH_2OH]
> \stopchemical
> 
> \startchemical[height=4500,bottom=2500]
> \chemical [FIVE,FRONT,B,R]
> \chemical [+RZ1..5] [1,2,3,4,5]
> \chemical [-RZ1..5] [a,b,c,d,e]
> \stopchemical
> 
> 
> 
> \stoptext


-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS URA 2464
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.braslau@cea.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: Drawing chemical structures
  2013-11-21 20:11 ` Alan Braslau
@ 2013-11-21 20:55   ` Aditya Mahajan
  2013-11-21 22:28     ` Alan Braslau
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Mahajan @ 2013-11-21 20:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 21 Nov 2013, Alan Braslau wrote:

> (For some reason, unicode \alpha currently disappears - a font issue.
> This worked early so is indeed a bug.)

Unicode alpha gets translated to \greekalpha, so you need a font (like 
dejavu) that includes those glyphs.

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


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

* Re: Drawing chemical structures
  2013-11-21 20:55   ` Aditya Mahajan
@ 2013-11-21 22:28     ` Alan Braslau
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Braslau @ 2013-11-21 22:28 UTC (permalink / raw)
  To: adityam; +Cc: mailing list for ConTeXt users

On Thu, 21 Nov 2013 15:55:09 -0500
Aditya Mahajan <adityam@umich.edu> wrote:

> Unicode alpha gets translated to \greekalpha, so you need a font
> (like dejavu) that includes those glyphs

Yes, thanks for this clarification.
When I tested this earlier, I was indeed using dejavu...
In the chemistry macros, we are using a particular version of
mathematics mode (subscripts, superscripts, ...) but in normal font, so
greek characters, etc. will work if the font includes them.

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] 5+ messages in thread

end of thread, other threads:[~2013-11-21 22:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21 18:10 Drawing chemical structures DesdeChaves
2013-11-21 19:01 ` Alan Braslau
2013-11-21 20:11 ` Alan Braslau
2013-11-21 20:55   ` Aditya Mahajan
2013-11-21 22:28     ` 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).