# Why does \tableofcontents{} report "perhaps a missing \item} when redefining \chapter?

I am attempting to redefine the chapter command to remove the vertical space that appears above the chapter style when placed at the top of the page, while still keeping it in position (that is not making it overlap other text) if used in the middle of a page. I found that vspace only adds space when used in the middle of a page while vspace* adds space all the time I did something like this:

\documentclass[oneside,12pt]{report}
\usepackage{amsmath}
\RequirePackage[style=ieee, backend=biber, citestyle=ieee, natbib=true]{biblatex}

\makeatletter
\let\oldchapter\chapter
\renewcommand*\chapter{
\@ifstar{\starchapter}{\@dblarg\nostarchapter}
}
\makeatother

\def \extrachpspc{15pt}
\newcommand*\starchapter[1]{
\vspace{\extrachpspc}\vspace*{-\extrachpspc}\oldchapter*{#1}
}
\def\nostarchapter[#1]#2{
\vspace{\extrachpspc}\vspace*{-\extrachpspc}\oldchapter[{#1}]{#2}
}

\begin{document}
\tableofcontents{}
\end{document}


Where space is added before chapter in the middle of the page while also removed when rendered at the top of the page. Leaving chapter rendering without a top margin.

This used to work fine, but I'm guessing I updated some package somewhere (probably a while back because I can't remember) because now I get the following error:

! 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.3 \contentsline {chapter}{\numberline {1}*}{2}


So my questions are:

• What does the error mean?
• Is there some conflict with amsmath? Because if I remove the this simple example renders but I need that package later on.
• Is there another way of achieving what I want?
• And finally what is wrong with my approach?
• your definitions are missing a lot of % but also the intention is rather hard to understand. \chapter in the report class starts a new page so what do you mean by the distinction between being at top or middle of a page? Mar 22, 2018 at 23:55

If you use % to remove the spurious spaces added in the macros then the error goes (but the code seems very odd, given that chapters start a new page)

\documentclass[oneside,12pt]{report}
\usepackage{amsmath}
\RequirePackage[style=ieee, backend=biber, citestyle=ieee, natbib=true]{biblatex}

\makeatletter
\let\oldchapter\chapter
\renewcommand*\chapter{%
\@ifstar{\starchapter}{\@dblarg\nostarchapter}%
}
\makeatother

\def \extrachpspc{15pt}
\newcommand*\starchapter[1]{%
\vspace{\extrachpspc}\vspace*{-\extrachpspc}\oldchapter*{#1}%
}
\def\nostarchapter[#1]#2{%
\vspace{\extrachpspc}\vspace*{-\extrachpspc}\oldchapter[{#1}]{#2}%
}


• @ChristianEriksson if you have no chapters in your report, don't all your sections get numbered as 0.1, 0.2 etc? The intention is that you use article not report in that case. Mar 23, 2018 at 9:47