What is causing undefined control sequence?

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.


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.


A similar mistake might also be caused by something as simple as trying to build the wrong file(e.g. clicking a PDFLaTeX command while being in the "abstract" file, which is part of your document). You should be in your main file(where you call and "gather" all the "smaller" files) when you're building.

I hope this saves some time for newbies like me, as this page was the first suggestion when looking for this error.