3

I am using luatex with the following example:

\documentclass[article, 11pt, b6paper, landscape, oneside]{memoir}

\usepackage{natbib}
\usepackage{arabluatex}
\usepackage[nopar]{quran}
\usepackage{lineno}
\usepackage{fontspec}

\begin{document}

This is to cite an English reference which is \cite{Abumostafa1993HintsVC}; and this is to cite the Arabic reference which is \txarb{\cite{MyKey}}. As you see, the Arabic in-text citation is messed up and the bibliography section cannot catch the bib info.

\clearpage

\bibliographystyle{asa}
\bibliography{tmp}

\end{document}

in-text citation Bibliography

My bib file is:

@Article{Abumostafa1993HintsVC,
  author =   {Abumostafa, Y S},
  title =    {{Hints and the Vc Dimension}},
  journal =  {Neural Computation},
  year =     1993,
  volume =   5,
  number =   2,
  pages =    {278-288},
  isbn =     {0899-7667}
}

@Article{MyKey,
  author =   {المؤلف},
  title =    {العنوان},
  journal =  {المجلة},
  year =     2000,
  volume =   5,
  number =   2,
  pages =    {278-288},
  isbn =     {0899-7667}
}

I have never been successful in to produce a good pdf in the case that my bib file has both English and Arabic bib items.

I am using emacs and auctex, which uses by default bibtex. I have Archlinux and use texlive.

EDIT: After trying using biblatex and biber (per the advice of the comments below):

    \documentclass[]{article}

\usepackage[autostyle]{csquotes}

\usepackage[
    backend=biber,
    style=authoryear-icomp,
    sortlocale=de_DE,
    natbib=true,
    url=false, 
    doi=true,
    eprint=false
    ]{biblatex}

\addbibresource{tmp.bib}

\usepackage[]{hyperref}
\hypersetup{
    colorlinks=true,
}

%% ##############################
\begin{document}
Lorem ipsum dolor sit amet~\citep{Abumostafa1993HintsVC}.
    At vero eos et accusam et justo duo dolores et ea rebum~\citet{MyKey}.
    \printbibliography 
\end{document}

this is the result (not appropriate of course): enter image description here

EDIT: When I ran biber from the shell, it gave me this error messages:

[0] Config.pm:302> INFO - This is Biber 2.9
[0] Config.pm:305> INFO - Logfile is 'tmp.tex.blg'
[49] biber:313> INFO - === Wed Dec 13, 2017, 12:44:00
[127] Utils.pm:185> ERROR - Cannot find control file 'tmp.tex.bcf'! - did you pass the "backend=biber" option to BibLaTeX?
[127] Biber.pm:114> INFO - ERRORS: 1

EDIT: I tried after adding the fontspec and arabluatex and compiling with emacs after clean all. The code is:

\documentclass[article, 11pt, b6paper, landscape, oneside]{memoir}
\usepackage{arabluatex}
\usepackage[nopar]{quran}
\usepackage{lineno}
\usepackage{fontspec}
\usepackage[autostyle]{csquotes}
\usepackage[
    backend=biber,
    style=authoryear-icomp,
    sortlocale=de_DE,
    url=false,
    doi=true,
    eprint=false
    ]{biblatex}
\addbibresource{tmp.bib}

\begin{document}
This is to cite an English reference which is \cite{Abumostafa1993HintsVC}; and this is to cite the Arabic reference which is \cite{MyKey}.

\printbibliography
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

However, it compiled and generated the pdf but without the Arabic name of the author in both the in-text citation and bibliography. The output is: enter image description here enter image description here

  • Please tell us how you run BibTeX. Do you run the "basic" (7-bit) version of bibtex, bibtex8 (which can handle 8-bit-encoded input), or (better still) bibtexu, which can handle utf8-encoded input natively? For that matter, which TeX distribution do you employ? It would be helpful if you edited your posting to provide a couple of examples of both english and arabic bib entries. – Mico Dec 11 '17 at 16:43
  • One more thing: Is the asa bibliography style online somewhere? – Mico Dec 11 '17 at 18:42
  • I am not sure; but if you suggest another style to use and produce the output that is fine. Edit: I have just tried IEEEtran and removed the natbib package; same problem exists! – Waleed A. Yousef Dec 11 '17 at 19:01
  • From emacs, do Command -> Clean all. Then recompile with lualatex, then do biber once, and finally recompile with lualatex twice. – Robert Alessi Dec 13 '17 at 12:48
  • I have done that exactly; biber generated the bib without the Arabic names. Please, see the EDIT above at the end of the post. – Waleed A. Yousef Dec 13 '17 at 19:35
3

I would strongly advice to use biblatex and biber instead of natbib and bibtex. That said, with arabluatex \txarb{} is only to be used with unicode Arabic script as its argument: this is why \txarb{\cite{somekey}} cannot work. Instead, you have to put \txarb{} in your .bib file at the appropriate places, like so:

@Article{Abumostafa1993HintsVC,
  author =   {Abumostafa, Y S},
  title =    {{Hints and the Vc Dimension}},
  journal =  {Neural Computation},
  year =     1993,
  volume =   5,
  number =   2,
  pages =    {278-288},
  isbn =     {0899-7667}
}

@Article{MyKey,
  author =   {\txarb{المؤلف}},
  title =    {\txarb{العنوان}},
  journal =  {\txarb{المجلة}},
  year =     2000,
  volume =   5,
  number =   2,
  pages =    {278-288},
  isbn =     {0899-7667}
}

As to your .tex file:

\documentclass[article, 11pt, b6paper, landscape, oneside]{memoir}

\usepackage{fontspec}

\usepackage{arabluatex}
\usepackage[nopar]{quran}
\usepackage{lineno}

\usepackage[style=authoryear]{biblatex}
\addbibresource{tmp.bib}

\begin{document}

This is to cite an English reference which is
\textcite{Abumostafa1993HintsVC}; and this is to cite the Arabic
reference which is \textcite{MyKey}. As you see, the Arabic in-text
citation is messed up and the bibliography section cannot catch the
bib info.

\clearpage

\printbibliography

\end{document}

Which gives this result:

  • Thanks so much; is there any way to have that particular reference in right-left style? – Waleed A. Yousef Dec 13 '17 at 4:19
  • There is, by teaching biblatex how the fields are to be displayed in Arabic references. For instance, such strings as the parentheses, 'In', 'pp.' and the like must be translated or adapted so that they are not printed RTL. Then, when you have achieved that, I would advise to have all of your Arabic references printed in a separate list. More details on how to get started: tex.stackexchange.com/q/293935/72582 and tex.stackexchange.com/q/297505 (but mind to get rid of all the polyglossia thing if you want to work with arabluatex) – Robert Alessi Dec 13 '17 at 9:45
  • Thanks so much; I will read all of that. I tried biblatex and biber for the simple example above. I was not successful as well. I will update the post to reflect the output. – Waleed A. Yousef Dec 13 '17 at 9:51
  • You just forgot to load arabluatex in your mwe! – Robert Alessi Dec 13 '17 at 10:02
  • Sorry; I added it right below the the class. Same problem. However, I found that biber is not installed; so I installed it. Same problem as well.! – Waleed A. Yousef Dec 13 '17 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.