1

I am preparing a document where I am using Biblatex + Polyglyossia + XELATEX. I have citations in both languages English and Arabic. The localized items appear in English in Arabic citations, also upon using the cs quotes package which is a must in biblatex package, CS QUOTES have no quotation for Arabic language. I have 3 issues:

  • How to make footnote citations and bibliography change from right to left or left to right according to language

  • Localized items (the words edition, page,seenote,and), how to remove them or make them appear according to the citation language

  • CS quotes have no definition for Arabic language.

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,margin=2.5cm,bindingoffset=0.5cm]{geometry} 
\usepackage{fontspec} 
\usepackage{csquotes}
\usepackage{polyglossia} 
\setdefaultlanguage[calendar=gregorian,locale=default,numerals=mashriq]{arabic}
\setotherlanguages{english}
\newfontfamily\arabicfont[Script=Arabic,Mapping=arabicdigits]{Simplified Arabic} 
\usepackage[backend=biber,language=autobib,autolang=hyphen,citestyle=verbose-note,bibstyle=authortitle,doi=false,isbn=false,block=none,]{biblatex} 
\addbibresource{D:/SC/PROJ/Subfile Package Solution - Biblatex/With_all_set_up.bib} 
\title{}
\author{}
\date{}
\begin{document}
\chapter{}
مع المثلة مثال
\footcite[256]{Sharoni1969}
\newpage
مع المثلة مثال
\footcite{Sharoni1969}
\printbibliography
\end{document}

Here is the reference format

@book{Sharoni1969,
 author = {ميخائيل، ملاك  and  الشاروني، حبيب},
 year = {1969},
 title = {المرجع فى قواعد اللغة القبطية},
 address = {الاسكندرية},
 publisher = {{جمعية مارمينا العجايبي}}
}

@book{Browning1983,
 author = {Browning, Robert},
 year = {1983},
 title = {Medieval and Modern Greek},
 publisher = {{Cambridge University Press}},
 isbn = {0521299780 9780521299787}
}

p.1 p.2 Bibliography

Silva
  • 743
  • 1
    You might be out of luck with getting csquotes to work with Arabic. See https://tex.stackexchange.com/questions/375051/how-to-use-csquotes-foreignquotes-with-rtl-languages. I had a go at implementing this at https://github.com/dcpurton/csquotes-bidi, but it's pretty dodgy. – David Purton Aug 24 '19 at 13:26

1 Answers1

4

I couldn't do this with polyglossia and xelatex.

But here's a go with babel and lualatex that might offer a way forward.

You have to create arabic.lbx for strings for biblatex and define Arabic quotes for csquotes. (I'm not sure about either the quotes or the translations…)

MWE

There's some comments in the code below explaining things a bit.

\documentclass[12pt]{article}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{Sharoni1969,
 author = {ميخائيل، ملاك  and  الشاروني، حبيب},
 year = {1969},
 title = {المرجع فى قواعد اللغة القبطية},
 address = {الاسكندرية},
 publisher = {جمعية مارمينا العجايبي},
 langid = {arabic}
}
@book{Browning1983,
 author = {Browning, Robert},
 year = {1983},
 title = {Medieval and Modern Greek},
 publisher = {Cambridge University Press},
 langid = {english}
}
\end{filecontents}

\begin{filecontents}{arabic.lbx}
\ProvidesFile{arabic.lbx}
\InheritBibliographyExtras{english}
% Translations thanks to Google Translate.
% I haven't provided abbreviations, because I don't know Arabic.
% You'll need to add more for other strings you use.
% Look in `english.lbx` for the string name.
\DeclareBibliographyStrings{%
  inherit          = {english},
  and              = {{و}{و}},
  page             = {{صفحة}{صفحة}},
  pages            = {{صفحات}{صفحة}},
  references       = {{مراجع}{مراجع}},
  seenote          = {{انظر الملاحظة}{انظر الملاحظة}},
}
\end{filecontents}

\usepackage[nil,bidi=basic-r]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,language=Default]{english}
\babelfont[arabic]{rm}{Amiri}
\babelfont[english]{rm}{Latin Modern Roman}

\usepackage{csquotes}
\DeclareQuoteStyle{arabic}
  {\guillemotleft}
  {\guillemotright}
  {\textquotedblright}
  {\textquotedblleft}

