2

I would like to elevate a little bit the position of the page number in the footer area of the MWE below in ConTeXt:

MWE

\setuppapersize [A4]

\setuplayout
  [header=0pt,
    margin=0pt,
    footerdistance=0cm,
    topspace=1cm,
    backspace=1cm,
    width=fit,
    height=\dimexpr\paperheight-\topspace+\footerheight+\footerdistance-2.3cm\relax]

\showframe
\showlayout
\showsetups


\setuppagenumbering [location={footer,middle}]
\setupfootertexts[{Page \pagenumber{} of \totalnumberofpages}]


\starttext
This is just a minimal working example to show the location of the page numbers in the footnote area.

\stoptext


%%% local Variables:
%%% mode: context
%%% TeX-master: t
%%% TeX-engine: luatex
%%% End:

Output

enter image description here

In latex, I used to achieve similar to this using the command \raisebox{0.6\baselineskip}{SomeTextToAdjust}. So what is the parallel approach in ConTeXt to raise the page number in footer area?

  • Why not raise the whole footer area in \setuplayout? – Henri Menke Jan 19 at 19:07
4

I think they are more straightforward ways to answer you question, but a wiki check suggested me this answer

\setuppapersize [A4]

\setuplayout
  [header=0pt,
   margin=0pt,
   footerdistance=0cm,
   topspace=1cm,
   backspace=1cm,
   width=fit,
   height=\dimexpr\paperheight-\topspace+\footerheight+\footerdistance-2.3cm\relax]

\startsetups[headertext]
  \startframed[frame=off,height=5ex,align={middle,lohi},width=fit]
    Page \pagenumber{} of \totalnumberofpages
  \stopframed
\stopsetups

\setupfootertexts[\directsetup{headertext}]
\showframe
\showlayout
\showsetups


%\setuppagenumbering [location={footer,middle}]
%\setupfootertexts[{Page \pagenumber{} of \totalnumberofpages}]


\starttext
This is just a minimal working example to show the location of the page numbers in the footnote area.

\stoptext

As you can see, playing with the frame height gives you some spare space, since we center the content inside the frame. Of course with a side-effect that you have also spare space above this text…

footer with 5ex height lohi frame

  • Thanks it worked. Please I would like to give some time to see if there are other solutions to the questions. – doctorate Jan 19 at 18:48
  • No problem, as I wrote I am sure there are more elegant ways to do it and will be happy to learn about them. – sztruks Jan 19 at 18:49
3

You could just raise the whole footer area instead.

\setuppapersize [A4]

\setuplayout
  [%horizontal
    margin=0pt,
    backspace=1cm,
    width=fit,
    %vertical
    topspace=1cm,
    header=0pt,
    height=fit,
    footerdistance=0cm,
    bottomspace=1cm]

\showframe
\showlayout
\showsetups


\setuppagenumbering [location={footer,middle}]
\setupfootertexts[{Page \pagenumber{} of \totalnumberofpages}]


\starttext

This is just a minimal working example to show the location of the page numbers in the footnote area.

\stoptext

enter image description here

1

The best solution when the footer text is too low and all pages is to change the page layout to mode the footer area upwards which can be done by decreasing the height of the text block.

When you don’t want to change the layout you can put the content of the footer in a frame and change the offset value for the bottom. To ensure the frame fills the whole footer area you have disable the strut setting with \setupfooter.

\setuppapersize [A4]

\setuplayout
  [backspace=1cm,
   width=middle,
   header=0pt,
   topspace=1cm,
   bottomspace=0.5cm,
   height=middle]

\showframe [text,footer] [text]

\setuppagenumbering
  [location=none]

\setupfooter
  [strut=no]

% \setupfootertexts
%   [{\framed
%       [frame=off,width=max,height=max,align={middle,low},offset=0pt,boffset=5mm]
%       {Page \realpagenumber\ of \lastrealpagenumber}}]

\setupfootertexts
  [{\framed
      [frame=off,width=max,height=max,align={middle,low},offset=0pt,boffset=5mm]
      {Page \realpagenumber\ of \lastrealpagenumber}}]

\starttext
This is just a minimal working example to show the location of the page numbers in the footnote area.
\stoptext

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.