
\book
上のセクションを作成するときに問題が発生しています\part
。すべて順調に進み、ToC も美しく表示されますが、bookmark
パッケージを追加すると、 を初めて使用したときに「アクションがありません」というエラーでクラッシュします\book
。
これまでのところ感謝します@ゴンサロ・メディナ彼らの答えはこの質問[ \subsubsubsection
][1] を追加して@ロックステップコメントをありがとうこの質問それが私をchngcntr
パッケージへと導いたのです。
\book
上記を作成しているので、ドキュメントには、パッケージ オプションを実行して、すべてのレベルを最初から再定義する必要があると\part
記載されています。ただし、残りのセクションはそのままで本当に気に入っています。titlesec
loadonly
titlesec
見つけたこの質問標準クラスのセクションのデフォルトの書式と間隔(ミオット!) ですが、変更や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
。
お時間をいただきありがとうございました!
chngcntr
[1]:を\paragraph
新しい に再リンクするためにを使用する必要がありました\subsubsubsection
が、それ以外はすべて素晴らしかったです。本当に役立つ情報です!
答え1
(ほぼ) すべてのセクション コマンドには、ヘッダーのマークを設定するための付随コマンドがあります。たとえば\chaptermark
、、があります\sectionmark
。が新しいセクション コマンドを設定する\subsectionmark
と、 コマンドも定義されます。そのため、はブックマーク パッケージのコマンド コマンドと競合するを作成します。titlesec
\...mark
\book
\bookmark
\bookmark
別の名前を使用すると、\volume
問題は解決します。
bookmark
ロードされるhyperref
ため、通常は他のすべてのパッケージの後にロードする必要があります (いくつかの例外を除く)、ただし新しいカウンターを定義する前にロードする必要があります。