토크를 둘로 나누는 방법은 무엇입니까?

토크를 둘로 나누는 방법은 무엇입니까?

나는 내 논문을 다음과 같은 방식으로 "이론"과 "실습"이라는 두 가지 주요 부분으로 나누고 싶습니다.

1) "이론"과 "실습"이 PDF의 주요 북마크로 나타납니다.

2) 콘테스트 표는 두 개로 나누어져 있으므로 PDF에서 다음을 볼 수 있습니다.

이론

콘테스트 표 (이론)

...

관행

콘테스트 표 (연습)

아래 코드를 사용하세요.

    \begin{document}

    \frontmatter
    \title{Title}

    \maketitle

    % Here I want to place "Theory" that appears as a bookmark and it is placed in the pdf
    % before the first toc and embrace all the parts below up except "Practice"

    % Here I want to place the toc of "Theory"

    \mainmatter

    \chapter*{Preface\label{SecPreface}}

    \markboth{Preface}{Preface}

    %TCIMACRO{%
    %\TeXButton{AddToTableOfContents}{\addcontentsline{toc}{chapter}{Preface}}}%
    %BeginExpansion
    \addcontentsline{toc}{chapter}{Preface}%
    %EndExpansion

    \part{Part 1}

    \part{Part 2}

    \part{Part 3}

    %TCIMACRO{%
    %\TeXButton{settings TOC}{\cleardoublepage
    %\phantomsection
    %\addcontentsline{toc}{part}{Bibliography}} }%
    %BeginExpansion
    \cleardoublepage
    \phantomsection
    \addcontentsline{toc}{part}{Bibliography}
    %EndExpansion
    \bibliographystyle{apalike}
    \bibliography{finance}

    %TCIMACRO{%
    %\TeXButton{settings TOC}{\cleardoublepage
    %\phantomsection
    %\addcontentsline{toc}{part}{List of Figures}} }%
    %BeginExpansion
    \cleardoublepage
    \phantomsection
    \addcontentsline{toc}{part}{List of Figures}
    %EndExpansion
    %TCIMACRO{\TeXButton{List of Figures}{\listoffigures}}%
    %BeginExpansion
    \listoffigures%
    %EndExpansion

    \chapter*{Notation}

    \markboth{Notation}{Notation}

    \addcontentsline{toc}{part}{Notation}

    \bookmarksetup{startatroot}

    % Here I want to place "Practice" that appears as a bookmark and it is placed in the pdf
    % before the second toc and embrace all the parts below 

    % Here I want to place the toc of "Practice"

    \part{Case study 1}

    \part{Case study 2}

    \end{document}

답변1

\superparts다음 은 OP의 이전 질문에 대한 후속 코드입니다.

\localtableofcontents사용해야 할 새로운 것이 있습니다~ 후에 \superpart. 물론 \localcontentsname추가되는 것과 같은 구성도 있습니다.

\documentclass{book}
\usepackage{xcolor}
\usepackage{xparse}
\usepackage{xpatch}

\newcounter{superpart}

\makeatletter
\newcommand{\superpart@@tocname}[1]{%
  \arabic{#1}toc%
}

\xpatchcmd{\@part}{%
  \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
}{%
  \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
  \addcontentsline{\superpart@@tocname{superpart}}{part}{\thepart\hspace{1em}#1}%
}{\typeout{Patched @part}}{}


\xpatchcmd{\@chapter}{%
  \addcontentsline{toc}{chapter}{% 
    \protect\numberline{\thechapter}#1}%
}{%
  \addcontentsline{toc}{chapter}{% 
    \protect\numberline{\thechapter}#1}%
  \addcontentsline{\superpart@@tocname{superpart}}{chapter}{%
    \protect\numberline{\thechapter}#1}%
}{\typeout{Patched chapter}}{}

\xpatchcmd{\@sect}{%
  \addcontentsline{toc}{#1}{%
    \ifnum #2>\c@secnumdepth \else
    \protect\numberline{\csname the#1\endcsname}%
    \fi
    #7}%
}{%
  \addcontentsline{toc}{#1}{%
    \ifnum #2>\c@secnumdepth \else
    \protect\numberline{\csname the#1\endcsname}%
    \fi
    #7}%
  \addcontentsline{\superpart@@tocname{superpart}}{#1}{%
    \ifnum #2>\c@secnumdepth \else
    \protect\numberline{\csname the#1\endcsname}%
    \fi
    #7}%
}{\typeout{Patched @sect}}{}


% This is the standard latex kernel \@starttoc, it's not necessary if `book.cls` is used, but for `memoir.cls` etc. 
\def\latex@starttoc#1{%
  \begingroup
  \makeatletter
  \@input{\jobname.#1}%
  \if@filesw
  \expandafter\newwrite\csname tf@#1\endcsname
  \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
  \fi
  \@nobreakfalse
  \endgroup
}



\newcommand{\localtableofcontents}{%
  \chapter*{\contentsname
    \@mkboth{%
      \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
  \latex@starttoc{\superpart@@tocname{superpart}}% 
}
\makeatother

\NewDocumentCommand{\superpart}{om}{%
  \cleardoublepage%
  \refstepcounter{superpart}%
  \phantomsection%
  \hypertarget{superpart::\number\value{superpart}}{}%
  \IfValueTF{#1}{%
    \bookmark[startatroot,level=-2,bold,color=red,dest=superpart::\number\value{superpart}]{#1}%
  }{%
    \bookmark[startatroot,level=-2,bold,color=red,dest=superpart::\number\value{superpart}]{#2}%
  }%
}



\usepackage[bookmarksopen=true]{hyperref}
\usepackage{bookmark}


\begin{document}

\superpart{Theory}
\localtableofcontents 
\part{Number One}
\chapter{First chapter}
\part{Number Two}

\chapter{Second chapter}



\superpart{Practice}
\localtableofcontents
\part{Number Three}
\chapter{Three}
\part{Number Four}
\chapter{Four}


\end{document}

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

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

답변2

다음은 두 가지 해결 방법입니다.

minitoc 패키지 포함

\documentclass{book}
\usepackage{minitoc}

\usepackage{blindtext}

\begin{document}‎‎
\doparttoc

\part{Theory}
\renewcommand{\ptctitle}{\contentsname\ (Theory)}
\parttoc
\blinddocument
\blinddocument

\part{Practice}
\renewcommand{\ptctitle}{\contentsname\ (Practice)}
\parttoc

\blinddocument
\blinddocument
\end{document}

titletoc(titlesec) 패키지 포함(업데이트됨)

\documentclass{book}

\usepackage{titletoc}
\usepackage{hyperref}

\usepackage{blindtext}
\begin{document}
\tableofcontents


%---------------- Theory part
\part*{Theory}
\addcontentsline{toc}{part}{Theory}
\startcontents
\printcontents{}{-1}{%
       \chapter*{\contentsname\ (Theory)}%
       \markboth{\MakeUppercase{\contentsname\ (Theory)}}%
                {\MakeUppercase{\contentsname\ (Theory)}}}
%----------------

\part{Firstst theory test}
\blinddocument
\blinddocument

\part{Last theory test}
\blinddocument
\blinddocument


%---------------- Practice part
\stopcontents
\part*{Practice}
\addcontentsline{toc}{part}{Practice}
\startcontents
\printcontents{}{-1}{%
       \chapter*{\contentsname\ (Practice)}%
       \markboth{\MakeUppercase{\contentsname\ (Practice)}}%
                {\MakeUppercase{\contentsname\ (Practice)}}}
%---------------- 

\part{Firstst practice test}
\blinddocument
\blinddocument

\part{Last practice test}
\blinddocument
\blinddocument


\stopcontents

\end{document}

글로벌 목차 여기에 이미지 설명을 입력하세요

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

관련 정보