L'option extrafootnotefeatures dans le package bidi interrompt KOMAScript \ deffootnote

Oct 04 2020

J'utilise la classe KOMAScript scrartclpour composer un article académique contenant à la fois l'anglais et l'arabe. Pour la mise en forme des notes de bas de page, j'utilise \deffootnote.

Avec les notes de bas de page contenant du texte arabe, les marges sont impaires. Ceci est résolu par l'option extrafootnotefeaturesdu bidipackage (voir cette question ). Cependant, cela annule les modifications apportées à l'aide de \deffootnote.

Sans extrafootnotefeatures(gauche), avec extrafootnotefeatures(droite)

Existe-t-il un moyen d'obtenir des notes de bas de page bidirectionnelles appropriées tout en conservant la possibilité de modifier le format des notes de bas de page?

Un exemple de travail minimal est ci-dessous.

\documentclass[english,a4paper]{scrartcl}
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\setmainfont[]{Charis SIL}
\setsansfont[]{Charis SIL Compact}
%% languages/scripts
\newfontfamily\arabicfont[Script=Arabic]{Scheherazade}
\PassOptionsToPackage{extrafootnotefeatures}{bidi}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}

%% Footnotes (load after polyglossia!)
\deffootnote{\leftmargin}{1em}{%
\makebox[\leftmargin][l]{\thefootnotemark}%
}

% Restore original footnote rule
\makeatletter
\def\footnoterule{\left@footnoterule}
\makeatother

\begin{document}
%% No additional space between sentences
\frenchspacing

Christians are
compared to \emph{goim} and are also accused of heresy (\emph{herejía}),
mainly because of their inability to understand revelation. They are
compared to donkeys (\emph{ḥimār}): an ``asno ke lieba libros''
(``donkey that carries books'').\footnote{Cardaillac (1972, 2:41),
  Madrid, National Library of Spain, Aljamiado 4944, f.~45f. Algiers,
  National Library of Algeria, Ar. 1557, p.~57, lines 7--8.

  \begin{Arabic}

  فسجن الله ما اعمى ابصارهم بيدهم الانجيل يقرونه ولا يفهموه انما مثلهم
  كمثل الحمار يحمل اسفارا اصدق الله العظيم ورسول الكريم

  \end{Arabic}

  The expression ``ka-mathal al-ḥimār yaḥmilu asfāran'' is well known by
  Muslims, as it is found in Qur. 62:5 and used by Arabic grammarians as
  an illustrative case study.} but the basic idea is the same in the Arabic
original and the Aljamiado adaptation.

\end{document}

Réponses

1 DavidPurton Oct 04 2020 at 19:54

Je pense que je vous ai induit en erreur dans la dernière question !

Le mauvais rendu est causé par les lignes vides autour de votre texte arabe. Si vous supprimez cela, cela fonctionne bien sans bidil' extrafootnotefeaturesoption de. Et puis, vous pouvez utiliser \deffootnotesans effets secondaires, ainsi que supprimer le hack pour conserver une règle de note de bas de page normale:

\documentclass[a4paper]{scrartcl}
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\setmainfont{Noto Serif}
\setsansfont{Noto Sans}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}
\deffootnote{\leftmargin}{1em}{\makebox[\leftmargin][l]{\thefootnotemark}}
\begin{document}
\null\vfill
Christians are compared to \emph{goim} and are also accused of heresy
(\emph{herejía}), mainly because of their inability to understand revelation.
They are compared to donkeys (\emph{ḥimār}): an ``asno ke lieba libros''
(``donkey that carries books'').\footnote{Cardaillac (1972, 2:41), Madrid,
  National Library of Spain, Aljamiado 4944, f.~45f. Algiers, National Library
  of Algeria, Ar. 1557, p.~57, lines 7--8.

  \begin{Arabic}
    فسجن الله ما اعمى ابصارهم بيدهم الانجيل يقرونه ولا يفهموه انما مثلهم كمثل
    الحمار يحمل اسفارا اصدق الله العظيم ورسول الكريم
  \end{Arabic}

  The expression ``ka-mathal al-ḥimār yaḥmilu asfāran'' is well known by
  Muslims, as it is found in Qur. 62:5 and used by Arabic grammarians as an
illustrative case study.} but the basic idea is the same in the Arabic
original and the Aljamiado adaptation.
\end{document}