GeneralError in structured document

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
joe74
Posts: 15
Joined: Tue Mar 24, 2009 6:17 am

Error in structured document

Post by joe74 »

I'm having this error in an structured document. Despite the error I have no further problems in the final generated pdf. Though I would like to know what is all about.

This is my main document:

Code: Select all

\documentclass[a5paper,11pt,oneside]{report}
\linespread{1.2}
\parskip=3pt
\usepackage{graphicx}
\usepackage{color}		
\usepackage{ulem}		
\usepackage{fixltx2e}		
\usepackage[pdftex,pdftitle={Los Dias del Mar},pdfauthor={Joel Davila},pdfkeywords={poesia relato prosa},pdfsubject={Los Dias del Mar},colorlinks,citecolor={blue},linkcolor={blue}]{hyperref}		
\usepackage{makeidx}

\renewcommand{\rmdefault}{pnc}
\renewcommand{\ttdefault}{pnc}
\normalfont 
\usepackage[T1]{fontenc}
\usepackage{lettrine}

\usepackage{textcomp}		
\usepackage{pxfonts}

\renewcommand{\contentsname}{\'Indice}

% \author{Joel D\'avila Balladares}
% \title{\textbf{Los D\'ias del Mar}}
% \date{}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	\input{titlepage}
	\input{presspage}
	\input{thanx}
	\input{preamble}
	\input{quote}
	\input{contents}
	\input{about}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
then the error points to here:

Code: Select all

\begin{center}
\section*{The Dark Side}
\addcontentsline{toc}{section}{The Dark Side}
\end{center}
\bigskip
even though that structure is the same in the previous \section(s), the error points to this one section and the five subsecuent ones.

The error is:

Code: Select all

./contents.tex:560:Something's wrong--perhaps a missing \item. \end{center}
Thank you in advance
joe74
http://latexlive.wordpress.com/
TeX Live 2009/TeXmaker
Powered by Debian Squeeze

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Error in structured document

Post by localghost »

Reduce the problem to a minimal working example (MWE) without any \input commands. The reason why I ask for this is that the marked error could be a follow up hence the actual source could be where else.

You possibly can avoid this error by putting the \addcontentsline command outside the center environment.

If you want centered headings, you may use the titlesec package which allows to customize headings in many ways. The manual describes the details.


Best regards
Thorsten
User avatar
joe74
Posts: 15
Joined: Tue Mar 24, 2009 6:17 am

Re: Error in structured document

Post by joe74 »

I did not use MWE for I thought my whole code would be more exact. I'll edit my code.

I have tried putting \addcontentsline outside the center environment with no luck at all.

I'll have a look to titlesec.

Thanks!
joe74
http://latexlive.wordpress.com/
TeX Live 2009/TeXmaker
Powered by Debian Squeeze
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Error in structured document

Post by localghost »

joe74 wrote:I did not use MWE for I thought my whole code would be more exact. [...]
An example can be considered exact in the case it reproduces the given error and simultaneously abandons every access to external files. Moreover there shouldn't be any declarations of new commands which are irrelevant for the problem. The link in my last reply shows in detail how to build a MWE.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Error in structured document

Post by frabjous »

A place to start would just be eliminating the center environment altogether. It's useless and ineffectual there. If you want a centered section* heading, try titlesec, as suggested.
Post Reply