3

I am working with an author that needs two different footnote streams. This can quite easily be done by using bigfoot.


EDIT Also note that the margins used are narrow, like 10mm or so. Therefore the 2nd stream should be "under" the text.


I did things like that :

\documentclass[a5paper,11pt]{scrbook}
\usepackage{geometry}
\usepackage{perpage}
\usepackage[ruled]{bigfoot}
\MakePerPage{footnote}

\renewcommand{\thefootnote}{\alph{footnote}}
\DeclareNewFootnote{A}[arabic]

\begin{document}
Lorem\footnote{a footnote stream} ipsum dolor sit amet, consectetur adipiscing elit.             
Vestibulum ut lorem\footnote{a footnote stream} ligula. Pellentesque eget nibh quam.     
Etiam molestie iaculis dictum. Ut fringilla odio quis quam aliquet egestas. Nam     
dignissim ante eu nibh bibendum, a laoreet ipsum\footnoteA{another footnote stream} 
aliquam. Donec euismod erat ac malesuada sodales. Fusce viverra feugiat ligula vel 
rhoncus. Aliquam erat volutpat. Nullam consequat sollicitudin quam, id dapibus tellus.     
Nulla tempus mattis justo, eget aliquam elit vehicula sed.

Curabitur ante felis, rutrum sed sem nec, fringilla rhoncus metus. Mauris blandit, dui 
non tempus porttitor, sapien urna fermentum ligula, nec molestie dolor lacus vel 
ipsum\footnoteA{another footnote stream}. Maecenas odio enim, vulputate sit amet nulla 
nec, laoreet imperdiet sapien. Cum sociis natoque penatibus et magnis dis parturient 
montes, nascetur ridiculus mus. Integer sed tincidunt dolor. Nunc laoreet interdum 
condimentum. Maecenas neque urna, porttitor ac neque id, gravida cursus odio.

In egestas lobortis nisi eu malesuada. Donec leo nibh, vulputate vel arcu vel, 
adipiscing pharetra ipsum\footnoteA{another footnote stream}. Maecenas vitae augue 
luctus, ultrices nisi sed, hendrerit ipsum\footnoteA{another footnote stream}. 
Suspendisse potenti. Mauris id blandit arcu, et sodales massa. Sed laoreet dapibus 
lectus id bibendum. Nunc eget orci id lectus auctor sagittis. Vivamus tincidunt semper 
mattis. Curabitur quis lorem\footnote{a footnote stream} tortor.

Sed volutpat urna ligula, eget posuere neque condimentum eu. Integer feugiat erat ac 
lorem interdum, ut pharetra quam blandit. Nulla blandit sit amet tellus at cursus. Nam 
eget eleifend felis. Aliquam pulvinar mi sit amet magna gravida congue. Mauris 
pellentesque dui et turpis laoreet dictum. Donec commodo ultricies risus, eget 
fringilla sapien hendrerit eu.
\end{document}

enter image description here


But the author is asking me if there is any possibility of having one stream beside the other and not below the other.

And of course if only the second stream is present in a given page, to have it on the right alone.


enter image description here


Any way to achieve this ? I tried to use scrextend package that helps me in settings the left and right margins of the footnote, but that does not seem to solve my problem.

  • As far as I know, no one has tried to implement this. (Nor have I ever seen it 'in the wild'.) But you should look at how footnotes are implemented when the twocolumn option is given to the standard document classes and dblfnote.sty for inspiration --- though neither do anything close to what you want. – jon Jul 22 '14 at 16:04
  • @jon thanks for your answer. I am quite new to latex and therefore not fully aware of all the packages available. During my search I heard about the memoir class and that footnotes could be laid down in a two columns format in a single column document. This could be a starting point or at least a solution to reduce the size used by the footnotes. Do you know about memoir ? Do you have any advise or tip in that direction ? – HpTerm Jul 22 '14 at 17:53
  • I use memoir regularly. It is a great class, but what you are trying to achieve is likely an order of magnitude more difficult than simply achieving two-column notes. It is, sadly, beyond my ability to help.... – jon Jul 23 '14 at 15:33
  • @HpTerm A week later: What did you do? – Keks Dose Jul 27 '14 at 20:00
  • 1
    Do whatever you think. I'm courious, because it is very difficult to fulfill your requirements. Two column layouts aren't supported well by LaTeX and two column footnotes aren't supported at all. I checked the eledmac package and various others without result; which isn't really a surprise: To have two column footnotes, you need a solution for linebreak and pagebreak in your apparatus. The package scrlayer-notecolumn was the first one which enabled marginpars to go over a pagebreak. But that is probably only a part of the solution for a second footnote column and pagebreaks... – Keks Dose Aug 5 '14 at 11:52
1

(As requested.) Here's an example of how memoir can set up two-column footnotes with two different footnote streams. Stacking these side-by-side, however, would require the work of a serious TeXnician....

\documentclass{memoir}
\usepackage[T1]{fontenc}
\usepackage{lipsum,ragged2e}% ragged2e provides \RaggedRight

% Two-column footnotes
\twocolumnfootnotes% look at approx. lines 9327-9429 in memoir.cls

% Set up new footnote series
\newfootnoteseries{A}
\twocolumnfootstyle{A}
\renewcommand{\thefootnoteA}{\alph{footnoteA}}

% Styling of (all) footnotes
\renewcommand{\foottextfont}{\footnotesize\RaggedRight}

\begin{document}

\footnote{\lipsum*[1]}%
\footnoteA{This is the `A' Level. \lipsum*[3]}%
\lipsum[1-2]
\footnote{\lipsum[2]}%
\footnoteA{This is the `A' Level.}%
\lipsum[3-4]

\end{document}
0

I think I've got a solution for you, but the code is stolen more or less completely, and please don't expect me to explain it:

\documentclass{article}

\usepackage{atbegshi}
\usepackage{zref-abspage}
\usepackage{picture}
\usepackage{perpage, xspace}

\makeatletter
\providecommand*{\c@zabspage}{\c@abspage}

% * User macros for configuring
%
% \tbmparItemSep is inserted between marginal notes
% \tbmparMiddleSep is inserted between top and bottom marginal notes.

\newcommand*{\tbmparItemSep}{%
  \vspace{1ex minus .5ex}%
%  \hrule
  \vspace{1ex minus .5ex}%
}
\newcommand*{\tbmparMiddleSep}{%
  \vspace*{0pt plus 1fil}%
}

% * Debug messages
%
\newcommand*{\tbmparDebug}[1]{%
  \typeout{[tbmpar] #1}%
}

% * Label management to remember absolute page number
%
% \tbmpar@PageByLabel stores and loads absolute page number from
% label and defines \tbmpar@page with absolute page number or
% zero if the label is not yet available.

\newcount\c@tbmpar@item
\c@tbmpar@item\z@

\newcommand*{\tbmpar@PageByLabel}{%
  \global\advance\c@tbmpar@item\@ne
  \zref@labelbyprops{tbmpar\the\c@tbmpar@item}{abspage}%
  \edef\tbmpar@page{%
    \zref@extractdefault{tbmpar\the\c@tbmpar@item}{abspage}{0}%
  }%
  \zref@refused{tbmpar\the\c@tbmpar@item}%
  \tbmparDebug{Item \the\c@tbmpar@item\space on page \tbmpar@page}%
}

% * Box register management

\newcount\c@tbmpar@box
\c@tbmpar@box\z@

\let\tbmpar@boxfreelist\@empty

% Get a new free box register either from the free list or,
% if the free list is empty, allocate a new box register.
\newcommand*{\tbmpar@NextBox}[1]{%
  \@next#1\tbmpar@boxfreelist{%  
    \tbmparDebug{Reused box: #1}%
  }{%
    \global\advance\c@tbmpar@box\@ne
    \expandafter\newbox\csname tbmpar@box\the\c@tbmpar@box\endcsname
    \edef#1{\csname tbmpar@box\the\c@tbmpar@box\endcsname}%
    \tbmparDebug{New box: #1}%
  }%
}
% Put free box in free list.
\newcommand*{\tbmpar@FreeBox}[1]{%
  \begingroup
    \let\@elt\relax
    \xdef\tbmpar@boxfreelist{%
      \tbmpar@boxfreelist
      \@elt#1%
    }%
    \tbmparDebug{Free box: #1}%
  \endgroup
}

\newsavebox{\tbmpar@box}

% Each marginpar is put in a box that is initialized as
% parbox/minipage.
\newcommand*{\tbmparBoxSetup}{}
\newcommand{\tbmpar@VBox}[1]{% 
  \vbox{%
    \color@begingroup
    \hsize\marginparwidth
    \edef\tbmpar@restore@ifminipage{%
      \if@minipage
        \noexpand\@minipagetrue
      \else
        \noexpand\@minipagefalse
      \fi
    }%   
    \@parboxrestore
    \@marginparreset
    \tbmparBoxSetup 
    #1%
    \tbmpar@restore@ifminipage
    \color@endgroup
  }%
}   

% Macro \tbmpar@marginpar looks for the page, where the margin note
% belongs to, stores the note in a box and appends the box to the  
% note collector register of the page.
% Each page is assigned a box collector registers that collect
% the top notes and a register that collect the bottom notes. 
% The name of the box register is \tbmpar@<top|bot>box<page>. 
\newcommand{\tbmpar@marginpar}[4]{%
  \ifhmode
    \@bsphack
  \fi
  \tbmpar@PageByLabel
  \ifnum\tbmpar@page>\z@
    \setbox\tbmpar@box\tbmpar@VBox{#4}%
    \@ifundefined{tbmpar@#1box\tbmpar@page}{%
      \tbmpar@NextBox\tbmpar@currbox
      \global\expandafter\let
          \csname tbmpar@#1box\tbmpar@page\endcsname
          \tbmpar@currbox
      \global\setbox\tbmpar@currbox=\vbox{%
        \unvbox\tbmpar@box
      }%
    }{% 
      \tbmparDebug{Use box: \tbmpar@currbox}%
      \expandafter\let\expandafter\tbmpar@currbox
          \csname tbmpar@#1box\tbmpar@page\endcsname
      \global\setbox\tbmpar@currbox\tbmpar@VBox{%   
        \unvbox#2%
        \par
        \begingroup
          \tbmparItemSep
        \endgroup
        \unvbox#3%
      }%
    }%  
  \fi   
  \ifhmode
    \@esphack
  \fi
}
\newcommand*{\topmarginpar}{%
  \tbmpar@marginpar{top}\tbmpar@currbox\tbmpar@box
}
\newcommand*{\botmarginpar}{%
  \tbmpar@marginpar{bot}\tbmpar@box\tbmpar@currbox
}

\newcounter{Rnnr}
\MakePerPage{Rnnr}% Counterreset every new page
% with package perpage, there also is zref-perpage
\renewcommand{\theRnnr}{\alph{Rnnr}}% print letters as anchors
\newcommand{\Anm}[1]{%
\refstepcounter{Rnnr}%
\textsuperscript{\textit{\theRnnr}}% Anker im Text
  \botmarginpar{% Randnotiz
    \textsuperscript{\theRnnr}#1\xspace}} %%Randnotentext



% At shipout time we look for the box collector registers of this
% page and set these boxes in the marginpar box with respecting  
% \topskip and \maxdepth.
\AtBeginShipout{%
  \AtBeginShipoutUpperLeft{%
    \put(%
      \dimexpr 1in+\oddsidemargin+\textwidth+\marginparsep\relax,%
      -\dimexpr 1in+\topmargin+\headheight+\headsep+\textheight\relax
    ){%
      \begingroup
        \global\let\tbmpar@inuse=N%
        \setbox\tbmpar@box=\tbmpar@VBox{%
          \penalty-\@M
          \edef\tbmpar@tmp{tbmpar@topbox\the\value{zabspage}}%
          \@ifundefined{\tbmpar@tmp}{%
          }{%
            \expandafter\let\expandafter\tbmpar@currbox
                \csname\tbmpar@tmp\endcsname
            \unvbox\tbmpar@currbox
            \tbmpar@FreeBox\tbmpar@currbox
            \global\let\tbmpar@inuse=Y%   
          }%
          \endgraf
          \tbmparMiddleSep
          \edef\tbmpar@tmp{tbmpar@botbox\the\value{zabspage}}%
          \@ifundefined{\tbmpar@tmp}{%
          }{%
            \expandafter\let\expandafter\tbmpar@currbox
                \csname\tbmpar@tmp\endcsname
            \unvbox\tbmpar@currbox
            \tbmpar@FreeBox\tbmpar@currbox
            \global\let\tbmpar@inuse=Y%   
          }%
        }%  
        \ifx\tbmpar@inuse Y%
          \splittopskip=\topskip
          \setbox0=\vsplit\tbmpar@box to\z@
          \boxmaxdepth=\maxdepth
          \setbox\tbmpar@box=\vbox to\textheight{%
            \unvbox\tbmpar@box
          }%
          \box\tbmpar@box
        \fi
      \endgroup
    }%
  }%  
}     

\makeatother

% Testing

\usepackage[
  a5paper,   
  left=10mm, 
  right=10mm,
  marginparwidth=40mm,
  includemp,
]{geometry}
\usepackage{microtype}  
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\clubpenalty=10000
\flushbottom
\settodepth\maxdepth{g}  
\setlength{\fboxsep}{1ex}
\usepackage{lipsum}
\usepackage{color}

\newcommand*{\shortlipsum}[1]{%
  \begingroup
    \long\def\y##1. ##2\@nil{##1.}%
    \edef\x{\csname lipsum@\romannumeral#1\endcsname}%
    \expandafter\y\x. \@nil
  \endgroup
}

\begin{document}


Lorem\footnote{a footnote stream} ipsum dolor sit amet, consectetur
adipiscing elit.  Vestibulum ut lorem\footnote{a footnote stream}
ligula. Pellentesque eget nibh quam.  Etiam molestie iaculis
dictum. Ut fringilla odio quis quam aliquet egestas. Nam dignissim
ante eu nibh bibendum, a laoreet ipsum\Anm{another footnote
stream} aliquam. Donec euismod erat ac malesuada sodales. Fusce
viverra feugiat ligula vel rhoncus. Aliquam erat volutpat. Nullam
consequat sollicitudin quam, id dapibus tellus.  Nulla tempus mattis
justo, eget aliquam elit vehicula sed.

Curabitur ante felis, rutrum sed sem nec, fringilla rhoncus
metus. Mauris blandit, dui non tempus porttitor, sapien urna fermentum
ligula, nec molestie dolor lacus vel ipsum\Anm{another footnote
stream}. Maecenas odio enim, vulputate sit amet nulla nec, laoreet
imperdiet sapien. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Integer sed tincidunt
dolor. Nunc laoreet interdum condimentum. Maecenas neque urna,
porttitor ac neque id, gravida cursus odio.

In egestas lobortis nisi eu malesuada. Donec leo nibh, vulputate vel
arcu vel, adipiscing pharetra ipsum\Anm{another footnote
  stream}. Maecenas vitae augue luctus, ultrices nisi sed, hendrerit
ipsum\Anm{another footnote stream}.  Suspendisse
potenti. Mauris id blandit arcu, et sodales massa. Sed laoreet dapibus
lectus id bibendum. Nunc eget orci id lectus auctor sagittis. Vivamus
tincidunt semper mattis. Curabitur quis lorem\footnote{a footnote
  stream} tortor.

Sed volutpat urna ligula, eget posuere neque condimentum eu. Integer
feugiat erat ac lorem interdum, ut pharetra quam blandit. Nulla
blandit sit amet tellus at cursus. Nam eget eleifend felis. Aliquam
pulvinar mi sit amet magna gravida congue. Mauris pellentesque dui et
turpis laoreet dictum. Donec commodo ultricies risus, eget fringilla
sapien hendrerit eu.


\end{document}

enter image description here

  • If I understand correctly the 2nd stream is in the margin, put at the bottom. If that is correct, it is not exactly what I am looking for. The layout has "narrow margins", like 10mm or so. The 2nd stream should be "under" the text, on the right. – HpTerm Jul 21 '14 at 19:47
  • Well, then you have to learn TeX and rewrite the parts or the output routine which deal with footnotes: You'll probably need two independent columns for footnotes... But please accept my apologies for offering such a low grade solution. – Keks Dose Jul 21 '14 at 20:55
  • Thank for taking some time for me. I am currently reading manyfoot.sty to understand how the different streams are laid down. ;-) – HpTerm Jul 21 '14 at 20:59

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.