# Footnote in arabic with polyglossia

writing a book in arabic, I want to make some comments by footnotes, in english and in arabic. The footnotes in arabic are from Right to Left, and I can put the rule of the footnote on the right side of the page. By the same, the english footnote (in the english environment) is from Left to Right, and I put the rule on the left side. In the case when I have two footnotes, in arabic and in english, in the same page, I want to have two rules of the footnotes in the same time, on the left and on the right side of the page, because of the two footnotes (in the page 3 of my ECM, I want to have a rule below the arabic footnote too...). Any one have an idea for that ? Thank you...

I post a minimal example...

\documentclass[14pt,a4paper]{extbook}

\usepackage{titlesec}
\usepackage{minitoc}

\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}

\def\efootnote#1{\renewcommand{\footnoterule}{\raggedright\vspace*{-3pt}\rule{2in}{0.4pt}\vspace*{2.6pt}}\begin{english}
\hspace*{-5pt}\footnote{\hspace*{2pt}\LR{#1}}\end{english}}
\def\afootnote#1{\renewcommand{\footnoterule}{\raggedleft\vspace*{-3pt}\rule{2in}{0.4pt}\vspace*{2.6pt}}\footnote{\hspace*{2pt}\RL{#1}}}

\begin{document}\LR{
Page with english footnote\efootnote{English footnote}
\newpage
Page with arabic footnote\afootnote{هامش عربي \LR{Arabic footnote}}
\newpage
Page with english\efootnote{English footnote} and arabic\afootnote{هامش عربي \LR{Arabic footnote}} footnotes.
}
\end{document}


The bidi package has already implemented what I think is the most reasonable way to handle a mixture of RTL and LTR footnotes: it provides a full width footnote rule. This will always be a much more reliable situation than trying to add a rule for the left and right footnotes independently. The reason for this becomes clear if you think of two long footnotes, LTR and the other RTL. The second footnote must be aligned vertically after the first footnote, and so its footnote rule will never be aligned with the first rule.

So the following is what I think is the best solution to your problem (even though it's not exactly what you ask for).

[The previous solution I posted based on manyfoot I don't think is workable after all, so I have removed it entirely; the curious can see the edit history for details.]

% !TEX TS-program = XeLaTeX
\documentclass[14pt,a4paper]{extbook}
\usepackage{titlesec}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\usepackage{zref-perpage}
\zmakeperpage{footnote}
\textwidthfootnoterule

\begin{document}
\renewcommand\thefootnote{\fnsymbol{footnote}}
\begin{english}
Page with english footnote\footnote{English footnote}
\newpage
Page with arabic footnote\RTLfootnote{هامش عربي \LR{Arabic footnote}}
\newpage
Page with english\footnote{English footnote} and arabic\RTLfootnote{هامش عربي \LR{Arabic footnote}} footnotes.
\end{english}
\end{document}


Some comments on using minitoc (not relevant to the question directly)

As an aside, I don't recommend using minitoc with titlesec. If you require section/chapter TOCs you can use the titletoc package (documented with titlesec) to achieve the same aim, but preserving full compatibility with titlesec. See the following questions for some examples of its use: Minitoc and memoir and How to remove section indentation in partial ToC using titletoc?

• Hello. Thank you for your idea. But I need the minitoc package I have to implement this macro.. – Faouzi Bellalouna May 27 '14 at 5:25
• For the numerotation I have no need of it,I use this command.. \renewcommand{\thefootnote}{\hspace*{5pt}\fnsymbol{footnote}} – Faouzi Bellalouna May 27 '14 at 5:40
• I will remove the comments about minitoc, since they are not relevant to my answer. – Alan Munn May 27 '14 at 11:34
• @FaouziBellalouna Could you delete your comments about minitoc, now that I've edited the answer? Thanks. – Alan Munn May 27 '14 at 12:06
• Could you re-post the discussion about the alternative of minitoc for use your solution please – Faouzi Bellalouna May 27 '14 at 14:28