Graphics, Figures & TablesChemical structural Formulas

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Chemical structural Formulas

Post by MatthiasN »

Hi everyone,

I was wondering if there is a package for the drawing of chemical formulas. I am currently using mhchem but this only allows the user to write the formula, but not to draw the structure of the molecule. So there is no misunderstanding I attached a picture that shows what I would like to be able to do.


Thanks for reading,
Matthias
Attachments
4-nitrotolueen.gif
4-nitrotolueen.gif (1.14 KiB) Viewed 4805 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Chemical structural Formulas

Post by localghost »

Try chemfig. It is based on PGF/tikZ.

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{chemfig}

\setdoublesep{0.35700 em}  % 'Bond Spacing'
\setatomsep{1.78500 em}    % 'Fixed Length'
\setbondoffset{0.18265 em} % 'Margin Width'
\newcommand{\bondwidth}{0.06642 em} % 'Line Width'
\setbondstyle{line width = \bondwidth}

\begin{document}
  \chemfig{*6(=(-NO_2)-=-(-CH_3)=-)}
\end{document}
For detailed descriptions of the capabilities and usage please refer to the package manual. You may combine the package with the very useful chemmacros.


Thorsten
Attachments
rtmp.png
rtmp.png (988 Bytes) Viewed 4799 times
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Re: Chemical structural Formulas

Post by MatthiasN »

Looks really neat and since I am currently trying to work my way through the tikz manual, I think it can be really beneficial that it is based on tikz.

Thanks for your help!
Post Reply