# Undefined Control Sequence occurs at: \begin{document} [closed]

I wasn't having any problem with my .tex file, but after compiling a separate document - which used a different document class - my current file no longer loads.

Specifically, I was using the imsart document class, compiled a separate file in the biom class, and now my imsart file won't load. The error I'm getting is:

(c:/Program Files/PCTeX/PCTeXv6/texmf-dist/tex/latex/lm/ot1lmss.fd)
! Undefined control sequence.
<argument> \bibsep

l.66 \begin{document}


I've tried moving the \begin{document} around but that doesn't do anything. I'm almost 100% sure it has something to do with the natbib package, but I can't figure out what. What's bothersome is that no edits were made to the file, and it was just after compiling the other class file that my file won't work.

I've checked to make sure I'm compiling a LaTeX pdf file, as I was before.

The basic code is here, which gives the same error, is virtually copied from the imsart class website:

\documentclass[aoas,preprint]{imsart}
\RequirePackage[OT1]{fontenc}
\RequirePackage{amsthm,amsmath}
\RequirePackage[numbers]{natbib}
\startlocaldefs
\numberwithin{equation}{section}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
\endlocaldefs
\begin{document}
\section{Ordinary text}
It is interesting that simulations with the \cite{r4} model worked well
\begin{thebibliography}{9}
\bibitem{r4}
\textsc{Prokhorov, Yu.} (1956).
Convergence of random processes and limit theorems in probability
theory. \textit{Theory  Probab.  Appl.}
\textbf{1} 157--214.
\MR{84896}
\end{thebibliography}
\end{document}

-

## closed as unclear what you're asking by egreg, Papiro, yo', percusse, Svend TveskægAug 19 '14 at 21:39

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Your document compiles fine for me. Try deleting your .aux file and compile again. BTW: Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – karlkoeller Oct 2 '13 at 4:50
The title of your question is misleading as the error message that you show is not that \begin{document} is undefined. The undefined command is \bibsep (which is not a command I recognose) – David Carlisle Oct 2 '13 at 8:33
I tried deleting the .aux file and compiling. No luck! – Mike Oct 2 '13 at 12:41
i've changed the title. the error occurs at \begin{document} but that is not the error. the undefined control sequence is \bibsep. – barbara beeton Oct 2 '13 at 13:43
Can you point a source for your version of imsart.cls? The one I have bears a release date 2010/04/27. And no error appears with your input, even if I effectively use natbib with a mock .bib file. Of course, if you type in directly the thebibliography environment, you don't need to load natbib, which could solve your problem. – egreg Oct 2 '13 at 13:56

this may or may not be helpful. i don't have imsart to check.

the undefined command is \bibsep. it is a length defined in natbib.sty, and depends on the length \@listi (the width of the space allotted for a first-level item label) being defined already.

for the basic article class, \@listi is defined in the files size1*.clo, and depends on the command \normalsize being invoked; other class files may set it differently, including delaying the setting until \AtBeginDocument. if the setting of \@listi is deferred, that would explain why the error occurs at \begin{document}. this appears affect only the [numbers] option.

you can check in imsart.cls whether \normalsize is invoked immediately, or the setting of \@listi is delayed. if you determine that this is the case, i think your next action should be to inform the creator/distributor of imsart.cls that the [numbers] option of natbib is incompatible.

-

I don't have the imsart class loaded, but If I change the class to article as,

\documentclass{article}


Then comment out these two lines, which I'm not sure you need?

% \startlocaldefs
% \endlocaldefs


And then comment out this one line, with an unfamiliar command,

% \MR{84896}


Your document compiles fine. You might check and make sure that the imsart class file is in your tex tree or in the same folder, but other than that, do you need these lines?

-
Thanks Chris: The imsart .cls file is in the same directory as my .tex folder. The file compiles perfectly when I remove the " \RequirePackage[numbers]{natbib}"...but of course I've built up a large natbib directory which I'm hoping to use! – Mike Oct 2 '13 at 12:23

I just had this same problem, and found the solution.

For me, it turned out to be a clash between two packages: Apparently I was loading both the subfigure & subfig packages, which are not compatible (according to this hint).

If I comment out either

\usepackage{subfigure}


OR

\usepackage{subfig}


The code executes properly. (subfigure is apparently obsolete and should be replaced by subfig)

Apparently You should only use one or the other, as they theoretically provide similar functionality, while I was previously loading both one after the other.

Perhaps your class imsart.cls is importing both packages?

-