44

I’m getting an “undefined control sequence” error with the following code, using TeXstudio:

\documentclass[11pt]{article}
\begin{document}
\begin{center}
\chapter{CHAPTER 6}
\end{center}
\end{document}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
ravi
  • 1,379

2 Answers2

49

The article class doesn't define the \chapter command, because articles don’t have chapters. Instead they have sections, subsections, etc. If you really want to use article, then you might want to consider using \section, \subsection and so on.

If you really want to use the \chapter command, then I’d suggest using the book or report document classes.

Separately, you generally shouldn’t use \begin{center} … \end{center} for headings. It’s really better used to make lists or similar. A better way to centre your title headings is to use the titlesec package, which is described in another question on TeX.se.

alexwlchan
  • 5,417
14

Command \chapter is undefined in article. It is defined in book or report.