使用阿拉伯语的 beamer,我们将其许多命令和主题改编为这种语言,但是当我在阿拉伯语被加载时添加脚注时,我收到错误消息 '!LaTeX 错误:未定义计数器“Hfootnote”。所以我的问题是:“如何在这种环境中输入脚注?
我给出了一个最小的例子。当我取消注释阿拉伯语行时,我得到了错误消息
\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}
感谢 Karlkoehler,他为英语环境中常见的脚注提供了解决方案,即 LTR 模式。但是 RightToLeft 模式呢,例如阿拉伯语,我们在 LTR 和 RTL 模式下定义了其他类型的脚注。我给出了这些脚注的一个例子:
\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}
该文件的编译不会停止,它会对脚注进行编号,但只写入第一个脚注
答案1
这是一个解决方案。
选项hyperfootnotes
是导致此行为的罪魁祸首。因此,在加载时beamer
,将选项传递hyperfootnotes=false
给 hyperref,如下所示:
\documentclass[hyperref={hyperfootnotes=false},10pt]{beamer}
然而,此时脚注不会被打印...为了避免这种情况,我们需要在序言中添加以下几行:
\makeatletter
\let\@footnotetext=\beamer@framefootnotetext
\makeatother
现在它应该可以正常工作了。
梅威瑟:
\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}
输出