4

This is probably a noob error. I get a "Missing $ inserted" error when compiling the following code:

\item $%
\begin{array}{c}
w_{M}>w_{F} \\ 
\text{or }w_{F}>w_{M}%
\end{array}%
:\left\{ 
\resizebox{6.3cm}{!}{%
\begin{array}{l}
\text{the one earning more will continue working, } \\ 
\text{whilst the one earning less will} \\
\text{go on if }w>\eta \text{, otherwise he/she }\\
\text{will drop out and provide homecare}%
\end{array}%
}
\right. $

I tried to solve it by adding $ signs anywhere I though it would be correct, but I was not able to get rid of the error. I also tried removing all $. Nevertheless, if I skip this error while compiling, the result is precisely the one I wanted.

EDIT: Thank you. It turns out I was using resizebox in the wrong way. The right code is

\item $
\begin{array}{c}
w_{M}>w_{F} \\ 
\text{or }w_{F}>w_{M}%
\end{array}%
:\left\{ 
\resizebox{6.3cm}{!}{%
$
\begin{array}{l}
\text{the one earning more will continue working, } \\ 
\text{whilst the one earning less will} \\
\text{go on if }w>\eta \text{, otherwise he/she }\\
\text{will drop out and provide homecare}%
\end{array}%
$
}
\right. $
David Carlisle
  • 757,742
  • Welcome to TeX.sx! Your question was migrated here from [so]. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Feb 23 '12 at 17:18
  • 3
    You were using \resizebox correctly. It's just the \resizebox switches back to text mode, so you have to use an explicit math mode switch (in your case you used $) to use math content. – Werner Feb 23 '12 at 17:21

1 Answers1

4

It looks like \resizebox can't be used in maths mode. Try this:

\item $%
\begin{array}{c}
w_{M}>w_{F} \\ 
\text{or }w_{F}>w_{M}%
\end{array}$
\resizebox{6.3cm}{!}{
$:\left\{
\begin{array}{l}
\text{the one earning more will continue working, } \\ 
\text{whilst the one earning less will} \\
\text{go on if }w>\eta \text{, otherwise he/she }\\
\text{will drop out and provide homecare}%
\end{array}%
\right. $
}
David Carlisle
  • 757,742
spencercw
  • 156
  • 1
    Usually all \...box macros switch back to text mode for their contents. Also note that line breaks after { will insert a space, so you should write \resizebox{6.3cm}{!}{% instead to avoid this. – Martin Scharrer Apr 03 '12 at 04:42