I'm trying to get titlesec to put the title of each chapter, section and subsection in a different page. Right now, I'm close, but there are two problems:
- titles show up twice in the index
- the index also is affected by the settings and its title is in a different page
Any help would be appreciated.
Cheers.
Code: Select all
% !TeX spellcheck = es_ES
\documentclass[12pt,a4paper,oneside]{book}
\usepackage[spanish,activeacute]{babel}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}
\usepackage[bf,big,center]{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\filcenter\sffamily}
{\thechapter}
{1pc}
{\titlerule
\vspace{1pc}%
\Huge}
[\newpage] % creates the new page
\titleformat{\section}
{\vspace*{\fill}\centering\normalfont\Large\bfseries}
{\thechapter.\Alph{section}}
{1em}
{\Large}
[\vspace*{\fill}\newpage]
\titleformat{\subsection}
{\vspace*{\fill}\centering\normalfont\Large\bfseries}
{\thechapter.\Alph{section}.\arabic{subsection}}
{1em}
{\Large}
%[\vspace*{\fill}\newpage]
\titleformat{\subsubsection}
{\vspace*{\fill}\centering\normalfont\Large\bfseries}
{}
{1em}
{\Large}
[\vspace*{\fill}]
%[\vspace*{\fill}\newpage]
\makeindex
%\renewcommand{\thesubsection}{\thesection.\alph{subsection}}
\renewcommand{\thesection}{\thechapter.\Alph{section}}
\renewcommand{\thesubsection}{\thechapter.\Alph{section}.\arabic{subsection}}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{2}
\begin{document}
\pagenumbering{roman}
\pagestyle{headings}
\vspace*{6cm}
\thispagestyle{empty}
\begin{huge}
\begin{center}
\textbf{Title}
\end{center}
\end{huge}
\vspace*{4cm}
\begin{Large}
\begin{center}
Mr. Foo
\end{center}
\end{Large}
\vspace*{2cm}
\begin{small}
\begin{center}
\today
\end{center}
\end{small}
\tableofcontents{}
\pagenumbering{arabic}
\renewcommand{\chaptername}{}
\chapter{Chapter Title}
\section{Section Title}
\subsection{Subsection Title}
\end{document}