-1

Lads,

I want to make a Table of Contents as show in. I've been using the default option, but it is not what I'm looking for.

this is what I want:

I. PART ONE
 I. Chapter one
  1. subsection A
  2. subsection B
 II. Chapter two
  1. subsection A
  2. subsection B
II. PART TWO
 I. Chapter one
  1. subsection A
  2. subsection B
 II. Chapter two
  1. subsection A
  2. subsection B

example:

enter image description here

my problem lies not in the structure of the book, but in the Table of Contents. For example, Parts are noted as "1", Chapters are noted as "1.1", and Subsections as "1.1.1". The core of my problem is only referencing Contents, not the overall structure of the book.

I'd appreciate your help

my code:

\documentclass[10pt]{book}
\usepackage[width=3.93in, height=6.49in, top=1.0in, papersize={5.5in,8.2in}]{geometry}
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\usepackage[english]{babel}
\usepackage[pdftex]{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tipa}
\usepackage{setspace}
\usepackage [utf8]{inputenc}
\usepackage{subfiles}
\usepackage{textcomp}
\usepackage{blindtext}
\renewcommand{\thechapter}{\Roman{chapter}}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{xpatch}
\usepackage{blindtext}
\makeatletter
\renewcommand\part{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \thispagestyle{empty}%
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
  \null\vfil
  \secdef\@part\@spart}
\makeatother
%%%%%% CENTERED CHAPTER%%%%%%%
\usepackage{sectsty}
\chapterfont{\Large \centering}
\sectionfont{\normalsize \centering}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fancyhf{}
\lfoot[\thepage]{}
\rfoot[]{\thepage}
\setcounter{tocdepth}{3}
\fancypagestyle{plain}{% % <-- this is new
  \fancyhf{} 
  \fancyfoot[LE,RO]{\thepage} % same placement as with page style "fancy"
  \renewcommand{\headrulewidth}{0pt}}
  \usepackage{etoolbox}
\begin{document}
\include{cover} 
\restoregeometry
\pagenumbering{gobble}
\thispagestyle{empty}
\frontmatter
\mainmatter
\part{Part1}
\chapter{A}
\chapter{B}
\chapter{C}
\part{Part2}
\chapter{A}
\chapter{B}
\chapter{C}
\end{document}
Chanchy
  • 13

1 Answers1

0

It's not clear to me how exact to take your specification: do you want section headings to also omit the chapter number? Do you want the periods to appear after the numbers? This assumes yes and no, respectively.

\documentclass[10pt,openany]{book}
\counterwithin{chapter}{part}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\begin{document}
\tableofcontents
\part{Part1}
\chapter{A}\section{One}\section{Two}
\chapter{B}\section{One}\section{Two}
\chapter{C}\section{One}\section{Two}
\part{Part2}
\chapter{A}\section{One}\section{Two}
\chapter{B}\section{One}\section{Two}
\chapter{C}\section{One}\section{Two}
\end{document}

code table of contents

Some other things to note:

  1. The level below \chapter is \section, not \subsection
  2. There was a lot of code that wasn't relevant to your example. It would have helped us understand things better if you'd taken that out.
  3. Even with all of your code, it didn't include the \tableofcontents nor any \(sub)sections.
Teepeemm
  • 6,708