TransWikia.com

Force footnotes to bottom of page in plain TeX

TeX - LaTeX Asked by IsuzuGawa on February 2, 2021

I have a large (~3000 pages) document typeset using plain TeX plus some local macros. The document uses the plain TeX footnote macro for footnotes. The document also uses raggedbottom. This means that footnotes on shorter pages are attached to the bottom of the text block. Ideally I’d like the footnotes on such pages to be flush with the bottom of the page.

While Looking for solutions I found that the LaTeX command usepackage[bottom]{footmisc} would do exactly what I need, were I using LaTeX. Can anyone suggest how I could get this function by modifying the plain TeX macros?

I’m fairly comfortable with modifying TeX’s output routine, but vfootnote and fontmisc have defeated me.


Just to fix ideas, here’s an MWE which currently fails to place the footnotes at the bottom of the text block.

enter image description here

raggedbottom

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do 
eiusmod tempor incididunt ut labore et dolore magna 
aliqua.footnote{*}{This footnote should be at bottom of the 
text block.} Ut enim ad minim veniam, quis nostrud exercitation 
ullamco laboris nisi ut aliquip ex ea commodo consequat. 

Duis aute irure dolor in reprehenderit in voluptate velit 
esse cillum dolore eu fugiat nulla pariatur.footnote{**}{A 
second footnote.} Excepteur sint occaecat cupidatat non 
proident, sunt in culpa qui officia deserunt mollit anim id 
est laborum.

eject % important: not "vfilleject"
end

2 Answers

You'll probably want to redefine footnoterule and add some vertical fill at that location on the page content. Try this:

raggedbottom
deffootnoterule{vfill % added this
   kern-3pthrule width 2truein kern 2.6pt} % the hrule is .4pt high

Lorem ipsumfootnote *{This footnote should be at the bottom of 
the textblock} dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
onsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse 
cillum dolore eu fugiat nulla pariatur. 

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia 
deserunt mollit anim id est laborum.

parbreak
bye

Answered by Ingmar on February 2, 2021

The key bit of code in plain.tex is this:

defpagecontents{ifvoidtopinselseunvboxtopinsfi
  dimen@=dp@cclv unvbox@cclv % open up box255
  ifvoidfootinselse % footnote info is present
    vskipskipfootins
    footnoterule
    unvboxfootinsfi
  ifr@ggedbottom kern-dimen@ vfil fi}

You want to override that vfil so the easiest way to do this is to change the value of skipfootins which is initially set to bigskipamount (12pt plus 4pt minus 4pt) changing this to have plus 1fill would do the job so just add the following to your document:

skipfootins=12pt plus 1fill minus 4pt

and you should get the expected output.

(and as an aside, creating a 3000 page document in plain TeX in 2020? Interesting choice).

(also, I don't have a working TeX system at the moment so this is all untested).

Answered by Don Hosek on February 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP