从目录中删除“p.”

从目录中删除“p.”

我需要删除目录中每个页码前面的字符串(“p.”)。我在 .sty 文件中有以下内容:

%table of contents
\renewcommand\@dotsep{2}

\renewcommand\l@chapter[2]{
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
  \ifthenelse{\boolean{ABNTpagenumstyle}}
    {\renewcommand{\@pnumwidth}{3.5em}}
    {}
  \parindent \z@ \rightskip \@pnumwidth
  \parfillskip -\@pnumwidth
  \leavevmode \normalsize\ABNTtocchapterfont
  \advance\leftskip\@tempdima
  \hskip -\leftskip
  #1\nobreak\dotfill \nobreak%
  \ifthenelse{\boolean{ABNTpagenumstyle}}
     {%
      \hb@xt@\@pnumwidth{\hss 
        \ifthenelse{\not\equal{#2}{}}{{\normalfont p.\thinspace#2}}{}}\par
     }
     {%
      \hb@xt@\@pnumwidth{\hss #2}\par
     }
  \penalty\@highpenalty
\endgroup
\fi}

\renewcommand*\l@section{\@dottedtocline{1}{0em}{2.3em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{0em}{3.2em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{0em}{4.1em}}

当我从以下行中删除“p.”时:

\ifthenelse{\not\equal{#2}{}}{{\normalfont p.\thinspace#2}}{}}\par

我明白了: “p.”已从上层移除

我能够从上层移除“p”。如何从下层移除“p”。

这些是正在使用的包:

\documentclass[tocpage=plain,espaco=simples,appendix=Name]{abnt}
\usepackage[latin1]{inputenc}
\usepackage[brazil]{babel}
\usepackage{hyperref}
\usepackage[alf]{abntcite}
\usepackage{mdwlist}
\usepackage{dsfont}
\usepackage{graphicx}    
\usepackage{uff} % the .sty file
\usepackage[pagewise]{lineno}
\usepackage{longtable}

答案1

您必须将以下重新定义添加到您的样式文件中:

\renewcommand{\@dottedtocline}[5]{%
  \ifthenelse{\boolean{ABNTpagenumstyle}}
     {%
      {\renewcommand{\@pnumwidth}{2.5em}%
       \renewcommand{\@tocrmarg}{3.5em}
       \old@dottedtocline{#1}{#2}{#3}{#4}%
             {\ifthenelse{\equal{#5}{}}{}{\thinspace#5}}}%
     }%
     {\old@dottedtocline{#1}{#2}{#3}{#4}{#5}}%
}

相关内容