- Thread starter
- #1

#### Dhamnekar Winod

##### Active member

- Nov 17, 2018

- 103

Hi,

How to draw Lewis diagrams, Lewis symbols , chemical equations in LaTeX?

How to draw Lewis diagrams, Lewis symbols , chemical equations in LaTeX?

- Thread starter Dhamnekar Winod
- Start date

- Thread starter
- #1

- Nov 17, 2018

- 103

Hi,

How to draw Lewis diagrams, Lewis symbols , chemical equations in LaTeX?

How to draw Lewis diagrams, Lewis symbols , chemical equations in LaTeX?

- Admin
- #2

- Mar 5, 2012

- 8,739

Hey @Dhamnekar Winod,

LaTex in general? Or here on MHB?

Either way, we can draw chemical structures with for instance the

Use it in a LaTeX document like this:

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

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

So we can write for instance:

Put it between dollars and it shows up like:

$$\ce{O2 + 2H2 -> 2H2O}$$

Or put it in a LaTex document like:

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:

LaTeX:

```
\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemname{\chemfig{
C(-OH)(-[2]C-OH)(-[6]C-OH)
}}{Glycerol}
\end{document}
```

\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:

LaTeX:

`\ce{O2 + 2H2 -> 2H2O}`

$$\ce{O2 + 2H2 -> 2H2O}$$

Or put it in a LaTex document like:

LaTeX:

```
\documentclass{article}
\usepackage[version=4]{mhchem}
\begin{document}
\ce{O2 + 2H2 -> 2H2O}
\end{document}
```

Last edited: