Math & Scienceenumitem | Bizarre Error with 'inline' Option

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

enumitem | Bizarre Error with 'inline' Option

Post by ghostanime2001 »

I get an error with this code, it says "You can't use 'spacefactor' in vertical mode. How can I fix this? This error appears to stem from using the enumitem package with 'inline' optional argument. But I don't understand how to fix it. Thanks for anyone's help.

Code: Select all

\documentclass{article}
\usepackage{amsmath}   
\usepackage[inline]{enumitem}  
\usepackage{cancel} 
\usepackage[T1]{fontenc}
\usepackage{mathtools} 
\usepackage[version=3]{mhchem}
\setlength{\parskip}{0in}
\setlength{\parindent}{0in}
\everymath{\displaystyle}
\begin{document}
\begin{enumerate}
\item \ce{$\underset{\clap{\begin{minipage}[t]{2cm}\vspace{0.5\baselineskip}\centering\scriptsize\textsf{27 g/mol \\ 0.0306 mol}\end{minipage}}}{\ce{2Al}}$ + $\underset{\clap{\begin{minipage}[t]{2cm}\centering\scriptsize\textsf{4.5 g \\ 98.1 g/mol \\ 0.0459 mol}\end{minipage}}}{\ce{Zn(OH)2}}$ -> Al2(SO4)3 + 3H2} \\ \\ \\
$\begin{array}{ll}
n_{\ce{H2SO4}}=\dfrac{\text{4.5 \cancel{g}}}{\text{98.1 \cancel{g}/mol}} &\qquad \begin{aligned}[t]n_{\ce{Al}}&=\smash{\text{0.0459 mol \cancel{\ce{H2SO4}}}\times\dfrac{\text{2 mol Al}}{\text{3 mol \cancel{\ce{H2SO4}}}}} \\ &= \text{0.0306 mol}\end{aligned} \\ \\
&\qquad \begin{aligned}[t]m_{\ce{Al}}&=\text{0.0306 mol $\times$ 27 g/mol} \\ &=\text{0.83 g}\end{aligned}
\end{array}$
\item
\begin{enumerate*}
\item \ce{H2O}
\end{enumerate*}
\end{enumerate}
\end{document}
Last edited by ghostanime2001 on Mon Aug 29, 2011 9:50 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: enumitem | Bizarre Error with 'inline' Option

Post by Stefan Kottwitz »

Hi,

it's good that you posted a complete example.
I tested it, but there was no error when I compiled. I used enumitem version 3.3 from 2011/07/14. If your version is older, you could update it. You can see the version if you look into the produced .log file and search for enumitem.

Stefan
LaTeX.org admin
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: enumitem | Bizarre Error with 'inline' Option

Post by ghostanime2001 »

nevermind it works i forgot to refresh the database
Post Reply