I am trying to create a page with a quote from a famous physicist for my master's thesis. To do this I used the unchapter
command, which removes the chapter heading from the page, as I wanted, but adds this page to the TOC. I want the chapter heading not to appear on the page, but I also want to hide this chapter in the TOC. How can I do this?
The thesis is organized in several files that are "called" in a main file. I will put here the excerpts of the sections that are involved in this problem. In addition, before and after the page where the quote is written, there must be a blank page. The chapter "Dedicação", which corresponds to the famous quote should not appear in the TOC. How can I hide it?
File that gathers all the chapters:
\documentclass[11pt]{book}
\pagenumbering{gobble}
% Packages
\usepackage[a4paper,left=2.5cm,right=2.5cm,top=4cm,bottom=4.9cm]{geometry}
\renewcommand{\baselinestretch}{1.15}
\usepackage{graphicx,kantlipsum,setspace}
\usepackage{caption}
\captionsetup[table]{font={stretch=1,footnotesize}, labelfont=bf}
\captionsetup[figure]{font={stretch=1,footnotesize}, labelfont=bf}
\usepackage[font=bf]{caption}
\usepackage{mathrsfs}
\usepackage{slashed}
\usepackage{rotating}
\usepackage{indentfirst}
\usepackage{textcomp}
\usepackage{makecell}
\usepackage{mathtools,float,geometry}
\usepackage{booktabs,array,tabularx,threeparttablex}
\usepackage[portuguese]{babel}
\usepackage{subfig}
\usepackage[version=4]{mhchem}
\usepackage{comment}
\usepackage{float}
\usepackage{catoptions}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{adjustbox}
\usepackage{cite}
\usepackage{caption}
\usepackage{fontspec}
\usepackage{cite}
\usepackage{afterpage} % blank pages
\usepackage{multirow} % table
\usepackage{xpatch} % table
\usepackage{tabu} % table
\usepackage{hhline} % cell color does not overlap cell line
\usepackage{fancyhdr} % headers
\usepackage{breakcites} % references do not go though margins
\usepackage{sectsty} % change chapter title size
\setcounter{tocdepth}{3} % four level contents
\setcounter{secnumdepth}{3} % numbered four level contents
\usepackage{amsfonts} % math
\usepackage{amsmath} % math
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage{hyperref} % references
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage{fixmath}
\usepackage{scalerel}
\newlength\bshft
\bshft=.18pt\relax
\def\fakebold#1{\ThisStyle{\ooalign{$\SavedStyle#1$\cr%
\kern-\bshft$\SavedStyle#1$\cr%
\kern\bshft$\SavedStyle#1$}}}
\newlength\longest
\makeatletter
\newcommand{\unchapter}[1]{%
\begingroup
\let\@makechapterhead\@gobble % make \@makechapterhead do nothing
\chapter{#1}
\endgroup
}
\makeatother
\usepackage{tcolorbox}
\usepackage{amssymb}
\tcbuselibrary{theorems}
\newtcbtheorem
[]% init options
{definição}% name
{Definição}% title
{%
colback=gray!5,
colframe=gray!20!gray,
fonttitle=\bfseries,
}% options
{def}% prefix
\hypersetup{
colorlinks=true,
linkcolor=black,
filecolor=black,
citecolor=black,
urlcolor=black,
bookmarksopen=true,
linktocpage=true,
pdfpagemode=UseOutlines,
pdfstartpage=1
}
\newcommand\blankpage{
\null
\thispagestyle{empty}
\addtocounter{page}{-1}
\newpage}
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
\clearpage
{\pagestyle{empty}\origdoublepage}%
}
\geometry{footskip=1.2cm}
\begin{document}
\begingroup
\newgeometry{left=3cm, right=3cm, top=1cm, bottom=1.2cm}
\renewcommand{\baselinestretch}{1.9}
\include{parts/capa_definitiva}
\afterpage{\blankpage} %comentar para tirar paginas em branco
\endgroup
% Preamble for Thesis
\setmainfont{Times New Roman}
\newgeometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}
\renewcommand{\baselinestretch}{1.15}
\pagenumbering{Roman}
\pagestyle{plain}
\let\cleardoublepage\clearemptydoublepage % hide blank pages numbers + headers
\include{parts/agradecimentos}
\include{parts/dedicacao}
\include{parts/contents}
\include{parts/list_of_figures}
\afterpage{\blankpage} %comentar para tirar paginas em branco
% After Introductory Pages
\pagenumbering{arabic}
\pagestyle{fancy}
\newgeometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm,headsep=1cm}
\setlength{\headheight}{14pt}
\chaptertitlefont{\Huge} % to fit chapter title to one line
\chapternumberfont{\Huge}
\include{parts/introducao}
\end{document}
File named "Dedicação" with the famous quote:
\unchapter{Dedicação}
\clearpage
\vspace*{\fill}
\begin{quotation}
\textit{``Remember to look up at the stars and not down at your feet. Try to make sense of what you see and wonder about what makes the universe exist. Be curious. And however difficult life may seem, there is always something you can do and succeed at. It matters that you don't just give up.''}
\medskip
\raggedleft
\textbf{Stephen Hawking}
\end{quotation}
\vspace*{\fill}
makecell
, orfloat
anywhere in your use case for the dedication? No. So, remove those. Consider reading this: I've just been asked to write a minimal working example (MWE), what is that? For reference, look at the document I created in my answer. It doesn't use any package, since it's not necessary, and the answer is self-contained (no need to create an extra.tex
that you\include
).chapter*{}
, but in my case, the heading still appears, although in the TOC there is no longer the entry. However, your solution unlike Werner's solution preserves the numbering on the page. Could you put your hypothesis as an answer, please, but taking the heading out of the chapter?