GeneralHelp needed: Undefined control sequence. \end{document} ?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Xionbox
Posts: 3
Joined: Tue Nov 18, 2008 2:25 pm

Help needed: Undefined control sequence. \end{document} ?

Post by Xionbox »

Hello,

I am fairly new to LaTeX, have only written five 15-page physics papers, and did encounter some weird errors in the past, but the one I encountered today is by far the weirdest.

I suppose that I am doing something wrong somewhere in my documents, but since the only is, for the moment, an outline, I am really having a very difficult time figuring out what is wrong. As you will see, I have commented out the math I use in the document title in order to remove some warnings. By the way, is it "latex-legal" to but math symbols in section titles?

Anyways, here's the error I get with my outline, and below is the document.

Any help is greatly appreciated, especially because I didn't find anything related to my error on the internet.
[PDFLaTeX] Linear-Algebra.tex => Linear-Algebra.pdf (pdflatex)
[PDFLaTeX] finished with exit status 1
Linear-Algebra.tex:0: \headheight is too small (0.0pt):Make it at least 12.0pt.
Linear-Algebra.tex:78:Undefined control sequence. \end{document}
Linear-Algebra.tex:78:You can't use `\/' in internal vertical mode. \end{document}
Linear-Algebra.tex:78:Missing number, treated as zero. \end{document}
Linear-Algebra.tex:78:Illegal unit of measure (pt inserted). \end{document}
[PDFLaTeX] 4 errors, 1 warning, 0 badboxes

Code: Select all

\documentclass[a4paper,10pt]{article}
% page setup
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{fullpage,pslatex,fancyhdr,lastpage,hyperref}

\hypersetup{
	pdfauthor={Christopher MyName},
	pdftitle={TITLE},
	bookmarksopen=true,
	pdfdisplaydoctitle=true,
	colorlinks,linkcolor=black}
\makeindex
\pagestyle{fancy}
\setlength{\headheight}{0pt}
\lhead{\fancyplain{}{}}
\chead{\fancyplain{}{}}
\rhead{\fancyplain{}{}}
\lfoot{\fancyplain{}{\textit{Christopher MyName}}}
\cfoot{\fancyplain{}{\pageno\//\pagetotal}}
\rfoot{\fancyplain{}{\textit{TITLE}}}

\begin{document}
%opening
\title{TITLE}
\author{Christopher MyName}
\date{date}
\maketitle
\tableofcontents

\begin{abstract}
This lesson is written in English. The terms used aren't very complicated and therefore should be understandable by a non-native speaker.
\end{abstract}

\section{Orthonormal matrices}
\subsection{Projections}
\subsection{Gram Schmitt}

\section{Determinants}
\subsection{Key Points}
\subsection{Formula}
\subsection{Example}

\section{Cofactors}
\subsection{Formula of}%$A^{-1}$}
\subsection{Cramer's Rule}
\subsection{Application: volume of a box}

\section{Eigenvalues and Eigenvectors}

\section{Diagonalizing a matrix and Jordan form}
\subsection{Formula}
\subsection{Powers of a matrix}
\subsection{Example: Fibonacci}
\subsection{Jordan form}

\section{Differential equations and exponential of a matrix}
\subsection{Differential equations}
\subsection{Exponential of a matrix}

\section{Markov matrices and steady state}
\subsection{Markov matrices}
\subsection{Application: steady state matrices}

\section{Symmetric matrices and positive definite matrices}
\subsection{Symmetric matrices}
\subsection{Positive definite matrices}
\subsection{Tests for minimums}
\subsection{Ellipsoids in}%$\Re^n$}

\end{document}
Thanks in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Xionbox
Posts: 3
Joined: Tue Nov 18, 2008 2:25 pm

Re: Help needed: Undefined control sequence. \end{document} ?

Post by Xionbox »

Okay, so after a couple commenting/uncommenting tests, it seems that the error is located between the
"\section{Eigenvalues and Eigenvectors}" line and the "\section{Diagonalizing a matrix and Jordan form}" line.

Actually, if I comment the lines and all the other ones below (except the \end{document}), it compiles correctly. If however I dare to uncomment one of the line, might it be a section{} or subsection{}, I get the same exact error saying that "\end{document}" is an undefined control sequence...

Aaah, the power of LaTeX, making a sane man go crazy because of an error on a blank line.
Xionbox
Posts: 3
Joined: Tue Nov 18, 2008 2:25 pm

Re: Help needed: Undefined control sequence. \end{document} ?

Post by Xionbox »

Okay, never mind! The problem was \pagetotal. In fact, I replaced it with \pageref{LastPage} (using the lastpage pakcage) and it just works.

Don't ask why, I don't know. :)
hydalgo
Posts: 1
Joined: Fri May 08, 2009 12:27 am

Help needed: Undefined control sequence. \end{document} ?

Post by hydalgo »

Xionbox wrote:Okay, never mind! The problem was \pagetotal. In fact, I replaced it with \pageref{LastPage} (using the lastpage pakcage) and it just works.

Don't ask why, I don't know. :)
Well, I had a similar problem, with that awful error message and very difficult to trace back. After some test and try and thanks to your last message I discovered the issue: it's a problem related with fancyhdr package, in fact, such error message appears when two conditions happens simultaneously:

1) You have a syntax error inside a \fancyhead or \fancyfoot sentence. For example:

Code: Select all

\fancyhead[L]{\nouppercase{\lefmark}}
where the 't' of \leftmark has been forgotten.

2) The page generated by LaTeX uses the content of such sentence, and never before that point. I mean that you don't get the error until you achieve the second page of the chapter, for example, because the first one usually only has a plain footpage and not a true 'fancyfoot'.

I hope this helps whoever could get this annoying message! :roll:
Post Reply