1

I have the next problem:

I am doing the final degree project and my school forces me to make chapters with a special pdf. The point is that I have added this pdf and it appears properly, but I still have the other page where the chapter appears \chapter{Chapter_1}. Now what I want is to delete this page but make it appear in the Table of Contents.

I do not know if it can be done just deleting the \chapter command and adding in some way to ToC or in any other way. I am sorry if this question is already done, but I have not been able to find it.

  • 1
    are you using pdfpages package? or better can you show us how the pdfs are included? – touhami Sep 23 '16 at 13:05
  • 1
    The two relevant commands might be \addcontentsline { ext }{ unit }{ text } and \addtocontents { ext }{ text } (where ext would be toc and unit would be chapter) ... but it's really hard to say since you've provided no code for us to examine. Please edit your question to include a minimal example (or see here). – jon Sep 23 '16 at 22:46
3

as jon said it : you can use \addcontentsline :

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usepackage{microtype}

\begin{document}
\tableofcontents
\chapter{TEST1}
\section{sec11}
\section{sec12}
\section{sec13}
\addtocounter{chapter}{1}
\addcontentsline{toc}{chapter}{\thechapter\hspace{2ex}TEST2}
\chapter{TEST3}
\section{sec31}
\section{sec32}
\section{sec33}
\end{document}

Using 2ex is not the best way ; I think you must use the titlesec package to be sure that it is the right spacing.

enter image description here

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.