Math & ScienceDrawing Chemical structures with PPCHTEX package

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
ChemistKatie
Posts: 14
Joined: Wed Sep 01, 2010 4:47 pm

Drawing Chemical structures with PPCHTEX package

Post by ChemistKatie »

Hi,

I am trying to get quite ambitious with my latex now I am getting used to the way it works! I would like to have a go at drawing chemical structures using the PPCHTEX package.

I have followed the instructions and quoted

Code: Select all

\usepackage{m-pictex}
\usepackage{m-che-en}
in my preamble but I get the error message:

Latex error: file "m-pictex.sty" not found.

How do I get this package to work? Any help would be much appreciated! Please let me know if you require more information.

Katie

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Drawing Chemical structures with PPCHTEX package

Post by frabjous »

You need to install the packages. What LaTeX distribution are you using? (MikTeX? TeXlive? etc.) On what operating system?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Drawing Chemical structures with PPCHTEX package

Post by localghost »

This package is part of ConTeXt (but nevertheless can be used with LaTeX). A quite new and very sophisticated and well documented LaTeX package is chemfig.


Best regards and welcome to the board
Thorsten
ChemistKatie
Posts: 14
Joined: Wed Sep 01, 2010 4:47 pm

Drawing Chemical structures with PPCHTEX package

Post by ChemistKatie »

frabjous wrote:You need to install the packages. What LaTeX distribution are you using? (MikTeX? TeXlive? etc.) On what operating system?
Before when using new packages they have been installed automatically. I am using TeXnicCentre on Windows XP.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Drawing Chemical structures with PPCHTEX package

Post by frabjous »

That does not tell us what LaTeX distribution you're using. TeXnicCenter is an editor, not a LaTeX distribution. If it installs on the fly, you're probably using some version of MikTeX, but which one? I'd suspect that the ConTeXt origins of the package have something to do with why it isn't being installed automatically, but I think whether or not ConTeXt packages are available through the MikTeX package manager and how might depend on what version you're using.
ChemistKatie
Posts: 14
Joined: Wed Sep 01, 2010 4:47 pm

Re: Drawing Chemical structures with PPCHTEX package

Post by ChemistKatie »

Ahhh yes, sorry I am still not used to the "lingo" of Latex. I am using MikTex 2.8
GianlucaT
Posts: 4
Joined: Wed Jan 26, 2011 6:37 pm

Drawing Chemical structures with PPCHTEX package

Post by GianlucaT »

Hi there,

I am trying to draw the molecule in attached. I am using the code:

Code: Select all

\usemodule[chemic]
\starttext
\startTEXpage
\startchemical [width=fit,height=fit]
\chemical [ONE, DB6, SB38, Z036] [C, CH_3, H_2C]
\chemical [MOV8, Z07, DB7, SB2] [C, O]      
\chemical [MOV2, Z0, SB8] [O]      
\chemical [MOV8, Z0, SB2] [C]      
\chemical [MOV2, Z0, SB1] [C]      
\chemical [MOV1, Z0137, ZT6, SB137] [N, CH_3, CH_3, CH_3, +]      
\chemical [MOV4, MOV5, Z0] [Cl^-]     
\stopchemical
\stopTEXpage
\stoptext
with TeXShop v2.37 and the ConTeXt package but the result it is not so good ...

Actually I am a newbie of LaTeX so I am not so expert, for example how can I install PPCHTEX?
I am using a Mac OsX ... do I have to install all the package of MacTeX (1.6Gb)?

Thank you very much,

Gianluca
Attachments
Metmac.png
Metmac.png (33.82 KiB) Viewed 7983 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Drawing Chemical structures with PPCHTEX package

Post by localghost »

In an earlier post I suggested the excellent chemfig package. To me it seems to be much easier to use.

Code: Select all

\documentclass{minimal}
\usepackage{chemfig}

\setatomsep{2em}

\begin{document}
  \chemfig{%
    H_2C=[:-30]
    (-[:-90]CH_3)
    -[:30]
    (=[:90]O)
    -[:-30]\chembelow[1.2em]{O}{\hspace{4em}Cl^-}
    -[:30]
    -[:-30]
    -\chemabove[3pt]{N}{\hspace{-20pt}+}
    (-[2]CH_3)
    (-[6]CH_3)
    -CH_3
  }
\end{document}
The package is based on pgf/tikZ.


Thorsten
Attachments
The resulting output generated by the given code.
The resulting output generated by the given code.
ChemFig-xmpl.png (6.23 KiB) Viewed 7969 times
GianlucaT
Posts: 4
Joined: Wed Jan 26, 2011 6:37 pm

Re: Drawing Chemical structures with PPCHTEX package

Post by GianlucaT »

Localghost,

that's perfect but how can I add chemfig to my packages? I downloaded the package but now what do I have to do with the chemfig.sty file?


Sorry for the silly question.

Gianluca
GianlucaT
Posts: 4
Joined: Wed Jan 26, 2011 6:37 pm

Re: Drawing Chemical structures with PPCHTEX package

Post by GianlucaT »

Solved,

sorry but I am still a newbie ...

Now, how can I draw the molecule and save it as a TIFF? I mean can I save only the image in the tiff format and not all the page?

Gianluca
Post Reply