\ProvidesPackage{biblionote}

%%
%% biblionote.sty
%%
%% (c) Vincent Zoonekynd 1996
%%

%%
%% Je voulais des notes de bas de page dans la marge...
%%

\newinsert\biblio
%\dimen\biblio=\maxdimen % ?????????
\dimen\biblio=\vsize
\count\biblio=0
\skip\biblio=0pt
\newcounter{numerobiblio}
\renewcommand{\thenumerobiblio}{{(\arabic{numerobiblio})}}
\newcommand{\biblionotestyle}{\small}
\newcommand{\biblionoteskipamount}{\bigskipamount}
\newcommand{\biblionote}[1]
{\stepcounter{numerobiblio}%
  $^\thenumerobiblio$%
  \insert\biblio{%
    \vskip \biblionoteskipamount
    \noindent\parbox{\marginparwidth}{%
      \parindent=0pt
      \biblionotestyle
      $^\thenumerobiblio$ #1}}}


%% Il faut jouer avec \output...

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% A FAIRE : Utiliser \@thehead plutôt que \@outputpage...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\@outputpage{%
  \let \protect \noexpand 
  \shipout \vbox {%
    \set@typeset@protect
    \aftergroup \set@typeset@protect \@shipoutsetup 
    \@begindvi 
    \vskip\topmargin 
    \moveright \@themargin 
    \vbox {%
      \setbox \@tempboxa 
      \vbox to\headheight {%
        \vfil \color@hbox \normalcolor \hbox to\textwidth
        {%
          \let \label \@gobble 
          \let \index \@gobble 
          \let \glossary \@gobble 
          \@thehead 
          }%
        \color@endbox 
        }%
      \dp \@tempboxa \z@ \box\@tempboxa 
      \vskip \headsep \box \@outputbox 
      %
        %%%%%% \begin{MODIF} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      \rlap{\hbox{\hspace{\hsize}%
          \vbox to 0pt{%
            \vss
            \ifvoid\biblio\else
            \hbox{%
              \hspace{\marginparsep}%
              \hspace{-3.2pt}\vrule width 0.4pt\hspace{2.8pt}%
              \vbox{%
                \vskip -\biblionoteskipamount
                \box\biblio}}%
            \fi
            }}}%
        %%%%%% \end{MODIF} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      %
      \baselineskip
      \footskip \color@hbox \normalcolor 
      \hbox to\textwidth {%
        \let \label \@gobble 
        \let \index \@gobble 
        \let \glossary \@gobble 
        \@thefoot
        }%
      \color@endbox 
      }}%
  \global \@colht \textheight \stepcounter{page}
  \let \firstmark \botmark 
}

