
TOC에서 부품의 페이지 번호를 생략하고 싶습니다.
---
(\mypagestyle
)와 페이지 번호 사이의 간격은 너덜너덜하여 다릅니다. 공간은 항상 동일해야 합니다.
`
\documentclass[ngerman,twoside=false]{scrbook}
\def\mypagestyle{\,\mbox{---}\,}
\RedeclareSectionCommands[
tocraggedpagenumber,
toclinefill={\footnotesize\mypagestyle},
tocindent=0em,
tocnumwidth=4em,
]{chapter,section,subsection,subsubsection,paragraph}
\RedeclareSectionCommand[
,tocentryformat=\large\scshape%
,tocindent=0em
,tocnumwidth=4em
]{part}
\RedeclareSectionCommand[%
,tocentryformat=\textbf,%
]{chapter}
\begin{document}
\tableofcontents
\part{part}
\chapter{chapter chapter}
\section{section section section} \section{section section section} \section{section section section}
\part{part}
\chapter{chapter chapter}
\section{section section section} \section{section section section} \section{section section section}
\setcounter{page}{100}
\part{part}
\chapter{chapter chapter}
\section{section section section} \section{section section section} \section{section section section}
\end{document}
답변1
tocpagenumberformat
페이지 번호가 있는 상자를 변경(또는 중얼)하도록 설정합니다 .
\documentclass[ngerman,twoside=false]{scrbook}
\newcommand\gobble[1]{}% <- added
\newcommand\tocpageseparator{\footnotesize\,\mbox{---}\,}
\newcommand\tocpagenumberbox[1]{\mbox{#1}}% <- added
\RedeclareSectionCommands[
tocraggedpagenumber,
toclinefill=\tocpageseparator,
tocindent=0em,
tocnumwidth=4em,
tocpagenumberbox=\tocpagenumberbox% <- added
]{chapter,section,subsection,subsubsection,paragraph}
\RedeclareSectionCommand[
tocentryformat=\large\scshape,
tocindent=0em,
tocnumwidth=4em,
tocpagenumberbox=\gobble% <- added
]{part}
\RedeclareSectionCommand[%
tocentryformat=\textbf%
]{chapter}
\begin{document}
\tableofcontents
\part{part}
\chapter{chapter chapter}
\section{section section section} \section{section section section} \section{section section section}
\part{part}
\chapter{chapter chapter}
\section{section section section} \section{section section section} \section{section section section}
\setcounter{page}{100}
\part{part}
\chapter{chapter chapter}
\section{section section section} \section{section section section} \section{section section section}
\end{document}
결과: