책갈피를 추가할 때 부품 위의 새 섹션이 충돌함: 작업 누락

책갈피를 추가할 때 부품 위의 새 섹션이 충돌함: 작업 누락

\book위에 섹션을 만드는 데 문제가 있습니다 \part. 모든 것이 잘 진행됩니다. ToC는 아름답습니다. bookmark패키지를 추가한 다음 \book.

지금까지 감사합니다@곤잘로 메디나그들의 대답을 위해이 질문[ \subsubsubsection][1]을 추가하는 데 도움이 필요한 경우@락스텝그들의 의견에 대해이 질문그것이 나를 패키지로 이끌었습니다 chngcntr.

\book위의 를 만들고 있기 때문에 문서에서 패키지 옵션을 설정 하고 모든 레벨을 처음부터 다시 정의해야 한다는 내용 \part을 읽었습니다 . 하지만 나머지 섹션은 있는 그대로 정말 마음에 듭니다!titlesecloadonlytitlesec

방금 찾았어요이 질문표준 클래스에 대한 섹션의 기본 형식과 간격을 사용합니다(덕분에@미오토!) 그러나 ToC 레벨 변경 을 위해 비트 \@startsection비트가 여전히 필요한지 잘 모르겠습니다 . 비트가 스스로 그렇게 합니까 ?\subsubsubsection\paragraph\subparagraph\toclevel@

누군가 이 MWE를 해결하도록 도와주거나 \@startsection방금 언급한 문제를 해석하는 데 도움을 줄 수 있습니까?

MWE:

\documentclass{book}

% this part breaks the whole thing at the first occurence of \book
\PassOptionsToPackage{bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,
            bookmarksopenlevel=6,
            colorlinks=true,
            linkcolor=blue,
            anchorcolor=blue
            }{hyperref}
\usepackage{bookmark}

\usepackage{titlesec,titletoc}
\usepackage{xparse}

\usepackage{chngcntr} % to change within of counters

% new book sectioning level
\titleclass{\book}[-2]{page}
\newcounter{book}
\renewcommand{\thebook}{\Roman{book}}
\titleformat{\book}{\centering\normalfont\huge\bfseries{}Volume \thebook\\\Huge}{}{0pt}{}
\titlespacing*{\book}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

% attach part counter to book
\titleclass{\part}{page}[\book]
\counterwithin*{part}{book}
\titleformat{\part}{\centering\normalfont\huge\bfseries{}Part \thepart\\\Huge}{}{0pt}{}

% fix chapter -- somehow above broke it?
\counterwithout{chapter}{part}
\counterwithin*{chapter}{part}

% to create a subsubsub section and have it work in between subsubsection
% and paragraph as a TOC placeholder:
\titleclass{\subsubsubsection}{straight}[\subsubsection]
\newcounter{subsubsubsection}[subsubsection]
\renewcommand\thesubsubsubsection{\thesubsubsection.\arabic{subsubsubsection}}
\titleformat{\subsubsubsection}{\normalfont\normalsize\bfseries}{\thesubsubsubsection}{1em}{}
\titlespacing*{\subsubsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

% attach paragraph counter to subsubsubsection
\renewcommand\theparagraph{\thesubsubsubsection.\arabic{paragraph}} % optional; useful if paragraphs are to be numbered
\counterwithout{paragraph}{subsubsection}
\counterwithin{paragraph}{subsubsubsection}

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{5}{\z@}%
  {3.25ex \@plus1ex \@minus.2ex}%
  {-1em}%
  {\normalfont\normalsize\bfseries}}
\renewcommand\subparagraph{\@startsection{subparagraph}{6}{\parindent}%
  {3.25ex \@plus1ex \@minus .2ex}%
  {-1em}%
  {\normalfont\normalsize\bfseries}}
% set toc levels
\def\toclevel@book{-2}
\def\toclevel@subsubsubsection{4}
\def\toclevel@paragraph{5}
\def\toclevel@subparagraph{6}
% set toc line styles
\def\l@book{\@dottedtocline{-2}{0em}{1.5em}}
\def\l@part{\@dottedtocline{-1}{3em}{1.5em}}
\def\l@chapter{\@dottedtocline{0}{6em}{1.5em}}
\def\l@section{\@dottedtocline{1}{9em}{2em}}
\def\l@subsection{\@dottedtocline{2}{12em}{3em}}
\def\l@subsubsection{\@dottedtocline{3}{15em}{3.5em}}
\def\l@subsubsubsection{\@dottedtocline{4}{18em}{4.5em}}
\def\l@paragraph{\@dottedtocline{5}{21em}{5.5em}}
\def\l@subparagraph{\@dottedtocline{6}{24em}{6.5em}}
\makeatother

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\begin{document}

\frontmatter
\tableofcontents
\mainmatter

\book{Explore}

\part{Intro}

\chapter{Welcome}
blah
\section{Stuff}
blah
\subsection{Dude}
blah
\subsubsection{Dudette}
blah
\subsubsubsection{Sweet}
blah
\paragraph{Hello}
blah
\subsubsubsection{Nice}
blah
\paragraph{Bye}
blah

\section{Things}
blah
\chapter{Goodbye}
blah
\section{Indeed}
blah

\book{Wander}

\part{Intro Again}

\chapter{Welcome Again}
blah
\section{Hmm}
blah

\end{document}

또한 수업을 시도해 보았지만 memoir시간을 투자할 가치가 없을 정도로 간격 설정이 너무 많습니다. 나는 내 문서의 나머지 부분을 있는 그대로 좋아하고, 수업을 계속 사용하면서 새 책에 계속해서 글을 쓰고 싶습니다 book.

시간 내 주셔서 감사합니다!

[1]: 를 새 에 chngcntr다시 연결하기 위해 를 사용해야 했지만 그 밖의 모든 것은 훌륭했습니다! 정말 도움이 되는 내용이에요!\paragraph\subsubsubsection

답변1

(대부분) 모든 단면화 명령에는 헤더 표시를 설정하는 명령이 함께 제공됩니다. 예를 들어 \chaptermark, \sectionmark, 가 있습니다 \subsectionmark. titlesec새로운 단면 명령을 설정할 때 \...mark 명령도 정의합니다. 그래서 북마크 패키지의 명령 명령과 충돌하는 을 \book생성합니다 .\bookmark\bookmark

예를 들어 다른 이름을 사용하면 \volume문제가 해결됩니다.

bookmark로드 hyperref되므로 일반적으로 다른 모든 패키지(몇 가지 예외 제외) 다음에 로드되어야 하지만 새 카운터를 정의하기 전에 로드되어야 합니다.

관련 정보