5

I'm trying to put draw lines around the footer area and put some text at the center bottom of the area. I've been trying variations of the below for a while now:

\showframe

\defineframed[FooterSection]
    [
        width=\makeupwidth,
        height=broad,
        location=bottom,
        frame=on,
        rulethickness=3pt
    ]

\setupfootertexts[\FooterSection{Some text}]

\starttext
    Hello.
\stoptext

This gives me the following:

enter image description here

I haven't found some combination of height and location or other parameters I've discovered to give me the desired effect. As it is, the box is too short, but the text is in the right place. How do I extend the height so it goes to the top of the footer area?

  • You can use height=\footerheight to make the box as high as the footer. If the contents don't change you can use boffset to move it downwards (this is not automic, though), e.g.boffset=-0.5\footerheight gives good results in your MWE. (I don't really know ConTeXt) – Skillmon Nov 26 '18 at 16:07
6

Use the full footer, but re-align the content.

\showframe

\defineframed[FooterSection]
    [width=max,
     height=max,
     location=bottom,
     align={low,middle},
     frame=on,
     rulethickness=3pt]

\setupfootertexts[\FooterSection{Some text}]

\starttext
    Hello.
\stoptext
  • 1
    width=max and height=max is more expressive and you are missing a comma after rulethickness=3pt (in this case it does not matter but most of the time it does). – Henri Menke Nov 26 '18 at 21:30
  • @HenriMenke I have edited my answer. – TeXnician Nov 27 '18 at 7:44
6

Just enable the frame around the footer using \setupbackgrounds. This does not require to specify the alignment manually, doesn't screw with the existing baseline, and does not require you to wrap the footer content into a macro.

\setupbackgrounds
  [footer]
  [text]
  [frame=on]

\setupfootertexts[Some text]

\starttext

Hello World!

\stoptext

enter image description here

5

You can use the max value for the width and height keys to use the available space for the frame. Another setting you have to do is to disable the strut for the footer setup, otherwise the frame won’t fill the complete vertical area of the footer.

\showframe

\startsetups [footer]
  \startframed [width=max,height=max,align={middle,low},rulethickness=3pt]
    Some text
  \stopframed
\stopsetups

\setupfooter [strut=no]

\setupfootertexts[\texsetup{footer}]

\starttext
Hello.
\stoptext

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.