Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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. $
share|improve this question

migrated from stackoverflow.com Feb 23 '12 at 17:10

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. 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
add comment

1 Answer 1

up vote 2 down vote accepted

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. $
}
share|improve this answer
    
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 3 '12 at 4:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.