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.

I'm getting this error:

! Undefined control sequence.
l.64 ...p(- \frac{E_j - E_i}{k_B T}) & \quad \text
                                                  {:  E_j > E_i}\\
? 
! Undefined control sequence.
l.65     1 & \quad \text
                        {:  E_j<E_i}\\
? 

which is from this:

\begin{equation}\label{eq:hop}
w_{i,j}=w_0 exp(-2 \gamma R_{i,j})\left\{ 
  \begin{array}{l l}
    exp(- \frac{E_j - E_i}{k_B T}) & \quad \text{:  E_j > E_i}\\
    1 & \quad \text{:  E_j<E_i}\\
  \end{array} \right.
\end{equation}

But I don't understand why I get the error. This is my header:

\documentclass[11pt]{iopart}
%\newcommand{\gguide}{{\it Preparing graphics for IOP journals}}
%Uncomment next line if AMS fonts required
\usepackage{iopams}
\usepackage{graphicx, wrapfig}
\usepackage{fixltx2e}
\graphicspath{{images/}}
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.gif}
\makeatletter
\g@addto@macro\@floatboxreset\centering
%\def\@cite#1{\textsuperscript{[#1]}}
\makeatother

And my class file is the standard IoP one from here

Can anyone help me get read of this error?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

The mistake is, as TeX also informs. It cannot find your \text command. The error lies probably in package iopams and should be noticed there. It seems that it does not load the ams math package (only its fonts) and thus you need to explicitly include that package as well.

On a side note you should also include $ in your \text command.

share|improve this answer
    
On a side note you should also include $ in your \text command. Where in the text command? It renders $E_j$ etc fine. –  Pureferret Jan 13 '12 at 21:19
    
Probably not in \text{: E_j > E_i} the _ is a mathchar as well as >. You need \text{: $E_j > E_i$} unless iopams does magic for you! :) –  zeroth Jan 13 '12 at 21:24
    
I do in fact elieve some form of magic for me. Or, that due to \text not being recognised, it's ignored so E_j renders correctly. –  Pureferret Jan 13 '12 at 21:35
    
So is your original problem solved? Then its fine. I havn't tried the iopart class so can not say if it changes the definition of _. It just seems against normal TeX packages to do this (unless it is grouped in the math environments). Glad it works! :) –  zeroth Jan 13 '12 at 21:46
    
I've just edited the iopams file to include the maths library. Works like a charm. –  Pureferret Jan 13 '12 at 21:51
add comment

The macro \text is undefined. You need to load the amsmath package or at least amstext.

\usepackage{amsmath}

\text is defined in amstext, which is loaded by amsmath. Load the latter, because it offers many math functionality, such as aligned multi-line formulas and much more.

share|improve this answer
    
Now it is just returning lots of errors about extra { or missing $ and it never finishes compiling. –  Pureferret Jan 13 '12 at 21:16
1  
@Pureferret Use text within \text{...} That's what it's for: escaping math mode. If you need math symbols within again, write \text{word $\symbol$} or even better, end the macro argument, such as \text{word } \symbol \text{ and more text}. –  Stefan Kottwitz Jan 13 '12 at 21:26
    
I just removed the \text{...} macro, and it runs smoothly now. I'll sacrifice that : for the sake of simplicity. –  Pureferret Jan 13 '12 at 21:44
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.