I have a file, which works fine, if there is no table of contents, however, while trying to compile this file with added \tableofcontents command, compiler tells me:

myfile.toc 2 LaTeX Error: Something's wrong--perhaps a missing \item.

What's the solution?

edited:

I've just found that \tableofcontents are not in good relations with section's renewing:

\makeatletter
\renewcommand{\section}{
\@startsection
{section}{1}{0mm}
{\baselineskip}%
{\baselineskip}
{\fontsize{14}{14}\centering\bfseries\MakeUppercase}
}%
\makeatother


If I remove this renewing, \tableofcontents makes no problem. So this probably makes the problem clear?

-
Hard to say given that information. Probably the .toc file is corrupt. Try removing myfile.aux and myfile.toc and see if that gets LaTeX back in sync. –  David Carlisle Mar 22 '12 at 19:00
it might help if that were to appear as part of a miminal example. cutting and pasting from your post, i get an error, but not the missing item one. i assume i've made a copying error. but what are you trying to do? –  wasteofspace Mar 22 '12 at 19:31

closed as too localized by egreg, Joseph Wright♦Apr 14 '12 at 22:13

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Please make a minimal example that demonstrates the problem to make it easier for you I'm putting this as an answer rather than a comment so I can add a formatted example

\documentclass{article}

\makeatletter
\renewcommand{\section}{
\@startsection
{section}{1}{0mm}
{\baselineskip}%
{\baselineskip}
{\fontsize{14}{14}\centering\bfseries\MakeUppercase}
}%
\makeatother

\begin{document}

\tableofcontents

\section{aaaaa}

asa

\section{bbbb}

\end{document}


this document runs without error, please edit your question to add a version of this example that does demonstrate the problem.

-