[Tex/LaTex] How to make a chemical diagram with mhchem


I need to write two symbols one below the other, and I referred to the following posts:

How to write something vertically below another math symbol

How to write below/above the text in LaTeX?

However, using \underset{}{} or \stackrel{}{} decreases the size of one symbol with respect to the other. underset{}{} makes the bottom symbol smaller, and \stackrel{}{} makes the top smaller (Go to the bottom of the page here to test it out)

My Question: Is there any LaTeX or MathJax command that stacks two things symbols but does not change the size of either one?

My Use: I want to use it to make a simple organic chemistry molecule (2-methyl 2-chloro propane). The closest I have come to rendering it approximately the same size is


(Go to the bottom of the page here to test it out)

It is extremely messy, but still not the same size. Please don't ask me to use chemfig, there are a few reasons I don't want to use it.

Best Answer

There are several packages in LaTeX that will produce chemical diagrams. See this post and its answers for an overview.

enter image description here

As an example, using chemfig (even though you want to avoid it) the diagram can be produced using the following code:





The chemfig user manual explains this and many other constructions.

But it seems that you are really asking about how to typeset this in MathJax. MathJax is usually considered off topic at TeX.SX. However, the MathJax extension mhchem is also a package in LaTeX, so here is a possible solution using mhchem. It is my understanding that mhchem is designed for chemical equations, not structure diagrams, so you may need to use an array to get this to work:



\ce{\phantom{H_3}CH_3}\\% phantom to get the bond aligned with the C
| \\
| \\


This produces (in LaTeX)

enter image description here

or in Chrome with MathJax:

enter image description here