2

I want to insert chapter content for my thesis by using minitoc package. It seems working on its own. However, if I add other packages for other purposes, then it does not work and I keep getting the following error:

! Undefined control sequence. \label #1->\@bsphack \begingroup \def \label@name

Here is my code. I guess there might be some clashes between packages. However, I do not know whether that is the case or what the clashes are. Is there an easy fix, please? In addition, how to modify the code for \include{} method in order to add mini content, please? Thank you!

\documentclass[a4paper, twoside, openright]{book}

  \newcommand{\blanknonumber}{\newpage\thispagestyle{empty}}

  \usepackage{graphicx}
  \usepackage{float}  

  % header and footer  
  \usepackage{fancyhdr}
  \fancyhead[ro, le]{}
  \fancyhead[lo]{\slshape\nouppercase{\rightmark}}
  \fancyhead[re]{\slshape\nouppercase{\leftmark}}
  \pagestyle{fancy} % Change page style to fancy
  \renewcommand{\headrulewidth}{0.2pt}
  \renewcommand{\footrulewidth}{0.2pt}

  % font
  \usepackage[T1]{fontenc}

  % chapter titles
  \usepackage[Glenn]{fncychap}

  % hyper links
  \usepackage{hyperref}

  % author-date reference
  \usepackage{natbib}

  % enumeration
  \usepackage{enumitem}

  % needed for chapter toc
  \usepackage{minitoc}  

\begin{document}

  \frontmatter

  \include{titlepage}\blanknonumber
  \dominitoc
  \tableofcontents\blanknonumber

  \mainmatter

  \include{chapter1}

\end{document}
  • The clash is with fncychap package – karlkoeller Jan 28 '15 at 8:26
  • @karlkoeller Is there a way to get around this, please? – LaTeXFan Jan 28 '15 at 8:28
4

The option Glenn for the package fncychap issues the command

\ChTitleUpperCase

to make the title of the chapter in upper case letters. This is incompatible with the minitoc package.

A solution is to issue

\ChTitleAsIs

just before loading fncychap. The drawback is that you will have to manually uppercase your chapter titles.

MWE

\documentclass[a4paper, twoside, openright]{book}

  \newcommand{\blanknonumber}{\newpage\thispagestyle{empty}}

  \usepackage{graphicx}
  \usepackage{float}

  % header and footer
  \usepackage{fancyhdr}
  \fancyhead[ro, le]{}
  \fancyhead[lo]{\slshape\nouppercase{\rightmark}}
  \fancyhead[re]{\slshape\nouppercase{\leftmark}}
  \pagestyle{fancy} % Change page style to fancy
  \renewcommand{\headrulewidth}{0.2pt}
  \renewcommand{\footrulewidth}{0.2pt}

  % font
  \usepackage[T1]{fontenc}

  % chapter titles
  \usepackage[Glenn]{fncychap}
  \ChTitleAsIs

  % hyper links
  \usepackage{hyperref}

  % author-date reference
  \usepackage{natbib}

  % enumeration
  \usepackage{enumitem}

  % needed for chapter toc
  \usepackage{minitoc}

\begin{document}

  \frontmatter

  \chapter{titlepage}\blanknonumber
  \dominitoc
  \tableofcontents\blanknonumber

  \mainmatter

  \chapter{chapter1}

\end{document} 

Output

enter image description here

|improve this answer|||||
  • The best option is avoiding fncychap. – egreg Jan 28 '15 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.