4

Using beamer in arabic language, we adapt many of its commands and themes to this language, but when I put a footnote if the arabic language is charged, I have the error message '! LaTeX Error: No counter 'Hfootnote' defined.' So my question is: "How I can type footnotes in this environments?

I give a minimal example. I obtain the error message when I uncomment the line of the arabic language

\documentclass[10pt]{beamer}

%% to use arabic language and arabic fonts
\usepackage{polyglossia}
\setdefaultlanguage{english}
%\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic, Scale=1.0]{Traditional Arabic}
\newfontfamily\arabicfontsf[Script=Arabic]{Amiri}
\newfontfamily\arabicfonttt[Script=Arabic, Scale=1.0]{Tahoma}
\setsansfont[Script=Arabic]{Simplified Arabic}

\begin{document}

\begin{frame}
Some text\footnote{with footnote.} 
\end{frame}

\end{document}

Thanks to Karlkoehler, who give the solution for the usual footnotes, in english environments, so in LTR mode. But what about the RightToLeft mode, the arabic for example, where we define other kinds of footnotes, in LTR and RTL modes. I give an example of these footnotes:

\documentclass[hyperref={hyperfootnotes=false},10pt]{beamer}

%% to use arabic language and arabic fonts
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic, Scale=1.0]{Traditional Arabic}
\newfontfamily\arabicfontsf[Script=Arabic]{Amiri}
\newfontfamily\arabicfonttt[Script=Arabic, Scale=1.0]{Tahoma}
\setsansfont[Script=Arabic]{Simplified Arabic}

\makeatletter
\let\@footnotetext=\beamer@framefootnotetext
\makeatother

\def\efootnote#1{\leftfootnoterule\LTRfootnote{\LR{#1}}\stepcounter{footnote}}
\def\efootnotetext#1#2{\LRfootnoterule\LTRfootnotetext[#1]{\hspace*{2pt}\LR{#2}}\hspace*{-12pt}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MANYFOOT FOOTNOTES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[para*]{manyfoot}    
%%%%%%%%%%%% ARABIC RTL
\newfootnote[para]{B}
\newcounter{footnoteB}
\newcommand{\footnoteB}{%
\stepcounter{footnoteB}%
\Footnotemark\thefootnoteB
\FootnotetextB\thefootnoteB}
\renewcommand{\thefootnoteB}{\hspace*{2pt}\fnsymbol{footnote}}
 \def\HِAfootnotetext#1#2{\FootnotetextB{#1}{\hspace*{2pt}\LR{#2.}}}
%%%%%%%%%%%%  ENGLISH LTR
\SetFootnoteHook{\setLTR}
\DeclareNewFootnote[para]{C}
\makeatletter
\let\c@footnoteC\c@footnote
\makeatother
\let\Hfootnote\footnoteC
\renewcommand{\thefootnoteC}{\fnsymbol{footnote}}
\def\Hfootnotemark#1{\footnotemarkC[#1] \stepcounter{footnote}}
\def\Hfootnotetext#1#2{\footnotetextC[#1]{\hspace*{2pt}\LR{#2.}}\stepcounter{footnote}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    END MANYFOOT FOOTNOTES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{frame}
A usual footnote\footnote{footnote} 

A efootnote\efootnote{efootnote}

A footnoteB\footnoteB{footnoteB}

A footnoteC\footnoteC{footnoteC}

\end{frame}

\end{document} 

The compilation of this file doesn't stop, it number the footnotes but it writes only the first footnote

1 Answer 1

10

This is a solution.

The option hyperfootnotes is the culprit of this behavior. So, when loading beamer, pass the option hyperfootnotes=false to hyperref, in this way:

\documentclass[hyperref={hyperfootnotes=false},10pt]{beamer}

At this point, however, footnotes won't be printed... To avoid that, we need to add the following lines in the preamble:

\makeatletter
\let\@footnotetext=\beamer@framefootnotetext
\makeatother

Now it should works properly.

MWE:

\documentclass[hyperref={hyperfootnotes=false},10pt]{beamer}

%% to use arabic language and arabic fonts
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic, Scale=1.0]{Traditional Arabic}
\newfontfamily\arabicfontsf[Script=Arabic]{Amiri}
\newfontfamily\arabicfonttt[Script=Arabic, Scale=1.0]{Tahoma}
\setsansfont[Script=Arabic]{Simplified Arabic}

\makeatletter
\let\@footnotetext=\beamer@framefootnotetext
\makeatother

\begin{document}

\begin{frame}
Some text\footnote{with footnote.}
\end{frame}

\end{document} 

Output

enter image description here

4
  • Thank you for your answer. It works good... for the usual footnotes (in english environments and in left to right way) But what about the general footnotes, in RTL modes and so ? I give the problematic in my updated question Feb 14, 2015 at 11:47
  • @FaouziBellalouna For \efootnote add \let\@LTRfootnotetext=\beamer@framefootnotetext. For the others, I don't know. Feb 14, 2015 at 12:05
  • @karlkoller ok thanks. I'll try your solution. Thanks Feb 14, 2015 at 12:09
  • Many thanks. Folllowing worked for me: \makeatletter \let\@footnotetext=\beamer@framefootnotetext \makeatother
    – Faaiz
    Jan 1, 2019 at 3:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .