I need to insert three images into header in ConTeXt and specific info in the footer.

The equivalent snippet in LaTeX is:

\rfoot{Page \thepage\ of \pageref{LastPage}}

I would also have a line after header and before footer (LaTeX snippet doesn't do that).

NOTE: I'm a complete ConTeXt newbie and I'm struggling to catch up.

  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}.
    – BambOo
    Commented Aug 7, 2018 at 15:57

2 Answers 2


This will probably get you on track. You can use the setup commands to define your header and footer commands and then apply them using the appropriate command for header of footer respectively.

I have left the page layout to you (margins etc.), but it's not that hard to figure it out, because the ConTeXt wiki pages are very descriptive.




  \llap{Page \pagenumber\ of \lastpagenumber}

  • For the lines have a look at the \setupbackgrounds command.
    – TeXnician
    Commented Aug 7, 2018 at 16:17

Here is a slightly different solution than TeXnician's:





\setupfootertexts[title][Page \pagenumber\ of \lastpagenumber]

\setupbackgrounds[header][text][bottomframe=on, frameoffset=\measure{ruledistance}]
\setupbackgrounds[footer][text][topframe=on,    frameoffset=\measure{ruledistance}]

\starttitle[title=My sample document]

Some comments:

  • I define measures for lengths that are used multiple times in the document.
  • I use defineexternalfigure to specify figure settings that are shared by multiple figures.
  • I use the two argument version of \setupheadertexts[][] rather than manual alignment. This is similar in spirit to the fancyhdr package.
  • The marking for the current title is automatically stored as title. So you don't need to define a new macro to store its value. It can also be retrieved using \getmarking[title].

You must log in to answer this question.

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