Theses, Books, Title pagesChapters without \item elements do not compile -> Error in s

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Chapters without \item elements do not compile -> Error in s

Post by templateuser »

Hello,

I am using version Version 1.3 (21/8/13).
When I try to compile with the instructions provided in the template:

pdflatex main
makeindex main.idx -s StyleInd.ist
biber main
pdflatex main
pdflatex main


Everything goes fine. However, if I remove all the temporary files, i.e., I only have the following files in my directory:
- bibliography.bib
- main.tex
- structure.tex
- Pictures (folder)

and I remove all the \begin sections from the chapter 1, i.e., I remove the next lines from main.tex:

Code: Select all

\begin{enumerate}
\item The first item
\item The second item
\item The third item
\end{enumerate}

\subsection{Bullet Points}\index{Lists!Bullet Points}

\begin{itemize}
\item The first item
\item The second item
\item The third item
\end{itemize}

\subsection{Descriptions and Definitions}\index{Lists!Descriptions and Definitions}

\begin{description}
\item[Name] Description
\item[Word] Definition
\item[Comment] Elaboration
\end{description}
Pdflatex is not able to compile the file. The error only happens when there is no \begin inside a chapter. The problem seems to be in the CHAPTER HEADINGS section at the end of the structure.tex file. It seems that a \begin containing at least one \item is needed.

The error is transcribed below:

Code: Select all

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.155 \chapter{In-text Elements}
                                
? H
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
Algar

Recommended reading 2024:

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

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

User avatar
Vel
Site Moderator
Posts: 463
Joined: Fri Jun 29, 2012 1:20 am

Re: Chapters without \item elements do not compile -> Error

Post by Vel »

Hey,

You're right, when you don't have a list in a chapter and delete the main.ptc file and recompile, you get the error you pasted. If the main.ptc file is present and you remove all lists from a chapter, it compiles just fine without giving the error. Note that skipping this error will make the book compile correctly from then on since the .ptc file is generated.

I had a quick look within structure.tex at what could be causing the problem and I can't see anything immediately obvious. Seeing as this is such a rare error because it doesn't affect the template on the site and won't come up with normal use of the template I don't really want to spend a lot of time figuring out why this is happening. If someone else figures it out please reply to this thread and I will gladly modify the template to include the fix!

Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

Re: Chapters without \item elements do not compile -> Error

Post by templateuser »

It is probably because the chapter headings call a table of contents which is then empty? That should probably be tested at some point.

Mathias
Post Reply