To draw Lewis diagrams, Lewis symbols, and chemical equations in LaTeX, the chemfig package is recommended for creating chemical structures. An example provided demonstrates how to depict glycerol using chemfig within a LaTeX document. For embedding in TikZ, the same chemfig code can be used within a TikZ picture environment. While the user has not yet explored drawing Lewis diagrams specifically, it is anticipated that chemfig can accommodate this as well. Additionally, regular chemical formulas can be rendered using MathJAX or the mhchem package, allowing for straightforward representation of chemical equations in LaTeX documents. Examples illustrate how to format chemical reactions effectively using both MathJAX and mhchem.
#1
WMDhamnekar
MHB
376
28
Hi,
How to draw Lewis diagrams, Lewis symbols , chemical equations in LaTeX?
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}$$