How could I print the current page (of the section) and the total pages of a section, in the footer? Suppose the footer of page 20 reads

page 3 of 6 in section 5 (20)

because page 20 is the third page of section 5, which consists of 6 pages. @JamesT This is the minimum example I could do

\usepackage[spanish, es-noshorthands]{babel}
\usepackage{kantlipsum} % get some text
    \refstepcounter{dummy}\label{first}% store page number
\cfoot{\thepage\ of *TotalOfSection* en Actividad \thesection \rule[1mm]{1cm}{1pt} *current page* (*Total pages*)}


  • 1
    That depends on what packages you are using, which document class etc., could you edit a MWE into your question please? Just to show the document class and packages, are you using fancyhdr etc?
    – JamesT
    Feb 14 at 19:03
  • Closely related: tex.stackexchange.com/questions/469575/… Feb 15 at 4:21
  • Yes, closely related @JohnKormylo, but I can't access to de actual and the total page counter (I think lastpage will do it). I'm afraid that every approach I see, is based on modifying the existing page numbering. Unfortunately there are things on \latex programming that I simply don't understand.
    – JOM
    Feb 16 at 18:50
  • @JamesT \documentclass[a4paper,10pt]{article} , \usepackage{fancyhdr} and a bunch of other packages. the \thesection refuses to work in \lfoot, but worked in \cfoot. My work isis a collection of activities (every activity in an own \section) and information between semesters.
    – JOM
    Feb 16 at 18:58
  • There is probably a way to assist you but without seeing some code then it is impossible. Could you please edit into your question a small amount of code that we can compile and test please, otherwise there is no way to answer this sorry.
    – JamesT
    Feb 16 at 19:11

1 Answer 1


Finnally I combined two sources : [https://latex.org/forum/viewtopic.php?t=4623][1] and [https://latex.org/forum/viewtopic.php?t=33181][2] and

\fancyfoot[C]{\stepcounter{pageaux}pag. \thepageaux\ de \ref{\currentauxref} en sección \thesection  }
\rfoot{\thepage\ de \pageref{LastPage}}


\section{la primera}    
\section{la segunda}    
\section{la tercera}    

You must log in to answer this question.

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