Remova o número da página da peça e defina o espaço antes do número da página com tocbasic

Remova o número da página da peça e defina o espaço antes do número da página com tocbasic
  1. Gostaria de omitir o número da página das partes do sumário.

  2. O espaço entre ---( \mypagestyle) e o número da página é diferente, pois estão irregulares. O espaço deve ser sempre o mesmo.

`

\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}

insira a descrição da imagem aqui

Responder1

Defina tocpagenumberformatpara alterar (ou devorar) as caixas com os números das páginas:

\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}

Resultado:

insira a descrição da imagem aqui

informação relacionada