Update
More flexible version
OP wants solution with various number of scroll boxes. My idea is to provide command which declares new LaTeX box to which can then be added some material. So document can look like:
\documentclass{article}
\usepackage{lipsum}
\usepackage{infoboxes}
\newinfobox{dialogues}
\newinfobox{second}
\begin{document}
Some text, blah blah\footnote{hello} bla bla\footnote{\lipsum[2]}
\lipsum[2-8]
\addtoinfobox{dialogues}{Hello \emph{world}}
\addtoinfobox{dialogues}{Another line}
\addtoinfobox{second}{\lipsum[3-9]}
Another text\footnote{world}. %And now some\marginpar{Margin note. \lipsum[3-4]}
\end{document}
Two scroll (info) boxes are used dialogues and second. Any material can be added with \addtoinfobox macro. I think good idea is to create some macros which would hide this interface and which call \addtoinfobox only when tex4ht is running, otherwise print information directly to text, or to margin notes.
Package infoboxes.sty
\ProvidesPackage{infoboxes}
\RequirePackage{etoolbox}
\newcounter{infoboxescnt}
\newcounter{tempinfbx}
\newcommand\newinfobox[1]{%
\stepcounter{infoboxescnt}
\expandafter\newbox\csname #1infobx\endcsname
\listcsgadd{@usedinfboxes}{#1}
}
\newcommand\addtoinfobox[2]{%
\global\expandafter\setbox\csname #1infobx\endcsname=\vtop\bgroup
\expandafter\ifvoid\csname #1infobx\endcsname%
\else\expandafter\unvbox\csname #1infobx\endcsname\fi#2\egroup
}
\newcommand\a@prntfbx[1]{}
\newcommand\b@prntfbx[1]{}
\newcommand\printinfobox[1]{\a@prntfbx{#1}\expandafter\copy\csname #1infobx\endcsname\b@prntfbx{#1}}
\newcommand\printinfoboxes{%
\setcounter{tempinfbx}{0}
\renewcommand\do[1]{%
\typeout{Print info box: ##1}
\stepcounter{tempinfbx}
\printinfobox{##1}
}
\dolistcsloop{@usedinfboxes}
%\forcsvlist{\if\relax\detokenize{##1}\relax Prazdny\else##1\fi}{\@usedinfboxes}
}
\endinput
and package for tex4ht, infoboxes.4ht
\def\LeavePar{\ifvmode\IgnorePar\fi \EndP}
\NewConfigure{printinfobox}{2}
\renewcommand\a@prntfbx[1]{\def\:bxname{#1}\a:printinfobox}
\renewcommand\b@prntfbx[1]{\b:printinfobox}
\Configure{printinfobox}{\IgnorePar\HCode{
<div class="infobox \:bxname">\Hnewline}\ShowPar}{\EndP\HCode{</div>}}
\let\tmp:prtfbxs\printinfoboxes
\renewcommand\printinfoboxes{}
\NewConfigure{printinfoboxes}{2}
\newcommand\mathexpression[1]{
\strip@pt\dimexpr #1\relax
}
\newcommand\my:prntnfbxs{%
\setcounter{tempinfbx}{0}
\renewcommand\do[1]{%
\printinfobox{##1}\relax
\Css{%
.##1{margin-left:66\%;
height:\mathexpression{1pt / \value{infoboxescnt} * 100}\%;
top:\mathexpression{\value{tempinfbx}pt * 1 / \value{infoboxescnt} * 100}\%;
}
}
\stepcounter{tempinfbx}
}
\dolistcsloop{@usedinfboxes}
}
\Configure{@BODY}
{\LeavePar
\HCode{<article>\Hnewline}\par\ShowPar%
}
\Configure{@/BODY}
{\LeavePar
\HCode{</article>\Hnewline}
\par\ShowPar
\my:prntnfbxs
}
\Css{article,.infobox{margin:0;padding:0;}}
\Css{
article,.footnotes{width:66\%;}
}
\Css{
.infobox{
width:33\%;
float:right;
margin-left:66\%;
position:fixed;
overflow:scroll;
}
}
Interesting part is
\renewcommand\do[1]{%
\printinfobox{##1}\relax
\Css{%
.##1{margin-left:66\%;
height:\mathexpression{1pt / \value{infoboxescnt} * 100}\%;
top:\mathexpression{\value{tempinfbx}pt * 1 / \value{infoboxescnt} * 100}\%;
}
}
\stepcounter{tempinfbx}
}
which print all infoboxes in loop and for each it add css declaration with position and height information calculated from infoboxes count.
Compile with
htlatex sample "xhtml, fn-in"
you can see the result
Original answer
I don't think this is a good idea. E-books are usually read on devices with small screen, where whole area is filled with main content. Footnotes or sidenotes are usually placed either in standalone file with link from the text pointing to them, or directly after paragraph they appeared in, like in this epub3 sample. There is also problem that some e-book devices don't have touch interface and such box would be inaccessible.
But, if you really want to make such box, you can, of course. With tex4ht, you have option to put all footnotes into box placed bellow main text. With few lines of css, you can transform this box to scroll box sitting on the fixed place of the page.
Sample file sample.tex:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
Some text, blah blah\footnote{hello} bla bla\footnote{\lipsum[2]}
\lipsum[2-8]
Another text\footnote{world}
\end{document}
Config file with css instructions, scroll.cfg:
\Preamble{xhtml}
\begin{document}
\Css{
body{
width:35em;
margin-left:auto;
margin-right:auto;
}
}
\Css{
.footnotes{
float:right;
width:10em;
height:10em;
overflow:scroll;
margin-left:42em;
position:fixed;
top:0;
}
}
\EndPreamble
compile with
htlatex sample "scroll, fn-in"
You can see the result here
Good thing is that clicking on the footnote number will scroll to corresponding footnote text.
\vspace, after section heading, sometimes jump/snap in discrete steps? – barbara beeton Apr 10 '13 at 12:55