TeX - LaTeX Asked on August 23, 2021
MWE:
documentclass[11pt,oneside]{book} % [text size]{document type}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{fancyhdr, blindtext} %for testing
usepackage{minitoc} % Get chapter level TOC
renewcommand{mtctitle}{TABLE OF CONTENTS}
dominitoc
setcounter{parttocdepth}{4} % set minitoc sublevel
setcounter{secnumdepth}{4} % to get X.X.X.X
mtcsetrules{*}{off}
begin{document}
chapter{SAMPLE CHAPTER }label{ch5}
minitoc{protectthispagestyle{fancy}}
section{My Section 1}
subsection{My Section 1 Subsection 1}
subsection{My Section 1 Subsection 2}
subsection{My Section 1 Subsection 3}
subsubsection{My Section 1 Subsection 3 Subsubsection 1}
section{My Section 2}
subsection{My Section 2 Subsection 1}
subsection{My Section 2 Subsection 2}
subsection{My Section 2 Subsection 3}
subsubsection{My Section 2 Subsection 3 Subsubsection 1}
end{document}
This produces:
So how do I get "Chapter 1 SAMPLE CHAPTER" on the same line and centered? I also need to center the Table of Contents and adjust the vertical spacing.
Thanks,
Matt
I didn't fully solve this. But I was able to get the Chapter Number and Chapter Title on the same line. Here's a MWE for it:
documentclass[11pt,oneside]{book} % [text size]{document type}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{fancyhdr, blindtext} %for testing
usepackage{minitoc} % Get chapter level TOC
usepackage{titlesec}
renewcommand{mtctitle}{TABLE OF CONTENTS}
dominitoc
setcounter{parttocdepth}{4} % set minitoc sublevel
setcounter{secnumdepth}{4} % to get X.X.X.X
mtcsetrules{*}{off}
titleformat{chapter} {largebfseries}{CHAPTER thechapter}{0em}{---}
titleformat{section} {normalfontbfseries}{thesection}{0em}{---}
titleformat{subsection} {normalfontbfseries}{thesubsection}{0em}{---}
titleformat{subsubsection}{normalfontnormalsizebfseries}{thesubsubsection}{0em}{---}
begin{document}
chapter{SAMPLE CHAPTER }label{ch5}
minitoc{protectthispagestyle{fancy}}
newpage
section{My Section 1}
subsection{My Section 1 Subsection 1}
subsection{My Section 1 Subsection 2}
subsection{My Section 1 Subsection 3}
subsubsection{My Section 1 Subsection 3 Subsubsection 1}
section{My Section 2}
subsection{My Section 2 Subsection 1}
subsection{My Section 2 Subsection 2}
subsection{My Section 2 Subsection 3}
subsubsection{My Section 2 Subsection 3 Subsubsection 1}
newpage
chapter{Next CHAPTER }label{ch6}
minitoc{protectthispagestyle{fancy}}
section{New Section 1}
subsection{New Section 1 Subsection 1}
subsection{New Section 1 Subsection 2}
subsection{New Section 1 Subsection 3}
subsubsection{New Section 1 Subsection 3 Subsubsection 1}
section{New Section 2}
subsection{New Section 2 Subsection 1}
subsection{New Section 2 Subsection 2}
subsection{New Section 2 Subsection 3}
subsubsection{New Section 2 Subsection 3 Subsubsection 1}
end{document}
Answered by Matt P on August 23, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP