## LaTeX forum ⇒ General ⇒ Undefined control sequence in new chapter Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm

### Undefined control sequence in new chapter

Hello,
These are my first steps in LaTex and i would like to to ask about an error that i get. I use XeLateX in order to write my thesis. I wrote the main file (that contains title, auhor etc) without problems and now i want to make seperates files for each chapter (chapter one, chapter two) and include them in the main tex file. When i start writing the first chapter in a seperate file, i get error :
Undefined control sequence
The code i use is :
\chapter{Chapter One}Text of Chapter One....

If i write the chapter directcly in the main file, then i get the output correctly with no error. What am i doing wrong?
I use TexShop editor in MacOS

Tags:

Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm
You have to go back to your main document to compile.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm
Thanks for your respnonse. I tried going back and compile the main tex file but i still get the same error in the line where i included the chapter file.
I wrote
\include{chapter one}
and i get the same error (Undefined sequence l1. \chapter) in that line

Stefan Kottwitz
Posts: 9501
Joined: Mon Mar 10, 2008 9:44 pm
It seems you use a document class that doesn't support chapters, such as article or scrartcl. book and report classes support chapters.

Perhaps post your document preamble here, so we can see your code and settings.

Stefan

ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm
My main tex file is that (i use greek language):
\documentclass[a4paper]{article}\usepackage{xltxtra}\usepackage{xgreek}\usepackage{unicode-math}\begin{document}\setmainfont[Mapping=tex-text,Ligatures=Common]{Garamond Premier Pro}\setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Myriad Pro}\setmonofont[Scale=MatchLowercase]{Consolas}\setmathfont[Scale=MatchUppercase]{Asana Math}\graphicspath{ {images/} }   \begin{titlepage}     \centering     %\vspace*{11\baselineskip}     \large     \bfseries     \textbf{Thesis Title} \\[3\baselineskip]     \normalfont         \textbf{\today} \\[2\baselineskip]   \end{titlepage}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{abstract}Abstract\end{abstract} \include{chapterOne} \end{document}[/latex] and the chapterOne file :[latex]\chapter{Chapter One}Content of chapter one.....

ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm
I changed the document class from article to report and now i can compile the main file without errors.
Thanks for your help.

Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm
Concerning the title page, you might be interested in http://tex.stackexchange.com/questions/ ... 280#210280
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

ziselos
Posts: 15
Joined: Sun Mar 04, 2018 12:03 pm
Thanks a lot.