4

Is this a realistic request?

\documentclass{article}
\usepackage[
    paperwidth=32pc,%
    paperheight=48pc,%
    margin=5pc,%
]{geometry}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}

This is a sentence.\footnote{This is a footnote.}

\end{document}

Is it possible to make the bottom section of the page colored if there is footnote and with respect footnote size?

enter image description here

If not, or if it is too much of a hack, is it possible to insert a custom box at the bottom of the page so as to achieve the desired effect? (I put the black border just to make the page more visible.)

5

You can try something like this (it can need a few compilation to set down). It should work also will split footnotes.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc}
\usepackage[
    paperwidth=32pc,%
    paperheight=48pc,%
    margin=5pc,%
]{geometry}
\usepackage{libertine}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{eso-pic}
\usepackage{lipsum}
\makeatletter
\renewcommand\footnoterule{%
  \kern-3\p@
  \pgfmark{fn-\thepage}\hrule\@width.4\columnwidth
  \kern2.6\p@}
\begin{document}
\AddToShipoutPictureBG{%
\iftikzmark{fn-\thepage}{\tikz[overlay,remember picture]\fill[blue!50!white]($({pic cs:fn-\thepage} -| {current page.west})+(0,2pt)$) rectangle (current page.south east);}{}}

  This is a sentence.\lipsum[2-3]\footnote{This is a footnote.\lipsum[1-4]}

  \lipsum[1-4] \lipsum[1-4]
   \footnote{this is a footnote} \footnote{footnote}

\end{document}

enter image description here

  • Thank you for the quick response. How can I remove the footnote rule? \renewcommand*\footnoterule{} works but disables your solution. I tried to change the color of the rule to the fill color, but that changed font color also. – blackened May 2 '18 at 18:02
  • 1
    Set the width of the hrule to zero \hrule\@width 0pt. – Ulrike Fischer May 2 '18 at 18:07

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.