Math & Science ⇒ Multiline Underset
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Multiline Underset
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Re: writing stuff underneath a chemical formula
Stefan
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Re: writing stuff underneath a chemical formula

- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Re: writing stuff underneath a chemical formula
Stefan
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Re: writing stuff underneath a chemical formula
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Re: writing stuff underneath a chemical formula
Stefan
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Multiline Underset
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{2Al + $\underset{\text{4.5 g}}{\ce{Zn(OH)2}}$ -> Al2(SO4)3 + 3H2}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Multiline Underset
Here's a tabular example:
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{2Al + $\underset{\text{\begin{tabular}{c}4.5 g\\[-1ex]more\end{tabular}}}{\ce{Zn(OH)2}}$ -> Al2(SO4)3 + 3H2}
\end{document}
Stefan
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Multiline Underset
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{2Al + $\underset{\begin{array}{c}4.5 g\\98.1 g/mol\\more\\more\end{array}}{\ce{Zn(OH)2}}$ -> Al2(SO4)3 + 3H2}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{2Al + $\underset{\begin{subarray}{c}4.5 g\\98.1 g/mol\\Top shelf\\more\end{subarray}}{\ce{Zn(OH)2}}$ -> Al2(SO4)3 + 3H2}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{2Al + $\underset{\substack{\begin{subarray}{c}4.5 g\\98.1 g/mol\\Top shelf\\more\end{subarray}}}{\ce{Zn(OH)2}}$ -> Al2(SO4)3 + 3H2}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{2Al + $\underset{\parbox[c]{3cm}{4.5 g\\98.1 g/mol$^-$}}{\ce{Zn(OH)2}}$ -> Al2(SO4)3 + 3H2}
\end{document}
Also, what are the 'more' in your previous post? I am hoping they are something I am indeed looking for rather than these. I want to make my selection based on everything I test.
- Stefan Kottwitz
- Site Admin
- Posts: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Multiline Underset
I mentioned those possibilities in order to say that there are usually many ways, of which we could choose the best.
- A simple `\parbox` would be a good choice for (possibly justified) muliline text.
- A minipage would work similar (that's for example meant by 'more' ealier).
- tabular would be good if you need alignment (centered, right or left) and if the content should be in text mode.
- array would also be good for aligned multiline content, which is mainly maths.
- \substack is a handy tool exactly for multiline subscripts which are centered to each other.
- The subarray environment is like \substack but is an environment and allows left alignment.
it wasn't possible to recommend one, so I just could list some for you to check out.I need to put more lines below "4.5 g"
Stefan