I keep getting the compiling error >file ended while scanning use of \frac. I can't see any missing {}, so I'm not sure what to do.
\documentclass[]{scrreprt}
\usepackage{geometry}
\begin{document}
Molar Mass of Nitrogen
\begin{math}
\\ Bulb Volume: 213.7 cm^{3} = .2317 L
\\ Internal bulb pressure: 20 inHg = 508 mmHg = .508 bar
\\ Temperature: 294.2 K
\\ M = \frac{\rho}{P}RT
\\ \rho = \frac{.158 g}{.2137 L} = .739\frac{g}{L}
\\ M = \frac{.739 \frac{g}{L}}{.508 bar} * .083144 \frac{L*bar}{mol*K} * 294.2 K = 35.6 \frac{g}{mol}
\\ Calculation of Volume by van der Waals Equation with Successive Approximations
\\ V = \frac{nRT}{P + \frac{n^{2}a}{V^{2}}} + nb
\\ a = 1.408 \frac{L^{2}*bar}{mol^{2}}
b = .03913 L
\\ V \approx \frac{nRT}{P} + nb \approx \frac{nRT}{P}
\\ n = \frac{m}{M} = \frac{.158 g}{21.35 \frac{g}{mol}} = 7.4*10^{-3} mol
\\ V = \frac{7.4*10^{-3} mol * .083144 \frac{L*bar}{mol*K} * 294.2 K}{.508 bar} = .2138 L
\\ V = \frac{7.4*10^{-3} mol * .083144 \frac{L*bar}{mol*K} * 294.2 K}{.508 bar
+ \frac{(7.4*10^{-3} mol)^{2}*1.408 \frac{L^{2}*bar}{mol^{2}}} {(.2138 L)^{2}}
+ 7.4*10^{-3} mol * .03913 L = .2137 L
\end{math}
\end{document}
This is for a calculations addendum to an undergraduate chemistry lab. I figured it would be worth the time investment to learn laTeX. It's already significantly faster to do calculations in it than word, if only I can get around these compiling errors.
Relevant log text:
Runaway argument?
{.508 bar + \frac {(7.4*10^{-3} mol)^{2}*1.408 \frac {L^{2}*bar}{mol^\ETC.
! File ended while scanning use of \frac.
Best Answer
You won't be needing one big math environment for this. Further, it is a good idea to use
siunitx
package for typesetting your units. Here is a sample:For details you can
texdoc mathmode
texdoc amsldoc
andtexdoc siunitx
from the terminal.As a side note, I would also use
\cdot
or\times
to show multiplication, but not*
. This, I didn't change in the above example.