luatex 并使用 natbib 的英语和阿拉伯语书目

luatex 并使用 natbib 的英语和阿拉伯语书目

我使用luatex以下示例:

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

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

\begin{document}

这是为了引用英文参考文献 \cite{Abumostafa1993HintsVC};这是为了引用阿拉伯文参考文献 \txarb{\cite{MyKey}}。如您所见,阿拉伯文文内引用混乱不堪,参考书目部分无法获取参考书目信息。

\clearpage

\bibliographystyle{asa}
\bibliography{tmp}

\end{document}

文内引用参考书目

我的 bib 文件是:

@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}
}

如果我的bib文件同时包含英语和阿拉伯语bib内容,我从来没有成功生成一份好的 PDF。

我使用 emacs 和 auctex,默认使用 bibtex。我有 Archlinux 并使用 texlive。

编辑:尝试使用 biblatex 和 biber 后(根据以下评论的建议):

    \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}

这是结果(当然不合适): 在此处输入图片描述

编辑:当我从 shell 运行 biber 时,它给了我以下错误消息:

[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

编辑:我尝试添加fontspecarabluatex清理所有后使用 emacs 进行编译。代码如下:

\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:

但是,它编译并生成了 PDF,但在文内引用和参考书目中都没有作者的阿拉伯语名字。输出是: 在此处输入图片描述在此处输入图片描述

答案1

我强烈建议使用biblatexandbiber而不是natbiband bibtex。也就是说,witharabluatex \txarb{}只能与 unicode 阿拉伯文字一起使用作为其参数:这就是为什么它\txarb{\cite{somekey}}无法工作。相反,您必须将其放在\txarb{}.bib 文件中的适当位置,如下所示:

@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}
}

至于您的 .tex 文件:

\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}

得出的结果是:

相关内容