0

I could not find something similar, but please tell me if this is a dupliquate.

It seems that for some styles of the package fncychap do not allow one to use \tableofcontents (I am using book as the document is a dissertation). Indeed, compare

\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[Bjornstrup]{fncychap} 

\begin{document}

\tableofcontents

\chapter{First chapter}
\end{document}

which works perfectly to me (as the styles Sonny, Lenny). However, when one changes the style to Conny (or Glenn, Rejne, Bjarne), I get many error messages, including Missing number, treated as zero. \tableofcontents.

 \documentclass[10pt,a4paper]{book}
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage[Conny]{fncychap} 

 \begin{document}

 \tableofcontents

 \chapter{First chapter}
 \end{document}

It there a way to fix this?

1 Answer 1

1

I found a solution from Ulrike Fischer.

\documentclass[10pt,a4paper]{book}
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}
 \usepackage[Conny]{fncychap} 

 \makeatletter
\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname}%
        \@mkboth{%
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }
\makeatother    

 \begin{document}

 \tableofcontents

 \chapter{First chapter}
 \end{document}
4
  • Wow, thank you so much! Do you have an explanation for this phenomenon? (By the way, this fix works too for all other styles, so this answer is complete). Jun 27, 2019 at 16:45
  • 1
    No, I said in my answer that copy and paste from [tex.stackexchange.com/users/2388/ulrike-fischer] Ulrike Fischer. His/her answer out from TeX.Sc.
    – user31034
    Jun 27, 2019 at 16:48
  • I see, thank you again. Jun 27, 2019 at 16:48
  • Sorry and Your welcome.
    – user31034
    Jun 27, 2019 at 16:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .