[comp.text.tex] LaTeX multicolumn footnotes

rkowen@violet.berkeley.edu (R.K. Owen) (09/29/90)

I'm looking for some .STY files or macros that will allow LaTeX
to put footnotes in a multicolumn format that the bottom of the
(mini)page.  For some of my tables I have a lot of footnotes of
the form \footnote{$\beta=.xxx$} or cites some reference.
Something similar to what Knuth shows on page 396 of "THE TeXbook".

Please email me any helpful comments or source to
rkowen@violet.berkeley.edu

Thanks,  The life you save may be mine.   R.K. Owen

teexdwu@ioe.lon.ac.uk (DOMINIK WUJASTYK) (10/11/90)

In article <1990Sep28.212910.7850@agate.berkeley.edu> rkowen@violet.berkeley.edu (R.K. Owen) writes:
>I'm looking for some .STY files or macros that will allow LaTeX
>to put footnotes in a multicolumn format that the bottom of the
>(mini)page.  For some of my tables I have a lot of footnotes of
>the form \footnote{$\beta=.xxx$} or cites some reference.

A while back I implemented Knuth's paragraphed footnotes for LaTeX 
(with Chris Rowley's help), and these macros are sloshing around the net
in the usual places, under the name "fnpara.sty".

I have recently done two- and three-column footnotes for Plain TeX
(part of the EDMAC package).  But I'm afraid I don't have the
particular combination that you need: columnar footnotes for LaTeX.

I suggest that you look at my implementation of 3-col notes for Plain,
below,  (since there are some tricky bits that are not explicit in the
TeXbook), and work from that.  This is an extract from the edmac
package, which is probably going to be a TeXniques booklet soon.  It
assumes lots of stuff from the rest of edmac, so it may be just too
opaque on its own, I'm afraid. Worse still, (or better), it is in
the DOC style of Mittelbach.

Dominik Wujastyk
----------------------------------------------------------------------------
% \subsection{Columnar footnotes}
%
% \begin{macro}{\rigidbalance}
% \begin{macro}{\dosplits}
% \begin{macro}{\splitoff}
% \begin{macro}{\@k}
% \begin{macro}{\@h}
%
% We will define macros for three-column notes and two-column notes.
% Both sets of macros will use this macro, which
% splits a box ({\tt \#1}) into into
% a number ({\tt \#2}) of columns, each with a space ({\tt \#3})
% between the top baseline and the top of the \verb|\vbox|
% (from {\em The \TeX book}, 397).
%    \begin{macrocode}
\newcount\@k \newdimen\@h
\def\rigidbalance#1#2 #3 {\setbox0=\box#1 \@k=#2 \@h=#3
  \line{\splittopskip=\@h \vbadness=\@M \hfilneg
  \valign{##\vfil\cr\dosplits}}}
\def\dosplits{\ifnum\@k>0 \noalign{\hfil}\splitoff
  \global\advance\@k-1\cr\dosplits\fi}
\def\splitoff{\dimen0=\ht0 \divide\dimen0 by\@k \advance\dimen0 by\@h
  \vsplit0 to \dimen0 }
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Three columns}
%
% \begin{macro}{\footthreecol}
% You say \verb"\footthreecol{a}" to have the {\tt a} series of footnotes
% typeset in three columns. It is important to call this only after
% \verb|\hsize| has been set for the document.
%    \begin{macrocode}
\def\footthreecol#1{%
    \expandafter\let\csname v#1footnote\endcsname=\threecolvfootnote
    \expandafter\let\csname #1footfmt\endcsname=\threecolfootfmt
    \expandafter\let\csname #1footgroup\endcsname=\threecolfootgroup
    \threecolfootsetup{#1}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\threecolfootsetup}
% Here, we set the \verb|\count| of the foot insert to $333$,
% on the assumption
% that each note will contribute only one third of a line of text:
% \verb"\threecolfootfmt" will take the footnote insert
% as its input, make a long, narrow box of it, and
% the \verb"\rigidbalance" routine (inside \verb"\threecolfootgroup")
% will chop it into three
% columns. These columns are saved in a box, and then
% that box is {\em put back\/} into
% the footnote insert, replacing the original collection of footnotes.
%
% The \verb|\dimen| value for this note series needs to be three times
% the actual limit on the amount of space these notes are allowed to
% fill on the page: when \TeX\ is accumulating material for the page
% and checking that limit, it doesn't apply the \verb|\count| scaling.
%    \begin{macrocode}
\def\threecolfootsetup#1{%
    \expandafter\count\csname #1footins\endcsname 333
    \multiply\expandafter\dimen\csname #1footins\endcsname by 3 }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\threecolvfootnote}
%
% Here is the \verb|\vfootnote| command for three-column notes.
%    \begin{macrocode}
\def\threecolvfootnote#1#2{\insert\csname #1footins\endcsname\bgroup
    \tolerance=\@M
    \interlinepenalty=\csname inter#1footnotelinepenalty\endcsname
    \floatingpenalty=\@MM
    \splittopskip=\ht\strutbox \splitmaxdepth=\dp\strutbox
    \csname #1footfmt\endcsname #2\egroup}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\threecolfootfmt}
%
% Here is the command that formats one note: note especially the
% importance of temporarily dividing the \verb|\hsize| by $3$. We
% are also using \verb|\raggedright|, which will usually be preferable
% with such short lines.
%    \begin{macrocode}
\def\threecolfootfmt#1#2#3{%
  \let\par=\endgraf
  \hsize .3\hsize
  \rightskip=0pt \leftskip=0pt \parindent=0pt
  \raggedright
  {\strut\notenumfont\printlines#1|\enspace
      \lemmafont#1|#2\enskip\notetextfont
      #3\strut\endgraf\allowbreak\relax}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\threecolfootgroup}
%
% And here is the {\tt footgroup} macro that's called within the
% output routine to regroup the notes into three columns.
%    \begin{macrocode}
\def\threecolfootgroup#1{\expandafter
  \rigidbalance\csname #1footins\endcsname 3 {\ht\strutbox}
  \expandafter\setbox\csname #1footins\endcsname=\lastbox
  \expandafter\box\csname #1footins\endcsname}
%    \end{macrocode}
% \end{macro}
%
--------------------------------------------------------------------------
Then your output routine should have something like this in it:
  \ifvoid\afootins\else
    \afootstart{a}\afootgroup{a}%
 
Good luck with all this!

Dominik