2

I need to remove a string ("p.") that is appearing before each page number in the Table of Contents. I have this on the .sty file:

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

When I remove "p." from the following line:

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

I get this: "p." removed from upper levels

I was able to remove "p." from upper levels. How can I remove "p." from the lower levels?

These are the packages being used:

\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}
6
  • you need to do the same with \@dottedtocline command.
    – touhami
    Commented Mar 19, 2017 at 22:09
  • Where can we find this abnt class?
    – user31729
    Commented Mar 19, 2017 at 22:12
  • @ChristianHupfer: See mtm.ufsc.br/~krukoski/pub/Latex Commented Mar 19, 2017 at 22:18
  • abnt is a really old class -- why not use abntex2?
    – user9424
    Commented Mar 23, 2017 at 22:29
  • @Joseph I am using a model provided by my University. I changed only the strictly needed. But thank you for the advice.
    – Aline
    Commented Mar 25, 2017 at 0:21

1 Answer 1

1

You have to add the following redefinition to your style file:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .