Hi I am trying to hide all \Chapter \section and \subsection headers and titles utilising the solution given here Hide part and chapter headings
I have also looked at other possible solutions but they don't maintain the integrity of the toc, therefore this solution appears the most suitable. However, I cannot get the solution to work even using an MWE as it throws up \hide as an Undefined control sequence. ^^I\hide.
Would someone be able to help please? Here is a copy of my MWE.
\documentclass[a4paper, 12pt ]{report}
\usepackage[explicit]{titlesec}
\newcommand*\Hide{%
\titleformat{\chapter}[display]
{}{}{0pt}{\Huge}
\titleformat{\part}
{}{}{0pt}{}
}
\usepackage{fontspec}
\setmainfont{FreeSerif}
\setsansfont{FreeSans}
\setmonofont{FreeMono}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguages{greek,hebrew}
\begin{document}
{
\hide
\chapter{Introduction}
\section{Background Statement}
}
\end{document}
\Hidebut use\hide. – Peter Wilson Jun 29 '20 at 16:40