Drawing Lewis Diagrams & Chemical Equations with LaTeX

Click For Summary
SUMMARY

This discussion focuses on drawing Lewis diagrams, Lewis symbols, and chemical equations using LaTeX, specifically utilizing the chemfig and mhchem packages. The chemfig package allows for the creation of chemical structures, as demonstrated with the example of glycerol. For chemical equations, the mhchem package is recommended, enabling users to write balanced equations like \ce{O2 + 2H2 -> 2H2O}. The discussion confirms that both packages are effective for representing chemical information in LaTeX documents.

PREREQUISITES
  • Familiarity with LaTeX document preparation
  • Understanding of chemical notation and structures
  • Basic knowledge of the chemfig package for chemical structures
  • Experience with the mhchem package for chemical equations
NEXT STEPS
  • Explore advanced features of the chemfig package for complex chemical structures
  • Learn how to integrate TikZ with LaTeX for enhanced graphical representations
  • Investigate additional LaTeX packages for chemistry, such as chemtools
  • Practice writing more complex chemical equations using the mhchem package
USEFUL FOR

Chemistry students, educators, and researchers who need to accurately represent chemical structures and equations in LaTeX documents.

WMDhamnekar
MHB
Messages
378
Reaction score
30
Hi,

How to draw Lewis diagrams, Lewis symbols , chemical equations in LaTeX?
 
Physics news on Phys.org
Hey @Dhamnekar Winod,

LaTex in general? Or here on MHB?

Either way, we can draw chemical structures with for instance the chemfig package.
Use it in a LaTeX document like this:
Code:
\documentclass{article}
\usepackage{chemfig}
\begin{document}
  \chemname{\chemfig{
    C(-OH)(-[2]C-OH)(-[6]C-OH)
  }}{Glycerol}
\end{document}

Embed it in a TikZ picture to show it on MHB:
\begin{tikzpicture}
%preamble \usepackage{chemfig}
\node {
\chemname{\chemfig{
C(-OH)(-[2]C-OH)(-[6]C-OH)
}}{Glycerol}
};
\end{tikzpicture}
Click on the picture to see the LaTeX code.

I haven't tried to draw Lewis diagrams or symbols with it yet, but I expect that chemfig supports that as well.
Of course there are also other LaTeX packages to draw chemical structures.

Regular chemical formulas can be done with the usual MathJAX on MHB.
Or you can put it in an actual LaTeX document by including the mhchem package.
So we can write for instance:
Code:
\ce{O2 + 2H2 -> 2H2O}
Put it between dollars and it shows up like:
$$\ce{O2 + 2H2 -> 2H2O}$$

Or put it in a LaTex document like:
Code:
\documentclass{article}
\usepackage[version=4]{mhchem}
\begin{document}
  \ce{O2 + 2H2 -> 2H2O}
\end{document}
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 8 ·
Replies
8
Views
7K