TOC의 장 항목에 대한 장 접두어 작성

TOC의 장 항목에 대한 장 접두어 작성

Abstract, Declaration과 같은 머리말이 아닌 참고문헌 및 부록에 대해서만 장 항목에 접두사 "Chapter"를 추가할 수 있는 코드를 찾고 있습니다. 제가 찾고 있는 것은 아래에 있습니다. 나는 후보자 선언, 초록, 승인, LOF, LOT, 약어 목록 앞에 장이 인쇄되는 것을 원하지 않습니다. 챕터 이전에만 인쇄해야 합니다.

내가 사용한 것은 다음과 같습니다.

\makeatletter

% Per-section appendicies
\newcounter{Appx}
\numberwithin{Appx}{chapter}
\def\@Appx[#1]#2{
\refstepcounter{Appx}
\section*{%
\addcontentsline{toc}{section}{\appendixname\ \Alph{Appx}\quad#1}%
\appendixname\ \Alph{Appx}\quad#2}
}
\def\@@Appx#1{\@Appx[#1]{#1}}
\def\Appx{\@ifnextchar[\@Appx\@@Appx}

% "Chapter" prefix in ToC
\let\@@l@chapter\l@chapter
\def\l@chapter#1{\@@l@chapter{\chaptername\ #1}}

\makeatother

목차

답변1

당신 과 함께 titlese/titletoc라면 할 수 있습니다. 귀하의 질문에 표시된 형식을 모방하기 위해 etoolbox목차 자체를 포함하지 않도록 패키지를 로드해야 했습니다 . 환경 을 패치하는 것은 다소 복잡한 것 같으니 abstract, 명령어로 변환해 보시길 권해 드립니다 \chapter*. 나는 당신이 명령 report이 없는 클래스를 사용한다고 가정하여 \front/mainmatter\frontmatter에 로마자 번호 매기기를 사용하도록 제공했습니다. 실제로 저는 small caps로마자 번호 매기기(프랑스 타이포그래피의 오래된 전통)를 사용했지만 그렇지 않은 경우 쉽게 변경할 수 있습니다. 마음에 들지 않습니다.

    \documentclass[11pt, a4paper, twoside]{report}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{fourier}
    \usepackage{heuristica}
    \usepackage{microtype}

    \usepackage[pagestyles, explicit]{titlesec}%
    \usepackage{titletoc}%

    \usepackage{etoolbox}
    \newbool{addtoc}%initial value:  false
    \pretocmd{\lsstyle}{\SetTracking[no ligatures = {f}]{encoding = *}{50}}{}{}%

    \titleformat{name = \chapter}[display]%
    {\lsstyle\bfseries\Large\filcenter\vskip-4\baselineskip}
    {\LARGE\chaptername~\thechapter}
    {0.5pc}
    {\vspace{0.5pc}\Huge#1}%
    \titlespacing{\chapter}{0pt}{3\baselineskip}{8\baselineskip}

    \titleformat{name=\chapter, numberless}[display]
    {\vskip-4\baselineskip\lsstyle\bfseries\itshape\large\filcenter}
    {}
    {0.5pc}
    {\vspace{0.5pc}#1}%
    [\ifbool{addtoc}{\addcontentsline{toc}{chapter}{#1}}]%
     \titlespacing{name = \chapter, numberless}{0pt}{2\baselineskip}{8\baselineskip}

      \titlecontents{chapter}[0em]{\lsstyle\smallskip\bfseries}%\vspace{1cm}%
      {\contentslabel[\chaptername~\thecontentslabel]{0em}\hspace{5.6em}}%
      {\renewcommand\thecontentslabel{\relax}\itshape}%numberless%
      {\hfill\contentspage}[\medskip]%
    %
     \titlecontents{section}[4.25em]{\smallskip}%
      {\contentslabel[\thecontentslabel]{2em}}%numbered
      {\hspace*{-1em}}%numberless
      {\hfill\contentspage}[\smallskip]%
    %
     \titlecontents{subsection}[7em]{}%
      {\contentslabel[\thecontentslabel]{2.75em}}%numbered
      {\hspace*{-1em}}%numberless
      {\hfill\contentspage}[\smallskip]

    \renewcommand*{\contentsname}{\upshape TABLE OF CONTENTS \vspace{3\baselineskip}\par \hrule height 1pt\vskip1.5ex Contents\hfill Page No \vskip 1.5ex\par\hrule height 1pt\vskip -8\baselineskip}%
    \apptocmd{\tableofcontents}{\booltrue{addtoc}}{}{}

    \providecommand\frontmatter{\renewcommand\thepage{\scshape\mdseries\roman{page}}}%
    \providecommand\mainmatter{\clearpage\pagenumbering{arabic}}

    \begin{document}

    \frontmatter
    \tableofcontents

     \chapter*{Candidate’s Declaration}
     \chapter*{Abstract}
    \chapter*{Acknowledgments}
    \listoffigures
    \listoftables
    \chapter*{List of Abbreviations}

    \mainmatter

    \chapter{INTRODUCTION}

    \section{Motivation}
    \section{Introduction to Data Mining}
    \newpage

    \section{Steps for Knowledge Discovery in Databases Process}
    \section{Architecture of Data Mining System}
    \newpage

    \section{Datamining Techniques}
    \newpage

    \section{Classification}
    \subsection{Naive Bayes}
    \subsection{J48}
    \newpage

    \subsection{OneR}
    \subsection{ZeroR}
    \subsection{IBk (k nearest neighbor)}
    \section{Association Techniques}
    \section{Description of Heart disease dataset used in Experiment}

    \end{document}

여기에 이미지 설명을 입력하세요

관련 정보