# how to typeset RTL document with two columns flush AND two-column footnotes

I'm working on a set of documents in Hebrew. My general workflow is I type reStructuredText, run it through rst2xetex and then typeset with XeLaTeX. What I can't figure out how to do is create a two-column document with paragraph footnotes or twocolumn footnotes. The closest approximation is using the twocolumn class option, but I really don't like the way the columns are done like two separate pages. I want the columns to be aligned at the bottom, as the multicol package does, and the footnotes to flow from first column to second column.

If it's possible to do this with memoir that would be fantastic, but so far I haven't much luck with that as it doesn't seem to play nice with hyperref, on which rst2xetex relies heavily. I tried 'disabling' hyperref following docutils instructions, as I don't need it, but I still get errors in the xetex output.

Here is the basic template, with a few comments removed:

\documentclass[a4paper,12pt]{article}
% generated by Docutils <http://docutils.sourceforge.net/>
% rubber: set program xelatex
\usepackage[no-sscript]{xltxtra} % loads fixltx2e, metalogo, xunicode, fontspec
\defaultfontfeatures{Scale=MatchLowercase}
\usepackage{ifthen}

\setmainfont[AutoFakeBold=2]{SBL Hebrew}

%%% Fallback definitions for Docutils-specific commands
% numeric or symbol footnotes with hyperlinks
\providecommand*{\DUfootnotemark}[3]{%
\raisebox{1em}{\hypertarget{#1}{}}%
}
\providecommand{\DUfootnotetext}[4]{%
\begingroup%
\renewcommand{\thefootnote}{%
\protect\raisebox{1em}{\protect\hypertarget{#1}{}}%
\footnotetext{#4}%
\endgroup%
}

\ifthenelse{\isundefined{\hypersetup}}{
\urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}

\usepackage[rldocument,extrafootnotefeatures]{bidi}
\RTLcolumnfootnotes
\twocolumnfootnotes

%%% Body
\begin{document}

\section*{\phantomsection%
איך עושים את זה%
\label{id1}%
}

טיפול מיתולוגיה מדע או, מה אודות המלחמה עוד. נבחרים איטליה טכנולוגיה זכר
בה, או רבה\DUfootnotemark{id2}{id5}{1} שנורו יידיש למחיקה
<-- etc. -->
%
\DUfootnotetext{id5}{id2}{1}{%
ציון א
}
\end{document}
% vim: set ft=tex: %


If I add multicol and wrap the main part of the document in a multicols environment, the footnotes end up in two columns under the left column only, unless I take out the extrafootnotefeatures. Then I have an attractive two columns on top but only one column of footnotes on the bottom!

-
–  lockstep Nov 13 '11 at 22:36
@lockstep thanks. Do you think paragraph footnotes would be more feasible? The bidi package supports that, but it comes out left-to-right when I use multicol, despite my invocation of \RTLcolumnfootnotes. –  Aryeh Leib Taurog Nov 14 '11 at 0:37
Did you use \setRTLparagraphfootnotes? If you use it, you see that paragraph footnotes suffer for the same reason (all footnotes end up in left column). –  IRAN Nov 14 '11 at 0:57

I have fixed this in version 11.149 of bidi package and uploaded this version to CTAN just now. The new TDS should be available for download in few hours. The TDS then can be downloaded from HERE.

Also in future, if you have any problems with bidi package, other than posting your question on this website, also send an email to me (my email address can be found in the documenttaion of bidi package) so that I am aware of the issue and hence can fix it.

-
Thanks! I will try it out. –  Aryeh Leib Taurog Nov 22 '11 at 22:49
I am assuming you are referring to the ability to use paragraph footnotes along with a multicols environment. It looks great! How can I prevent the footnote paragraph from overlapping the page number (footer)? –  Aryeh Leib Taurog Nov 26 '11 at 20:42
Please ask a new question with minimial working example. To be honest, I myself never experienced footnote paragraph overkapping the page number. In version 11.149, I have fixed everything, \twocolumnfootnotes to \tencolumnfootnotes and \paragraphfootnotes. –  IRAN Nov 27 '11 at 2:21
Ok, I tried \paragraphfootnotes with more than 40 footnotes and it indeed overlaps page numbers as you said. I am afraid that I do not have a simple solution with that. Actually it appears to be a bug of multicol package and it should be fixed in multicol package. I can change multicol codings but that is something the author of multicol should be doing himself. –  IRAN Nov 27 '11 at 3:47

This is not an answer to your problem (sorry I could not find a better place to post this) but explains why footnotes end up in the left column instead the right column. With the following minimal example:

\documentclass{article}
\TeXXeTstate=1
\begin{document}
\everypar\expandafter{\the\everypar \setbox0\lastbox \ifvoid0\else\beginR\usebox0\fi}
\hsize=\linewidth

even though, the paragraphs are typeset RTL, the text ends up on the left block instead the right one and this is what happens in multicol with extrafootnotefeatures option of my bidi package. So to fix the issue you mentioned, this minimal working example should end up on the right block instead the left one. I am not sure if this is possible with modifying output routine of LaTeX!