1

There are several problems which I am dealing with.

Basically, I want to eliminate "Chapter 1" from the title of my introduction. In order to do that, I used

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{\textbf{Introduction}}

The problem with this approach is that it does not change the headers, which remain the ones of the previous section ("Contents").

It should be noted that I have changed both the title and the headers format.

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

\usepackage{titlesec}
\usepackage{fancyhdr}


\titleformat{\chapter}[display]
{\vspace*{-10ex}\Large}
{\thispagestyle{empty}\titleline[l]{\chaptertitlename\ \thechapter}\vspace{6pt}\titlerule[.8pt]}    {\dimexpr-\baselineskip+6pt\relax}
{\LARGE\bfseries\filleft}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LE,RO]{\thepage}

\begin{document}

\nocite{*}
\maketitle
\cleardoublepage\null\newpage
\tableofcontents


\chapter*{Introduction}
\addcontentsline{toc}{chapter}{\textbf{Introduction}}

\end{document}

Do you know how to solve this issue?

Furthermore, is it possible to restore the classic title format only for the introduction?

2 Answers2

2

Change the value of secnumdepth locally, you won't even have to use \addcontentsline:

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

\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{lipsum} 

\titleformat{\chapter}[display]
{\vspace*{-10ex}\Large}
{\thispagestyle{empty}\titleline[l]{\chaptertitlename\ \thechapter}\vspace{6pt}\titlerule[.8pt]} {\dimexpr-\baselineskip+6pt\relax}
{\LARGE\bfseries\filleft}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LE,RO]{\thepage}

\begin{document}

\nocite{*}
%\maketitle
%\cleardoublepage\null\newpage
\tableofcontents

\setcounter{secnumdepth}{-1}
\chapter{Introduction}    
\setcounter{secnumdepth}{2}    \chapter{First Chapter}
\lipsum

\end{document}

enter image description here Added: To have the unnumbered chapters titles flush left, add this code to your preamble:

\titleformat{name=\chapter, numberless}[block]
{\vspace*{-10ex}\LARGE\bfseries\filright}
{} {0pt}
{\thispagestyle{empty}}

enter image description here

Bernard
  • 271,350
1

I would use package unnumeredtotoc as seen in the LaTeX wikibook.

\addchap{Introduction} takes care of the toc entry and the corresponding header.

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

\usepackage{titlesec}
\usepackage{fancyhdr}


\titleformat{\chapter}[display]
{\vspace*{-10ex}\Large}
{\thispagestyle{empty}\titleline[l]{\chaptertitlename\ \thechapter}\vspace{6pt}\titlerule[.8pt]}    {\dimexpr-\baselineskip+6pt\relax}
{\LARGE\bfseries\filleft}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LE,RO]{\thepage}
\setlength{\headheight}{14.5pt}

\usepackage{blindtext}
\usepackage{unnumberedtotoc}% <--------------
\begin{document}

\tableofcontents


\addchap{Introduction}% <--------------
\blindtext[10]

\end{document}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248