\usepackage[language=auto,autolang=other,citestyle=verbose-note,bibstyle=authortitle,doi=false,isbn=false]{biblatex} 
\addbibresource{\jobname.bib}

\defbibenvironment{bibliography}
  {\list
     {}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item\leavevmode}% add \leavevmode to align English bibliography items RTL

% Always use Arabic digits for see note.
\usepackage{xpatch}
\xpatchbibmacro{footcite:note}
  {\ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}
  {\foreignlanguage{arabic}{\ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
  {}
  {}

% Just to test if quotes work
\DeclareFieldFormat{title}{\mkbibquote{\mkbibemph{#1}}}

\begin{document}
\null\vfill
مع المثلة مثال \autocite[256]{Sharoni1969}.
مع المثلة مثال \autocite{Sharoni1969}.

مع المثلة مثال \autocite[256]{Browning1983}.
مع المثلة مثال \autocite{Browning1983}.

% With the above, the language changes back to Arabic before the final period
% is inserted, so it ends up being to the left of the note. This looks a bit
% odd to me, but the only way I could get the period at the right hand side of
% the note was to put it inside a footnote like this:
مع المثلة مثال\footnote{\cite{Browning1983}.}
\printbibliography
\end{document}

MWE output

David Purton
  • 25,884
  • @ David: I have only one issue with this solution, I am using other languages including "Coptic, Greek, Cyriac, Hebrew, Hungarian" and I need to use the system fonts "OTF" fonts used by windows. Is this allowable with babel and lualatex?? – Silva Aug 24 '19 at 16:46
  • your solution is flawless, I used you exact solution with a little modification, I replaced the babel package with polyglyossia, and everything worked except the part where you want the english text to be aligned from left to right, can you help me out?? Also the word bibliography is in English not arabic – Silva Aug 25 '19 at 02:00
  • @Silva, I was unable to get things working satisfactorily with polyglossia and xelatex. I think that biblatex does not work well with RTL languages with the bidi package. Hence my answer with lualatex and babel. There is no problem using system OTF fonts with lualatex and babel. You have complete control over what font you want to use for what language. – David Purton Aug 25 '19 at 04:43
  • @Silva, I will see if I can provide and answer to your question at https://tex.stackexchange.com/questions/504609/biblatex-usage-for-multiple-languages-in-same-citation to show usage for the different fonts. – David Purton Aug 25 '19 at 04:44
  • @ if that is the case, the I would be grateful if you can help me out regarding defining the following languages along with their otf fonts since I am currently using all of them: – Silva Aug 25 '19 at 09:00
  • Regarding the coptic language, it has been mentioned that "There is no babel Coptic language definition file, at least for now. When the Coptic language is invoked only its alphabet and its hyphenation rules are used, but it is not the same as specifying a coptic option to the babel package; this means that commands such as \selectlanguage{coptic} DO NOT WORK." (https://ctan.org/pkg/cbcoptic), Will this be an issue? Also Hieroglyph and Cyriac can't find them – Silva Aug 25 '19 at 09:31
  • I just asked a relevant question to this at https://tex.stackexchange.com/questions/505615/how-to-set-up-a-new-rtl-language-for-babel-using-ini-files. I think it will be quite easy to set up new languages for babel. – David Purton Aug 25 '19 at 09:56
  • @Silva, Though I don't know about hyphenation. I do think that increasingly babel will be the best option though. polyglossia is not really actively maintained. But babel and lualatex are getting many improvements. – David Purton Aug 25 '19 at 09:58
  • I am sorry, but how do I add the page number for repeated citations. As you can see, when you repeat a citation it says (See note 2 ...) how can I add page number, for example: "See note 2, p.10" such that this page number always refers to the original page of the first time this citation was references. Also, In case I include page nunmbers to the citations in the full cite command, how can the command be set to refer to the first incident of this citation with the same page number, else it puts the citation as if it is a new one? – Silva Mar 07 '20 at 01:25
  • @Silva, please ask a new question and reference this question for context. That way more people will see it. – David Purton Mar 07 '20 at 03:31
  • https://tex.stackexchange.com/questions/531567/biblatex-and-footcite-configurations – Silva Mar 07 '20 at 07:25
  • @ David Purton, https://tex.stackexchange.com/questions/574854/biblatex-numeric-citation-style-not-working-in-arabic-document-with-multilingu – Silva Dec 13 '20 at 16:14