I'm writing in English about Arabic collocations, quoting both English and Arabic sources. As there are many sources, I use a sectioned bibliography, filtering for keywords with biblatex, where each sections consists of either only English or only Arabic sources.
Using XeTeX and polyglossia, the main language of my document is English, so I have to switch to Arabic for the Arabic sections of my bibliography. This works partially insofar as the section is right-to-left, but the Arabic letters are disconnected.
Garbled output
Minimal (not) working example
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{csquotes}
\setmainfont[Mapping=tex-text]{Amiri}
\setsansfont[Mapping=tex-text]{Amiri}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{arabic}
\usepackage{filecontents}
\begin{filecontents}{refs_test.bib}
@Article{Ghazala1993,
author = {غزالة, حسن},
title = {ترجمة المتلازمات اللفظية (عربي-انجليزي)},
journaltitle = {ترجمان},
year = {1993},
keywords = {arabic},
}
@Book{Baalbaki1987,
author = {Baalbaki, Munir},
title = {Al-Mawrid: A Modern Arabic-English Dictionary},
year = {1987},
publisher = {Dar al-'Ilm li'l-Malayin},
address = {Beirut},
keywords = {english}
}
\end{filecontents}
\usepackage[style=authoryear,backend=biber]{biblatex}
\addbibresource{refs_test.bib}
\usepackage{xunicode}
\begin{document}
Sample enumeration:
\begin{enumerate}
\item first
\item second
\end{enumerate}
\section{References}
\nocite{*}
\printbibliography[keyword={english}, title={English Dictionaries}, heading=subbibliography]
\selectlanguage{arabic}
\printbibliography[keyword={arabic}, title={قواميس عربية}, heading=subbibliography]
\end{document}
NB: I am aware of the following questions, which deal with related but different problems:
- Arabic bibliography with biblatex is concerned with adding Arabic sources to a (mostly) English bibliography
- Polyglossia: Arabic Text, English Bibliography is the inverse situation: Arabic document, English bibliography.
Edit: Adding Script=Arabic
as suggested by Salim Bou
Using
\setmainfont[Mapping=tex-text,Script=Arabic]{Amiri}
\setsansfont[Mapping=tex-text,Script=Arabic]{Amiri}
makes the letter get connected, but seems to turn the document from LTR to RT: In enumerations, for example, the numbers are preceded by points, not the other way around. (To make this point clear, I added an enumeration to the MWE and updated the images.)
\setmainfont[Mapping=tex-text]{Amiri}
to\setmainfont[Mapping=tex-text,Script=Arabic]{Amiri}
same for\setsansfont
bib
file and document with\textarabic{}
? e.g.,author = {\textarabic{غزال, حسن}}
You might also have to create an arabiccsquotes
style to get the quotation marks right. And you will probably need varioussort
fields to make sure your bibliography (and index) is sorted correctly.bib
file ... especially since biblatex is able to produce a somewhat correct bibliography without this markup when the document's main language is Arabic. (Only somewhat: As you mentioned, quotation marks are wrong and some strings, like "In" for articles, need to be translated.){\setmainfont[Mapping=tex-text,Script=Arabic]{Amiri} \setsansfont[Mapping=tex-text,Script=Arabic]{Amiri}\selectlanguage{arabic}\printbibliography[keyword={arabic}, title={قواميس عربية}, heading=subbibliography]}