I want to add bibliography to a document mainly written with Arabic language but intervened with some English text. Therefore, I opted for arabxetex
approach rather than polyglossia
, becasue IMHO gives you more flexibility to switch between the two directions than when you have much text in English and few text in Arabic (I am open to other opinions as well).
Anyway, the problem is with bibliography and how to produce an Arabic counterpart to that of English without any transliteration or outright compromises. I came from this question trying to find an answer but it was in lualatex with a suboptimal output, and hence inadequate.
Questions
As you can see only the citation key did appear, how to fix that? How and to make the citation numbers appear in Hindi numbers (Waahid-red, Ithnaan-green, Thalaatha,etc) instead of Arabic (1,2,3,etc)?
No
Bibliography
section did appear at the end of the document? And if it appears how to make it appear in Arabic language likeالمراجع
?What is the best approach to enter the fields of information for references in Arabic text, what am I missing?
MWE Code
\documentclass[oneside,16pt]{scrartcl}
%=====================Graphics ===================================
\usepackage[demo]{graphicx}
\usepackage{xcolor}
\usepackage{tikz}
%=====================Floats =====================================
\usepackage{floatrow}
\usepackage{float}
\usepackage{scrhack}
\usepackage{caption}
\captionsetup[figure]{labelfont=bf,labelsep=period,format=plain,skip=0pt,font=small}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{subcaption}
%=====================Hyphenation ================================
\usepackage[none]{hyphenat}
\usepackage[protrusion = true,final]{microtype}
\emergencystretch=2em
%=====================Hyperref ===================================
\usepackage[hyperindex=true, hyperfootnotes=true]{hyperref}
\hypersetup{
colorlinks, linkcolor={blue},
citecolor={blue}, urlcolor={blue}
}
%=====================Font issues ===================================
\usepackage{fontspec}
\usepackage{csquotes}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{arabxetex}% default options are "novoc" and "fdf2alif";
% other options are "voc", "fullvoc", "utf", "trans" and "fdf2noalif"
\newfontfamily\arabicfont[Script=Arabic]{Amiri} % or put whatever open type Arabic font you have on your machine inside the two braces
%=====================Bibliography ===================================
\usepackage[style=verbose,backend=biber]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{ibnsina:shifa:physics:ar,
author = {ابن سينا},
year = {١٤١٧},
title = {السماع الطبيعى من كتاب الشفاء},
publisher = {دار المناهل},
location = {بيروت},
}
\end{filecontents}
\addbibresource{\jobname.bib}
%=====================End of Preamble ===================================
\begin{document}
\begin{arab}[voc]
وَهَذِهِ فِقرَةٌ بِالعَرَبِيَة مَعَ كَلِمَة اِنكلِيزِيَة رقم 1 او 2 باللغة اللعربية.
\noindent
(\textLR{Words in \textbf{English} with \textsc{small caps} or \textit{italics} are also possible}).
عند الحاجة الى المصدر باللغة العربية \cite{ibnsina:shifa:physics:ar} تذهب الى باب المراجع فلا تجده.
\end{arab}
\printbibliography
\end{document}
MWE Output
Update 1
Based on the informative answer from PLK, some bugs are now fixed, what remains is the comma issue (circled in red), it is not in Arabic style (should be directed upwards instead of downwards).
\documentclass[oneside,16pt]{scrartcl}
\usepackage{fontspec}
\usepackage{csquotes}
\usepackage{polyglossia}
\setmainlanguage{arabic}
\setotherlanguage{english}
\setmainfont{Arial}
\newfontfamily\arabicfont[Script=Arabic,Mapping=arabicdigits]{USAMA NASKH}
\newfontfamily\arabicfontsf[Script=Arabic,Mapping=arabicdigits]{USAMA NASKH}
\newfontfamily\arabicfonttt[Script=Arabic,Mapping=arabicdigits]{USAMA NASKH}
\usepackage[style=numeric,backend=biber]{biblatex}
\DefineBibliographyStrings{english}{%
references = {المراجع},
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{ibnsina:shifa:physics:ar,
author = {{ابن سينا}},
year = {1417},
title = {السماع الطبيعى من كتاب الشفاء},
publisher = {دار المناهل},
location = {بيروت},
}
\end{filecontents}
\addbibresource{\jobname.bib}
%=====================End of Preamble ===================================
\begin{document}
وَهَذِهِ فِقرَةٌ بِالعَرَبِيَة مَعَ كَلِمَة اِنكلِيزِيَة رقم 1 او 2 باللغة اللعربية.
\textenglish{(Words in \textbf{English} with \textsc{small caps} or \textit{italics} are also possible).}
عند الحاجة الى المصدر باللغة العربية \parencite{ibnsina:shifa:physics:ar} تذهب الى باب المراجع فتجده، لكن الفارزة ليست على الطراز العربي بل الافرنجي.
\printbibliography
\end{document}
Output
Question Updated:
How to fix the comma?
Update 2
Based on PLK's great help to fix the comma issue, the final code is below:
\documentclass[oneside,16pt]{scrartcl}
\usepackage{fontspec}
\usepackage{csquotes}
\usepackage{polyglossia}
\setmainlanguage{arabic}
\setotherlanguage{english}
\setmainfont{Arial}
\newfontfamily\arabicfont[Script=Arabic,Mapping=arabicdigits]{USAMA NASKH}
\newfontfamily\arabicfontsf[Script=Arabic,Mapping=arabicdigits]{USAMA NASKH}
\newfontfamily\arabicfonttt[Script=Arabic,Mapping=arabicdigits]{USAMA NASKH}
\usepackage[style=numeric,backend=biber]{biblatex}
\DefineBibliographyStrings{english}{%
references = {المراجع},
}
\makeatletter
\def\abx@comma{\ifdim\lastkern>\z@\unkern\fi\abx@puncthook{،}}% \makeatother
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{ibnsina:shifa:physics:ar,
author = {{ابن سينا}},
year = {1417},
title = {السماع الطبيعى من كتاب الشفاء},
publisher = {دار المناهل},
location = {بيروت},
}
\end{filecontents}
\addbibresource{\jobname.bib}
%=====================End of Preamble ===================================
\begin{document}
وَهَذِهِ فِقرَةٌ بِالعَرَبِيَة مَعَ كَلِمَة اِنكلِيزِيَة رقم 1 او 2 باللغة اللعربية.
\textenglish{(Words in \textbf{English} with \textsc{small caps}, or \textit{italics} are also possible).}
عند الحاجة الى المصدر باللغة العربية \parencite{ibnsina:shifa:physics:ar} تذهب الى باب المراجع فأنك حتما ستجده و مع الفارزة هذه المرة على الطراز العربي الاصيل.
\printbibliography
\end{document}
Output