TransWikia.com

Minitoc Chapter and Title on Same Line and Centered. Center TOC, also

TeX - LaTeX Asked on November 16, 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:

enter image description here

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

One Answer

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}

And that gets this done: enter image description here

Answered by Matt P on November 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP