Can you make chemical structure diagrams in LaTeX?












55















Can you create diagrams of chemical structures in LaTeX?



Example(s) of "chemical structure diagrams":



Example 1



Example 2










share|improve this question




















  • 6





    Yes, take a look at the chemfig package.

    – Werner
    Apr 20 '12 at 18:39






  • 1





    Here's a way to do it completely online: tex.stackexchange.com/questions/238760/…

    – Sparkler
    Jun 13 '15 at 18:21
















55















Can you create diagrams of chemical structures in LaTeX?



Example(s) of "chemical structure diagrams":



Example 1



Example 2










share|improve this question




















  • 6





    Yes, take a look at the chemfig package.

    – Werner
    Apr 20 '12 at 18:39






  • 1





    Here's a way to do it completely online: tex.stackexchange.com/questions/238760/…

    – Sparkler
    Jun 13 '15 at 18:21














55












55








55


28






Can you create diagrams of chemical structures in LaTeX?



Example(s) of "chemical structure diagrams":



Example 1



Example 2










share|improve this question
















Can you create diagrams of chemical structures in LaTeX?



Example(s) of "chemical structure diagrams":



Example 1



Example 2







diagrams chemfig chemistry






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 12 '17 at 5:19









Troy

11.1k62368




11.1k62368










asked Apr 20 '12 at 18:34









rakerake

74931016




74931016








  • 6





    Yes, take a look at the chemfig package.

    – Werner
    Apr 20 '12 at 18:39






  • 1





    Here's a way to do it completely online: tex.stackexchange.com/questions/238760/…

    – Sparkler
    Jun 13 '15 at 18:21














  • 6





    Yes, take a look at the chemfig package.

    – Werner
    Apr 20 '12 at 18:39






  • 1





    Here's a way to do it completely online: tex.stackexchange.com/questions/238760/…

    – Sparkler
    Jun 13 '15 at 18:21








6




6





Yes, take a look at the chemfig package.

– Werner
Apr 20 '12 at 18:39





Yes, take a look at the chemfig package.

– Werner
Apr 20 '12 at 18:39




1




1





Here's a way to do it completely online: tex.stackexchange.com/questions/238760/…

– Sparkler
Jun 13 '15 at 18:21





Here's a way to do it completely online: tex.stackexchange.com/questions/238760/…

– Sparkler
Jun 13 '15 at 18:21










2 Answers
2






active

oldest

votes


















72





+600









The answer is: yes. There is actually more than one package to do that:




  • chemfig

  • ochem

  • streeTeX

  • XyMTeX

  • ConTeXt's PPCHTeX


I have used all but XyMTeX and PPCHTeX myself but nowadays only use chemfig any more.



XyMTeX is in my opinion far from being intuitive so I never bothered learning it. It also is not regularly updated to CTAN and not part of TeX Live. CTAN has v4.06 but the newest version is v5.00.



ochem nearly offers all one needs but 1) is not available from either major free distribution and 2) the work is done by a Perl script that translates formulae and reaction schemes into PostScript, which means it doesn't work with pdflatex.



streeTeX is just too limited in its capabilities besides the fact that it is rather old, is not available from either major free distribution and also doesn't work with pdflatex.



chemfig is a rather new and actively maintained package that not only allows to draw skeletal formulae but also has commands for creating whole reaction schemes. It uses TikZ for the drawing.



PPCHTeX is ConTeXt's chemistry module but it can actually be used with LaTeX, too. I have never used it before and trying to typeset the examples below with it has proven to be more complicated than I thought. That's why I simply copied an example from the conTeXtgarden.



So if you want to draw your formulas and schemes with LaTeX rather than an external program like ChemDraw I can only recommend chemfig.





A chemfig example:



documentclass{article}
usepackage{chemfig}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}}
begin{document}

setcrambond{2pt}{}{}
chemfig{
HO-[2,.5,2]?<[7,.7](-[2,.5]OH)-[,,,,line width=2.4pt](-[6,.5]OH)>[1,.7]
(-[:-65,.7]O-[:65,.7]?[b](-[2,.7]CH_2OH)<[:-60,.707](-[6,.5]OH)
-[,,,,line width=2.4pt](-[2,.5,,2]HO)>[:60,.707](-[6,.5]CH_2OH)-[:162,.9]O?[b])
-[3,.7]O-[4]?(-[2,.3]-[3,.5]HO)}

setatomsep{2em}
chemfig{
H_3C-[:72]{color{blue}N}
*5(-
*6(-(={color{red}O})-{color{blue}N}(-CH_3)-(={color{red}O})-{color{blue}N}(-CH_3)-=)
--{color{blue}N}=-)}

end{document}


chemfig demo



An ochem example:



documentclass{article}
usepackage{ochem}
begin{document}

begin{chemistry}
set("rLenN",20)
formula(L,R)
{
ring(,,H1=)
{
0: bond(r,=C) atom("O") ;
3: atom("N") bond(r) atom("C",C,R) atom("H$_3$",L) ;
4: bond(r,=C) atom("O") ;
5: atom("N") bond(r) atom("CH$_3$",L) ;
vertex(,1,4,H2=,5)
{
1: atom("N") bond(r) atom("C",C,L) atom("H$_3$",R) ;
3: atom("N") ;
} ;
}
}
end{chemistry}

end{document}


ochem demo



A streetex example:



documentclass{article}
usepackage{stree}
begin{document}

sffamily
stree{0[2N[0{CH$_3$}]4[=2O]6N[4{CH$_3$}]8[=6O]10]/10N=75N[/7{H$_3$C}]/2}

end{document}


streetex demo



A XyMTeX example:



documentclass{article}
usepackage{xymtex}
letsubstfontsffamily
begin{document}

sixheterovi[{ffivefusev[d]{1==N;4==N}{1S==CH$_3$}{b}}e]
{2==N;4==N}
{1D==O;3D==O;4S==CH$_3$}

end{document}


XyMTeX demo



A PPCHTeX example



documentclass{article}
usepackage{m-pictex}
usepackage{m-ch-en}% or `m-ch-de' if you like a German interface

begin{document}

startchemical
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]
stopchemical

end{document}


PPCHTeX demo






share|improve this answer


























  • xymtex looks (or looked) good, and the author published a pleasing paper in tugboat. the author even uploaded to ctan ... once. when i came to catalogue it, the home page had moved and the uploaded version had been declared obsolete. the package is no doubt a boon for the author's students, but for those he chooses to keep in the dark, chemfig or one of the others i don't know seems the way to go.

    – wasteofspace
    Nov 25 '12 at 15:02











  • The homepage seems to be homepage3.nifty.com/xymtex/fujitas3/xymtex/indexe.html nowadays. What I dislike most about XyMTeX is its documentation, actually. I find it very hard to deduce which commands are available (and what they do) and what options they have (and what they do). Otherwise it seems to be a very capable and complete bundle.

    – clemens
    Nov 25 '12 at 15:09











  • Totally agree as a 'jobbing' chemist: chemfig is the only one I'd actually use at all for 'real' work (although I personally do use a graphical tool for most of my work).

    – Joseph Wright
    Aug 17 '13 at 19:31



















21














For the purpose of rational comparison,
more and updated information on XyMTeX would be desirable,
because the example shown in the preceding answer has been
drawn by the plain mode of XyMTeX (providing slightly poor
printing quality within the picture enviroment of LaTeX) and
because the comment on the availability of XyMTeX would
provide readers with a misleading impression.



The latest version (Version 5.00a) of XyMTeX is available
from the XyMTeX homepage (http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex/indexe.html



The two structural formulas shown in the question can be
drawn by using the PostScript-compatible mode (as well
as the PDF-compatible mode) of XyMTeX.



(1) Disaccharide



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
begin{document}

changeunitlength{0.08pt}
utrigonal{0==O;2==%
furanose{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};%
2Sa==H;3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}};%
3==pyranose{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}}
hskip4cm
utrigonal{0==O;2==%
fivesugarh{5==O;%
1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};2Sa==H;%
3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}}[abc];%
3==sixsugarh{6==O;1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}[abc]}

end{document}


enter image description here



(2) Caffeine



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
usepackage{graphicx}
%pagestyle{empty}
begin{document}

changeunitlength{0.08pt}
sixheterov[e{efivefusev[d]{1==bluex{N};4==bluex{N}}{1==CH$_{3}$}{b}}]
{1==bluex{N};3==bluex{N}}
{1==CH$_{3}$;3==CH$_{3}$;2D==redx{O};4D==redx{O}}
\ vskip0.5cm
{%
letsubstfont=sffamily
purinev[aj]{3==CH$_{3}$;%
4D==addbscolor{green}{redx{O}};5==CH$_{3}$;%
6D==addbscolor{green}{redx{O}};7==CH$_{3}$}
quad
defgrayx#1{xymcolor{gray}{#1}}
nonaheterov[aj]{1==bluex{N};3==bluex{N};5==bluex{N};7==bluex{N}}%
{3==addbscolor{red}{grayx{CH$_{3}$}};%
4D==addbscolor{green}{redx{O}};5==addbscolor{red}{grayx{CH$_{3}$}};%
6D==addbscolor{green}{redx{O}};7==addbscolor{red}{grayx{CH$_{3}$}}}
}

end{document}


enter image description here



For further information, please see XyMTeX-tips in the XyMTeX homepage
(http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex-tips/indexe.html



The present topic has been deposited as 130208a-ps.pdf, 130208b-ps.pdf etc.



As for a tool for publishing a book on organic chemistry, the combination of
XyMTeX-LaTeX has been used to publish the following book:



S. Fujita, "Organic Chemistry of Photography", Springer-Verlag (2004),



in which all of the structural formulas (among 480 illustrations) have been
drawn by using XyMTeX.






share|improve this answer





















  • 4





    Are you going to upload version 5 of XyMTeX on CTAN?

    – egreg
    Feb 10 '13 at 0:02











  • I am heavily engaged in writing another book on enumeration of organic compounds now (for a previous publication, cf. S. Fujita, "Symmetry and Combinatorial Enumeration in Chemistry", springer.com/chemistry/organic+chemistry/book/978-3-540-54126-4 Springer-Verlage 1991). And so, sorry to say that it is hard to support two WEB pages simultaneously.

    – Fujita
    Feb 10 '13 at 7:22











  • @Fujita If the code is usable, I don't see why it can't go to CTAN: I send stuff there almost every week :-)

    – Joseph Wright
    Feb 10 '13 at 11:10






  • 1





    @fujita: if you upload to ctan, all you need do is provide a short outline of changes (e.g., "this is v5.0, large number of changes since v4.xx"). we (ctan) look after the web page(s) for you, and provide searching tools specific to the subject matter; in short, we try to make life as easy as possible for the uploader. mail ctan@dante.de if you have queries of detail.

    – wasteofspace
    Feb 11 '13 at 10:17






  • 2





    @wasteofspace, Thanks. The deadline of the book I am now writing is the beginning of April. I hope to improve the documentation of XyMTeX after that deadline in order to meet the comment of cgnieder on the documentation. Would you please wait for a while.

    – Fujita
    Feb 11 '13 at 11:57












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f52722%2fcan-you-make-chemical-structure-diagrams-in-latex%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









72





+600









The answer is: yes. There is actually more than one package to do that:




  • chemfig

  • ochem

  • streeTeX

  • XyMTeX

  • ConTeXt's PPCHTeX


I have used all but XyMTeX and PPCHTeX myself but nowadays only use chemfig any more.



XyMTeX is in my opinion far from being intuitive so I never bothered learning it. It also is not regularly updated to CTAN and not part of TeX Live. CTAN has v4.06 but the newest version is v5.00.



ochem nearly offers all one needs but 1) is not available from either major free distribution and 2) the work is done by a Perl script that translates formulae and reaction schemes into PostScript, which means it doesn't work with pdflatex.



streeTeX is just too limited in its capabilities besides the fact that it is rather old, is not available from either major free distribution and also doesn't work with pdflatex.



chemfig is a rather new and actively maintained package that not only allows to draw skeletal formulae but also has commands for creating whole reaction schemes. It uses TikZ for the drawing.



PPCHTeX is ConTeXt's chemistry module but it can actually be used with LaTeX, too. I have never used it before and trying to typeset the examples below with it has proven to be more complicated than I thought. That's why I simply copied an example from the conTeXtgarden.



So if you want to draw your formulas and schemes with LaTeX rather than an external program like ChemDraw I can only recommend chemfig.





A chemfig example:



documentclass{article}
usepackage{chemfig}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}}
begin{document}

setcrambond{2pt}{}{}
chemfig{
HO-[2,.5,2]?<[7,.7](-[2,.5]OH)-[,,,,line width=2.4pt](-[6,.5]OH)>[1,.7]
(-[:-65,.7]O-[:65,.7]?[b](-[2,.7]CH_2OH)<[:-60,.707](-[6,.5]OH)
-[,,,,line width=2.4pt](-[2,.5,,2]HO)>[:60,.707](-[6,.5]CH_2OH)-[:162,.9]O?[b])
-[3,.7]O-[4]?(-[2,.3]-[3,.5]HO)}

setatomsep{2em}
chemfig{
H_3C-[:72]{color{blue}N}
*5(-
*6(-(={color{red}O})-{color{blue}N}(-CH_3)-(={color{red}O})-{color{blue}N}(-CH_3)-=)
--{color{blue}N}=-)}

end{document}


chemfig demo



An ochem example:



documentclass{article}
usepackage{ochem}
begin{document}

begin{chemistry}
set("rLenN",20)
formula(L,R)
{
ring(,,H1=)
{
0: bond(r,=C) atom("O") ;
3: atom("N") bond(r) atom("C",C,R) atom("H$_3$",L) ;
4: bond(r,=C) atom("O") ;
5: atom("N") bond(r) atom("CH$_3$",L) ;
vertex(,1,4,H2=,5)
{
1: atom("N") bond(r) atom("C",C,L) atom("H$_3$",R) ;
3: atom("N") ;
} ;
}
}
end{chemistry}

end{document}


ochem demo



A streetex example:



documentclass{article}
usepackage{stree}
begin{document}

sffamily
stree{0[2N[0{CH$_3$}]4[=2O]6N[4{CH$_3$}]8[=6O]10]/10N=75N[/7{H$_3$C}]/2}

end{document}


streetex demo



A XyMTeX example:



documentclass{article}
usepackage{xymtex}
letsubstfontsffamily
begin{document}

sixheterovi[{ffivefusev[d]{1==N;4==N}{1S==CH$_3$}{b}}e]
{2==N;4==N}
{1D==O;3D==O;4S==CH$_3$}

end{document}


XyMTeX demo



A PPCHTeX example



documentclass{article}
usepackage{m-pictex}
usepackage{m-ch-en}% or `m-ch-de' if you like a German interface

begin{document}

startchemical
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]
stopchemical

end{document}


PPCHTeX demo






share|improve this answer


























  • xymtex looks (or looked) good, and the author published a pleasing paper in tugboat. the author even uploaded to ctan ... once. when i came to catalogue it, the home page had moved and the uploaded version had been declared obsolete. the package is no doubt a boon for the author's students, but for those he chooses to keep in the dark, chemfig or one of the others i don't know seems the way to go.

    – wasteofspace
    Nov 25 '12 at 15:02











  • The homepage seems to be homepage3.nifty.com/xymtex/fujitas3/xymtex/indexe.html nowadays. What I dislike most about XyMTeX is its documentation, actually. I find it very hard to deduce which commands are available (and what they do) and what options they have (and what they do). Otherwise it seems to be a very capable and complete bundle.

    – clemens
    Nov 25 '12 at 15:09











  • Totally agree as a 'jobbing' chemist: chemfig is the only one I'd actually use at all for 'real' work (although I personally do use a graphical tool for most of my work).

    – Joseph Wright
    Aug 17 '13 at 19:31
















72





+600









The answer is: yes. There is actually more than one package to do that:




  • chemfig

  • ochem

  • streeTeX

  • XyMTeX

  • ConTeXt's PPCHTeX


I have used all but XyMTeX and PPCHTeX myself but nowadays only use chemfig any more.



XyMTeX is in my opinion far from being intuitive so I never bothered learning it. It also is not regularly updated to CTAN and not part of TeX Live. CTAN has v4.06 but the newest version is v5.00.



ochem nearly offers all one needs but 1) is not available from either major free distribution and 2) the work is done by a Perl script that translates formulae and reaction schemes into PostScript, which means it doesn't work with pdflatex.



streeTeX is just too limited in its capabilities besides the fact that it is rather old, is not available from either major free distribution and also doesn't work with pdflatex.



chemfig is a rather new and actively maintained package that not only allows to draw skeletal formulae but also has commands for creating whole reaction schemes. It uses TikZ for the drawing.



PPCHTeX is ConTeXt's chemistry module but it can actually be used with LaTeX, too. I have never used it before and trying to typeset the examples below with it has proven to be more complicated than I thought. That's why I simply copied an example from the conTeXtgarden.



So if you want to draw your formulas and schemes with LaTeX rather than an external program like ChemDraw I can only recommend chemfig.





A chemfig example:



documentclass{article}
usepackage{chemfig}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}}
begin{document}

setcrambond{2pt}{}{}
chemfig{
HO-[2,.5,2]?<[7,.7](-[2,.5]OH)-[,,,,line width=2.4pt](-[6,.5]OH)>[1,.7]
(-[:-65,.7]O-[:65,.7]?[b](-[2,.7]CH_2OH)<[:-60,.707](-[6,.5]OH)
-[,,,,line width=2.4pt](-[2,.5,,2]HO)>[:60,.707](-[6,.5]CH_2OH)-[:162,.9]O?[b])
-[3,.7]O-[4]?(-[2,.3]-[3,.5]HO)}

setatomsep{2em}
chemfig{
H_3C-[:72]{color{blue}N}
*5(-
*6(-(={color{red}O})-{color{blue}N}(-CH_3)-(={color{red}O})-{color{blue}N}(-CH_3)-=)
--{color{blue}N}=-)}

end{document}


chemfig demo



An ochem example:



documentclass{article}
usepackage{ochem}
begin{document}

begin{chemistry}
set("rLenN",20)
formula(L,R)
{
ring(,,H1=)
{
0: bond(r,=C) atom("O") ;
3: atom("N") bond(r) atom("C",C,R) atom("H$_3$",L) ;
4: bond(r,=C) atom("O") ;
5: atom("N") bond(r) atom("CH$_3$",L) ;
vertex(,1,4,H2=,5)
{
1: atom("N") bond(r) atom("C",C,L) atom("H$_3$",R) ;
3: atom("N") ;
} ;
}
}
end{chemistry}

end{document}


ochem demo



A streetex example:



documentclass{article}
usepackage{stree}
begin{document}

sffamily
stree{0[2N[0{CH$_3$}]4[=2O]6N[4{CH$_3$}]8[=6O]10]/10N=75N[/7{H$_3$C}]/2}

end{document}


streetex demo



A XyMTeX example:



documentclass{article}
usepackage{xymtex}
letsubstfontsffamily
begin{document}

sixheterovi[{ffivefusev[d]{1==N;4==N}{1S==CH$_3$}{b}}e]
{2==N;4==N}
{1D==O;3D==O;4S==CH$_3$}

end{document}


XyMTeX demo



A PPCHTeX example



documentclass{article}
usepackage{m-pictex}
usepackage{m-ch-en}% or `m-ch-de' if you like a German interface

begin{document}

startchemical
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]
stopchemical

end{document}


PPCHTeX demo






share|improve this answer


























  • xymtex looks (or looked) good, and the author published a pleasing paper in tugboat. the author even uploaded to ctan ... once. when i came to catalogue it, the home page had moved and the uploaded version had been declared obsolete. the package is no doubt a boon for the author's students, but for those he chooses to keep in the dark, chemfig or one of the others i don't know seems the way to go.

    – wasteofspace
    Nov 25 '12 at 15:02











  • The homepage seems to be homepage3.nifty.com/xymtex/fujitas3/xymtex/indexe.html nowadays. What I dislike most about XyMTeX is its documentation, actually. I find it very hard to deduce which commands are available (and what they do) and what options they have (and what they do). Otherwise it seems to be a very capable and complete bundle.

    – clemens
    Nov 25 '12 at 15:09











  • Totally agree as a 'jobbing' chemist: chemfig is the only one I'd actually use at all for 'real' work (although I personally do use a graphical tool for most of my work).

    – Joseph Wright
    Aug 17 '13 at 19:31














72





+600







72





+600



72




+600





The answer is: yes. There is actually more than one package to do that:




  • chemfig

  • ochem

  • streeTeX

  • XyMTeX

  • ConTeXt's PPCHTeX


I have used all but XyMTeX and PPCHTeX myself but nowadays only use chemfig any more.



XyMTeX is in my opinion far from being intuitive so I never bothered learning it. It also is not regularly updated to CTAN and not part of TeX Live. CTAN has v4.06 but the newest version is v5.00.



ochem nearly offers all one needs but 1) is not available from either major free distribution and 2) the work is done by a Perl script that translates formulae and reaction schemes into PostScript, which means it doesn't work with pdflatex.



streeTeX is just too limited in its capabilities besides the fact that it is rather old, is not available from either major free distribution and also doesn't work with pdflatex.



chemfig is a rather new and actively maintained package that not only allows to draw skeletal formulae but also has commands for creating whole reaction schemes. It uses TikZ for the drawing.



PPCHTeX is ConTeXt's chemistry module but it can actually be used with LaTeX, too. I have never used it before and trying to typeset the examples below with it has proven to be more complicated than I thought. That's why I simply copied an example from the conTeXtgarden.



So if you want to draw your formulas and schemes with LaTeX rather than an external program like ChemDraw I can only recommend chemfig.





A chemfig example:



documentclass{article}
usepackage{chemfig}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}}
begin{document}

setcrambond{2pt}{}{}
chemfig{
HO-[2,.5,2]?<[7,.7](-[2,.5]OH)-[,,,,line width=2.4pt](-[6,.5]OH)>[1,.7]
(-[:-65,.7]O-[:65,.7]?[b](-[2,.7]CH_2OH)<[:-60,.707](-[6,.5]OH)
-[,,,,line width=2.4pt](-[2,.5,,2]HO)>[:60,.707](-[6,.5]CH_2OH)-[:162,.9]O?[b])
-[3,.7]O-[4]?(-[2,.3]-[3,.5]HO)}

setatomsep{2em}
chemfig{
H_3C-[:72]{color{blue}N}
*5(-
*6(-(={color{red}O})-{color{blue}N}(-CH_3)-(={color{red}O})-{color{blue}N}(-CH_3)-=)
--{color{blue}N}=-)}

end{document}


chemfig demo



An ochem example:



documentclass{article}
usepackage{ochem}
begin{document}

begin{chemistry}
set("rLenN",20)
formula(L,R)
{
ring(,,H1=)
{
0: bond(r,=C) atom("O") ;
3: atom("N") bond(r) atom("C",C,R) atom("H$_3$",L) ;
4: bond(r,=C) atom("O") ;
5: atom("N") bond(r) atom("CH$_3$",L) ;
vertex(,1,4,H2=,5)
{
1: atom("N") bond(r) atom("C",C,L) atom("H$_3$",R) ;
3: atom("N") ;
} ;
}
}
end{chemistry}

end{document}


ochem demo



A streetex example:



documentclass{article}
usepackage{stree}
begin{document}

sffamily
stree{0[2N[0{CH$_3$}]4[=2O]6N[4{CH$_3$}]8[=6O]10]/10N=75N[/7{H$_3$C}]/2}

end{document}


streetex demo



A XyMTeX example:



documentclass{article}
usepackage{xymtex}
letsubstfontsffamily
begin{document}

sixheterovi[{ffivefusev[d]{1==N;4==N}{1S==CH$_3$}{b}}e]
{2==N;4==N}
{1D==O;3D==O;4S==CH$_3$}

end{document}


XyMTeX demo



A PPCHTeX example



documentclass{article}
usepackage{m-pictex}
usepackage{m-ch-en}% or `m-ch-de' if you like a German interface

begin{document}

startchemical
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]
stopchemical

end{document}


PPCHTeX demo






share|improve this answer















The answer is: yes. There is actually more than one package to do that:




  • chemfig

  • ochem

  • streeTeX

  • XyMTeX

  • ConTeXt's PPCHTeX


I have used all but XyMTeX and PPCHTeX myself but nowadays only use chemfig any more.



XyMTeX is in my opinion far from being intuitive so I never bothered learning it. It also is not regularly updated to CTAN and not part of TeX Live. CTAN has v4.06 but the newest version is v5.00.



ochem nearly offers all one needs but 1) is not available from either major free distribution and 2) the work is done by a Perl script that translates formulae and reaction schemes into PostScript, which means it doesn't work with pdflatex.



streeTeX is just too limited in its capabilities besides the fact that it is rather old, is not available from either major free distribution and also doesn't work with pdflatex.



chemfig is a rather new and actively maintained package that not only allows to draw skeletal formulae but also has commands for creating whole reaction schemes. It uses TikZ for the drawing.



PPCHTeX is ConTeXt's chemistry module but it can actually be used with LaTeX, too. I have never used it before and trying to typeset the examples below with it has proven to be more complicated than I thought. That's why I simply copied an example from the conTeXtgarden.



So if you want to draw your formulas and schemes with LaTeX rather than an external program like ChemDraw I can only recommend chemfig.





A chemfig example:



documentclass{article}
usepackage{chemfig}
renewcommand*printatom[1]{ensuremath{mathsf{#1}}}
begin{document}

setcrambond{2pt}{}{}
chemfig{
HO-[2,.5,2]?<[7,.7](-[2,.5]OH)-[,,,,line width=2.4pt](-[6,.5]OH)>[1,.7]
(-[:-65,.7]O-[:65,.7]?[b](-[2,.7]CH_2OH)<[:-60,.707](-[6,.5]OH)
-[,,,,line width=2.4pt](-[2,.5,,2]HO)>[:60,.707](-[6,.5]CH_2OH)-[:162,.9]O?[b])
-[3,.7]O-[4]?(-[2,.3]-[3,.5]HO)}

setatomsep{2em}
chemfig{
H_3C-[:72]{color{blue}N}
*5(-
*6(-(={color{red}O})-{color{blue}N}(-CH_3)-(={color{red}O})-{color{blue}N}(-CH_3)-=)
--{color{blue}N}=-)}

end{document}


chemfig demo



An ochem example:



documentclass{article}
usepackage{ochem}
begin{document}

begin{chemistry}
set("rLenN",20)
formula(L,R)
{
ring(,,H1=)
{
0: bond(r,=C) atom("O") ;
3: atom("N") bond(r) atom("C",C,R) atom("H$_3$",L) ;
4: bond(r,=C) atom("O") ;
5: atom("N") bond(r) atom("CH$_3$",L) ;
vertex(,1,4,H2=,5)
{
1: atom("N") bond(r) atom("C",C,L) atom("H$_3$",R) ;
3: atom("N") ;
} ;
}
}
end{chemistry}

end{document}


ochem demo



A streetex example:



documentclass{article}
usepackage{stree}
begin{document}

sffamily
stree{0[2N[0{CH$_3$}]4[=2O]6N[4{CH$_3$}]8[=6O]10]/10N=75N[/7{H$_3$C}]/2}

end{document}


streetex demo



A XyMTeX example:



documentclass{article}
usepackage{xymtex}
letsubstfontsffamily
begin{document}

sixheterovi[{ffivefusev[d]{1==N;4==N}{1S==CH$_3$}{b}}e]
{2==N;4==N}
{1D==O;3D==O;4S==CH$_3$}

end{document}


XyMTeX demo



A PPCHTeX example



documentclass{article}
usepackage{m-pictex}
usepackage{m-ch-en}% or `m-ch-de' if you like a German interface

begin{document}

startchemical
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]
stopchemical

end{document}


PPCHTeX demo







share|improve this answer














share|improve this answer



share|improve this answer








edited Jun 12 '15 at 7:09

























answered Apr 27 '12 at 13:44









clemensclemens

51.7k5131283




51.7k5131283













  • xymtex looks (or looked) good, and the author published a pleasing paper in tugboat. the author even uploaded to ctan ... once. when i came to catalogue it, the home page had moved and the uploaded version had been declared obsolete. the package is no doubt a boon for the author's students, but for those he chooses to keep in the dark, chemfig or one of the others i don't know seems the way to go.

    – wasteofspace
    Nov 25 '12 at 15:02











  • The homepage seems to be homepage3.nifty.com/xymtex/fujitas3/xymtex/indexe.html nowadays. What I dislike most about XyMTeX is its documentation, actually. I find it very hard to deduce which commands are available (and what they do) and what options they have (and what they do). Otherwise it seems to be a very capable and complete bundle.

    – clemens
    Nov 25 '12 at 15:09











  • Totally agree as a 'jobbing' chemist: chemfig is the only one I'd actually use at all for 'real' work (although I personally do use a graphical tool for most of my work).

    – Joseph Wright
    Aug 17 '13 at 19:31



















  • xymtex looks (or looked) good, and the author published a pleasing paper in tugboat. the author even uploaded to ctan ... once. when i came to catalogue it, the home page had moved and the uploaded version had been declared obsolete. the package is no doubt a boon for the author's students, but for those he chooses to keep in the dark, chemfig or one of the others i don't know seems the way to go.

    – wasteofspace
    Nov 25 '12 at 15:02











  • The homepage seems to be homepage3.nifty.com/xymtex/fujitas3/xymtex/indexe.html nowadays. What I dislike most about XyMTeX is its documentation, actually. I find it very hard to deduce which commands are available (and what they do) and what options they have (and what they do). Otherwise it seems to be a very capable and complete bundle.

    – clemens
    Nov 25 '12 at 15:09











  • Totally agree as a 'jobbing' chemist: chemfig is the only one I'd actually use at all for 'real' work (although I personally do use a graphical tool for most of my work).

    – Joseph Wright
    Aug 17 '13 at 19:31

















xymtex looks (or looked) good, and the author published a pleasing paper in tugboat. the author even uploaded to ctan ... once. when i came to catalogue it, the home page had moved and the uploaded version had been declared obsolete. the package is no doubt a boon for the author's students, but for those he chooses to keep in the dark, chemfig or one of the others i don't know seems the way to go.

– wasteofspace
Nov 25 '12 at 15:02





xymtex looks (or looked) good, and the author published a pleasing paper in tugboat. the author even uploaded to ctan ... once. when i came to catalogue it, the home page had moved and the uploaded version had been declared obsolete. the package is no doubt a boon for the author's students, but for those he chooses to keep in the dark, chemfig or one of the others i don't know seems the way to go.

– wasteofspace
Nov 25 '12 at 15:02













The homepage seems to be homepage3.nifty.com/xymtex/fujitas3/xymtex/indexe.html nowadays. What I dislike most about XyMTeX is its documentation, actually. I find it very hard to deduce which commands are available (and what they do) and what options they have (and what they do). Otherwise it seems to be a very capable and complete bundle.

– clemens
Nov 25 '12 at 15:09





The homepage seems to be homepage3.nifty.com/xymtex/fujitas3/xymtex/indexe.html nowadays. What I dislike most about XyMTeX is its documentation, actually. I find it very hard to deduce which commands are available (and what they do) and what options they have (and what they do). Otherwise it seems to be a very capable and complete bundle.

– clemens
Nov 25 '12 at 15:09













Totally agree as a 'jobbing' chemist: chemfig is the only one I'd actually use at all for 'real' work (although I personally do use a graphical tool for most of my work).

– Joseph Wright
Aug 17 '13 at 19:31





Totally agree as a 'jobbing' chemist: chemfig is the only one I'd actually use at all for 'real' work (although I personally do use a graphical tool for most of my work).

– Joseph Wright
Aug 17 '13 at 19:31











21














For the purpose of rational comparison,
more and updated information on XyMTeX would be desirable,
because the example shown in the preceding answer has been
drawn by the plain mode of XyMTeX (providing slightly poor
printing quality within the picture enviroment of LaTeX) and
because the comment on the availability of XyMTeX would
provide readers with a misleading impression.



The latest version (Version 5.00a) of XyMTeX is available
from the XyMTeX homepage (http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex/indexe.html



The two structural formulas shown in the question can be
drawn by using the PostScript-compatible mode (as well
as the PDF-compatible mode) of XyMTeX.



(1) Disaccharide



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
begin{document}

changeunitlength{0.08pt}
utrigonal{0==O;2==%
furanose{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};%
2Sa==H;3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}};%
3==pyranose{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}}
hskip4cm
utrigonal{0==O;2==%
fivesugarh{5==O;%
1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};2Sa==H;%
3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}}[abc];%
3==sixsugarh{6==O;1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}[abc]}

end{document}


enter image description here



(2) Caffeine



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
usepackage{graphicx}
%pagestyle{empty}
begin{document}

changeunitlength{0.08pt}
sixheterov[e{efivefusev[d]{1==bluex{N};4==bluex{N}}{1==CH$_{3}$}{b}}]
{1==bluex{N};3==bluex{N}}
{1==CH$_{3}$;3==CH$_{3}$;2D==redx{O};4D==redx{O}}
\ vskip0.5cm
{%
letsubstfont=sffamily
purinev[aj]{3==CH$_{3}$;%
4D==addbscolor{green}{redx{O}};5==CH$_{3}$;%
6D==addbscolor{green}{redx{O}};7==CH$_{3}$}
quad
defgrayx#1{xymcolor{gray}{#1}}
nonaheterov[aj]{1==bluex{N};3==bluex{N};5==bluex{N};7==bluex{N}}%
{3==addbscolor{red}{grayx{CH$_{3}$}};%
4D==addbscolor{green}{redx{O}};5==addbscolor{red}{grayx{CH$_{3}$}};%
6D==addbscolor{green}{redx{O}};7==addbscolor{red}{grayx{CH$_{3}$}}}
}

end{document}


enter image description here



For further information, please see XyMTeX-tips in the XyMTeX homepage
(http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex-tips/indexe.html



The present topic has been deposited as 130208a-ps.pdf, 130208b-ps.pdf etc.



As for a tool for publishing a book on organic chemistry, the combination of
XyMTeX-LaTeX has been used to publish the following book:



S. Fujita, "Organic Chemistry of Photography", Springer-Verlag (2004),



in which all of the structural formulas (among 480 illustrations) have been
drawn by using XyMTeX.






share|improve this answer





















  • 4





    Are you going to upload version 5 of XyMTeX on CTAN?

    – egreg
    Feb 10 '13 at 0:02











  • I am heavily engaged in writing another book on enumeration of organic compounds now (for a previous publication, cf. S. Fujita, "Symmetry and Combinatorial Enumeration in Chemistry", springer.com/chemistry/organic+chemistry/book/978-3-540-54126-4 Springer-Verlage 1991). And so, sorry to say that it is hard to support two WEB pages simultaneously.

    – Fujita
    Feb 10 '13 at 7:22











  • @Fujita If the code is usable, I don't see why it can't go to CTAN: I send stuff there almost every week :-)

    – Joseph Wright
    Feb 10 '13 at 11:10






  • 1





    @fujita: if you upload to ctan, all you need do is provide a short outline of changes (e.g., "this is v5.0, large number of changes since v4.xx"). we (ctan) look after the web page(s) for you, and provide searching tools specific to the subject matter; in short, we try to make life as easy as possible for the uploader. mail ctan@dante.de if you have queries of detail.

    – wasteofspace
    Feb 11 '13 at 10:17






  • 2





    @wasteofspace, Thanks. The deadline of the book I am now writing is the beginning of April. I hope to improve the documentation of XyMTeX after that deadline in order to meet the comment of cgnieder on the documentation. Would you please wait for a while.

    – Fujita
    Feb 11 '13 at 11:57
















21














For the purpose of rational comparison,
more and updated information on XyMTeX would be desirable,
because the example shown in the preceding answer has been
drawn by the plain mode of XyMTeX (providing slightly poor
printing quality within the picture enviroment of LaTeX) and
because the comment on the availability of XyMTeX would
provide readers with a misleading impression.



The latest version (Version 5.00a) of XyMTeX is available
from the XyMTeX homepage (http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex/indexe.html



The two structural formulas shown in the question can be
drawn by using the PostScript-compatible mode (as well
as the PDF-compatible mode) of XyMTeX.



(1) Disaccharide



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
begin{document}

changeunitlength{0.08pt}
utrigonal{0==O;2==%
furanose{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};%
2Sa==H;3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}};%
3==pyranose{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}}
hskip4cm
utrigonal{0==O;2==%
fivesugarh{5==O;%
1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};2Sa==H;%
3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}}[abc];%
3==sixsugarh{6==O;1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}[abc]}

end{document}


enter image description here



(2) Caffeine



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
usepackage{graphicx}
%pagestyle{empty}
begin{document}

changeunitlength{0.08pt}
sixheterov[e{efivefusev[d]{1==bluex{N};4==bluex{N}}{1==CH$_{3}$}{b}}]
{1==bluex{N};3==bluex{N}}
{1==CH$_{3}$;3==CH$_{3}$;2D==redx{O};4D==redx{O}}
\ vskip0.5cm
{%
letsubstfont=sffamily
purinev[aj]{3==CH$_{3}$;%
4D==addbscolor{green}{redx{O}};5==CH$_{3}$;%
6D==addbscolor{green}{redx{O}};7==CH$_{3}$}
quad
defgrayx#1{xymcolor{gray}{#1}}
nonaheterov[aj]{1==bluex{N};3==bluex{N};5==bluex{N};7==bluex{N}}%
{3==addbscolor{red}{grayx{CH$_{3}$}};%
4D==addbscolor{green}{redx{O}};5==addbscolor{red}{grayx{CH$_{3}$}};%
6D==addbscolor{green}{redx{O}};7==addbscolor{red}{grayx{CH$_{3}$}}}
}

end{document}


enter image description here



For further information, please see XyMTeX-tips in the XyMTeX homepage
(http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex-tips/indexe.html



The present topic has been deposited as 130208a-ps.pdf, 130208b-ps.pdf etc.



As for a tool for publishing a book on organic chemistry, the combination of
XyMTeX-LaTeX has been used to publish the following book:



S. Fujita, "Organic Chemistry of Photography", Springer-Verlag (2004),



in which all of the structural formulas (among 480 illustrations) have been
drawn by using XyMTeX.






share|improve this answer





















  • 4





    Are you going to upload version 5 of XyMTeX on CTAN?

    – egreg
    Feb 10 '13 at 0:02











  • I am heavily engaged in writing another book on enumeration of organic compounds now (for a previous publication, cf. S. Fujita, "Symmetry and Combinatorial Enumeration in Chemistry", springer.com/chemistry/organic+chemistry/book/978-3-540-54126-4 Springer-Verlage 1991). And so, sorry to say that it is hard to support two WEB pages simultaneously.

    – Fujita
    Feb 10 '13 at 7:22











  • @Fujita If the code is usable, I don't see why it can't go to CTAN: I send stuff there almost every week :-)

    – Joseph Wright
    Feb 10 '13 at 11:10






  • 1





    @fujita: if you upload to ctan, all you need do is provide a short outline of changes (e.g., "this is v5.0, large number of changes since v4.xx"). we (ctan) look after the web page(s) for you, and provide searching tools specific to the subject matter; in short, we try to make life as easy as possible for the uploader. mail ctan@dante.de if you have queries of detail.

    – wasteofspace
    Feb 11 '13 at 10:17






  • 2





    @wasteofspace, Thanks. The deadline of the book I am now writing is the beginning of April. I hope to improve the documentation of XyMTeX after that deadline in order to meet the comment of cgnieder on the documentation. Would you please wait for a while.

    – Fujita
    Feb 11 '13 at 11:57














21












21








21







For the purpose of rational comparison,
more and updated information on XyMTeX would be desirable,
because the example shown in the preceding answer has been
drawn by the plain mode of XyMTeX (providing slightly poor
printing quality within the picture enviroment of LaTeX) and
because the comment on the availability of XyMTeX would
provide readers with a misleading impression.



The latest version (Version 5.00a) of XyMTeX is available
from the XyMTeX homepage (http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex/indexe.html



The two structural formulas shown in the question can be
drawn by using the PostScript-compatible mode (as well
as the PDF-compatible mode) of XyMTeX.



(1) Disaccharide



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
begin{document}

changeunitlength{0.08pt}
utrigonal{0==O;2==%
furanose{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};%
2Sa==H;3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}};%
3==pyranose{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}}
hskip4cm
utrigonal{0==O;2==%
fivesugarh{5==O;%
1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};2Sa==H;%
3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}}[abc];%
3==sixsugarh{6==O;1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}[abc]}

end{document}


enter image description here



(2) Caffeine



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
usepackage{graphicx}
%pagestyle{empty}
begin{document}

changeunitlength{0.08pt}
sixheterov[e{efivefusev[d]{1==bluex{N};4==bluex{N}}{1==CH$_{3}$}{b}}]
{1==bluex{N};3==bluex{N}}
{1==CH$_{3}$;3==CH$_{3}$;2D==redx{O};4D==redx{O}}
\ vskip0.5cm
{%
letsubstfont=sffamily
purinev[aj]{3==CH$_{3}$;%
4D==addbscolor{green}{redx{O}};5==CH$_{3}$;%
6D==addbscolor{green}{redx{O}};7==CH$_{3}$}
quad
defgrayx#1{xymcolor{gray}{#1}}
nonaheterov[aj]{1==bluex{N};3==bluex{N};5==bluex{N};7==bluex{N}}%
{3==addbscolor{red}{grayx{CH$_{3}$}};%
4D==addbscolor{green}{redx{O}};5==addbscolor{red}{grayx{CH$_{3}$}};%
6D==addbscolor{green}{redx{O}};7==addbscolor{red}{grayx{CH$_{3}$}}}
}

end{document}


enter image description here



For further information, please see XyMTeX-tips in the XyMTeX homepage
(http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex-tips/indexe.html



The present topic has been deposited as 130208a-ps.pdf, 130208b-ps.pdf etc.



As for a tool for publishing a book on organic chemistry, the combination of
XyMTeX-LaTeX has been used to publish the following book:



S. Fujita, "Organic Chemistry of Photography", Springer-Verlag (2004),



in which all of the structural formulas (among 480 illustrations) have been
drawn by using XyMTeX.






share|improve this answer















For the purpose of rational comparison,
more and updated information on XyMTeX would be desirable,
because the example shown in the preceding answer has been
drawn by the plain mode of XyMTeX (providing slightly poor
printing quality within the picture enviroment of LaTeX) and
because the comment on the availability of XyMTeX would
provide readers with a misleading impression.



The latest version (Version 5.00a) of XyMTeX is available
from the XyMTeX homepage (http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex/indexe.html



The two structural formulas shown in the question can be
drawn by using the PostScript-compatible mode (as well
as the PDF-compatible mode) of XyMTeX.



(1) Disaccharide



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
begin{document}

changeunitlength{0.08pt}
utrigonal{0==O;2==%
furanose{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};%
2Sa==H;3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}};%
3==pyranose{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}}
hskip4cm
utrigonal{0==O;2==%
fivesugarh{5==O;%
1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{4==(yl);1Sa==CH$_{2}$OH;2Sb==lmoiety{HO};2Sa==H;%
3Sb==H;3Sa==OH;4Sb==HOCrlap{H$_{2}$}}[abc];%
3==sixsugarh{6==O;1s==WedgeAsSubst(0,0)(-3,-5){120};%
4s==WedgeAsSubst(0,0)(3,-5){120};%
3s==PutBondLine(-15,0)(305,0){3.2pt}%
}{1==(yl);2Sa==OH;3Sb==OH;4Sa==HO;5Sb==CH$_{2}$OH}[abc]}

end{document}


enter image description here



(2) Caffeine



documentclass{article}
usepackage{xymtexps}%PostScript Mode
%usepackage{xymtexpdf}%PDF Mode
usepackage{graphicx}
%pagestyle{empty}
begin{document}

changeunitlength{0.08pt}
sixheterov[e{efivefusev[d]{1==bluex{N};4==bluex{N}}{1==CH$_{3}$}{b}}]
{1==bluex{N};3==bluex{N}}
{1==CH$_{3}$;3==CH$_{3}$;2D==redx{O};4D==redx{O}}
\ vskip0.5cm
{%
letsubstfont=sffamily
purinev[aj]{3==CH$_{3}$;%
4D==addbscolor{green}{redx{O}};5==CH$_{3}$;%
6D==addbscolor{green}{redx{O}};7==CH$_{3}$}
quad
defgrayx#1{xymcolor{gray}{#1}}
nonaheterov[aj]{1==bluex{N};3==bluex{N};5==bluex{N};7==bluex{N}}%
{3==addbscolor{red}{grayx{CH$_{3}$}};%
4D==addbscolor{green}{redx{O}};5==addbscolor{red}{grayx{CH$_{3}$}};%
6D==addbscolor{green}{redx{O}};7==addbscolor{red}{grayx{CH$_{3}$}}}
}

end{document}


enter image description here



For further information, please see XyMTeX-tips in the XyMTeX homepage
(http://xymtex.com/):



http://xymtex.com/fujitas3/xymtex-tips/indexe.html



The present topic has been deposited as 130208a-ps.pdf, 130208b-ps.pdf etc.



As for a tool for publishing a book on organic chemistry, the combination of
XyMTeX-LaTeX has been used to publish the following book:



S. Fujita, "Organic Chemistry of Photography", Springer-Verlag (2004),



in which all of the structural formulas (among 480 illustrations) have been
drawn by using XyMTeX.







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 11 '13 at 1:06

























answered Feb 9 '13 at 23:58









FujitaFujita

33124




33124








  • 4





    Are you going to upload version 5 of XyMTeX on CTAN?

    – egreg
    Feb 10 '13 at 0:02











  • I am heavily engaged in writing another book on enumeration of organic compounds now (for a previous publication, cf. S. Fujita, "Symmetry and Combinatorial Enumeration in Chemistry", springer.com/chemistry/organic+chemistry/book/978-3-540-54126-4 Springer-Verlage 1991). And so, sorry to say that it is hard to support two WEB pages simultaneously.

    – Fujita
    Feb 10 '13 at 7:22











  • @Fujita If the code is usable, I don't see why it can't go to CTAN: I send stuff there almost every week :-)

    – Joseph Wright
    Feb 10 '13 at 11:10






  • 1





    @fujita: if you upload to ctan, all you need do is provide a short outline of changes (e.g., "this is v5.0, large number of changes since v4.xx"). we (ctan) look after the web page(s) for you, and provide searching tools specific to the subject matter; in short, we try to make life as easy as possible for the uploader. mail ctan@dante.de if you have queries of detail.

    – wasteofspace
    Feb 11 '13 at 10:17






  • 2





    @wasteofspace, Thanks. The deadline of the book I am now writing is the beginning of April. I hope to improve the documentation of XyMTeX after that deadline in order to meet the comment of cgnieder on the documentation. Would you please wait for a while.

    – Fujita
    Feb 11 '13 at 11:57














  • 4





    Are you going to upload version 5 of XyMTeX on CTAN?

    – egreg
    Feb 10 '13 at 0:02











  • I am heavily engaged in writing another book on enumeration of organic compounds now (for a previous publication, cf. S. Fujita, "Symmetry and Combinatorial Enumeration in Chemistry", springer.com/chemistry/organic+chemistry/book/978-3-540-54126-4 Springer-Verlage 1991). And so, sorry to say that it is hard to support two WEB pages simultaneously.

    – Fujita
    Feb 10 '13 at 7:22











  • @Fujita If the code is usable, I don't see why it can't go to CTAN: I send stuff there almost every week :-)

    – Joseph Wright
    Feb 10 '13 at 11:10






  • 1





    @fujita: if you upload to ctan, all you need do is provide a short outline of changes (e.g., "this is v5.0, large number of changes since v4.xx"). we (ctan) look after the web page(s) for you, and provide searching tools specific to the subject matter; in short, we try to make life as easy as possible for the uploader. mail ctan@dante.de if you have queries of detail.

    – wasteofspace
    Feb 11 '13 at 10:17






  • 2





    @wasteofspace, Thanks. The deadline of the book I am now writing is the beginning of April. I hope to improve the documentation of XyMTeX after that deadline in order to meet the comment of cgnieder on the documentation. Would you please wait for a while.

    – Fujita
    Feb 11 '13 at 11:57








4




4





Are you going to upload version 5 of XyMTeX on CTAN?

– egreg
Feb 10 '13 at 0:02





Are you going to upload version 5 of XyMTeX on CTAN?

– egreg
Feb 10 '13 at 0:02













I am heavily engaged in writing another book on enumeration of organic compounds now (for a previous publication, cf. S. Fujita, "Symmetry and Combinatorial Enumeration in Chemistry", springer.com/chemistry/organic+chemistry/book/978-3-540-54126-4 Springer-Verlage 1991). And so, sorry to say that it is hard to support two WEB pages simultaneously.

– Fujita
Feb 10 '13 at 7:22





I am heavily engaged in writing another book on enumeration of organic compounds now (for a previous publication, cf. S. Fujita, "Symmetry and Combinatorial Enumeration in Chemistry", springer.com/chemistry/organic+chemistry/book/978-3-540-54126-4 Springer-Verlage 1991). And so, sorry to say that it is hard to support two WEB pages simultaneously.

– Fujita
Feb 10 '13 at 7:22













@Fujita If the code is usable, I don't see why it can't go to CTAN: I send stuff there almost every week :-)

– Joseph Wright
Feb 10 '13 at 11:10





@Fujita If the code is usable, I don't see why it can't go to CTAN: I send stuff there almost every week :-)

– Joseph Wright
Feb 10 '13 at 11:10




1




1





@fujita: if you upload to ctan, all you need do is provide a short outline of changes (e.g., "this is v5.0, large number of changes since v4.xx"). we (ctan) look after the web page(s) for you, and provide searching tools specific to the subject matter; in short, we try to make life as easy as possible for the uploader. mail ctan@dante.de if you have queries of detail.

– wasteofspace
Feb 11 '13 at 10:17





@fujita: if you upload to ctan, all you need do is provide a short outline of changes (e.g., "this is v5.0, large number of changes since v4.xx"). we (ctan) look after the web page(s) for you, and provide searching tools specific to the subject matter; in short, we try to make life as easy as possible for the uploader. mail ctan@dante.de if you have queries of detail.

– wasteofspace
Feb 11 '13 at 10:17




2




2





@wasteofspace, Thanks. The deadline of the book I am now writing is the beginning of April. I hope to improve the documentation of XyMTeX after that deadline in order to meet the comment of cgnieder on the documentation. Would you please wait for a while.

– Fujita
Feb 11 '13 at 11:57





@wasteofspace, Thanks. The deadline of the book I am now writing is the beginning of April. I hope to improve the documentation of XyMTeX after that deadline in order to meet the comment of cgnieder on the documentation. Would you please wait for a while.

– Fujita
Feb 11 '13 at 11:57


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f52722%2fcan-you-make-chemical-structure-diagrams-in-latex%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents