0

For the shown MWE I am using Lualatex (Babal: Default language is Arabic) + Biblatex (Numeric style for citation and bibliography style), I have the following issues:

  • The bibliography and citation styles are set to numeric, however, the generated bibliography does not give a numeric bibliography.

  • Language used for reference numbering is not unified along the whole document, it is generated according to the "langid" in the reference file, I use "langid" to sort references according to their language, so how can I select the language which is used to set reference nmbering?

  • When placing numerous citations within the same "cite" command for example "cite{ref1,ref2,.....}" not all citations are generated

  • Sometimes the citations are too much, so in order to avoid confusion I put each citation on a seperate line within the same "cite" command, also in this case the citations are not generated properly.

  • Also, in addition to generate numerous citations with page numbering, I used the "cites" command, yet this is also not working.


\documentclass[a4paper,12pt,twoside]{book}

%==================================================================================================
%CROSS-Referencing
%==================================================================================================

 \usepackage{tocbibind} 
\usepackage[multiple]{footmisc} 
\usepackage{footnoterange} 

\usepackage[%
  hidelinks,
  hyperindex,
  colorlinks=true,
  breaklinks,
  allcolors=blue]{hyperref} 

\usepackage{bookmark}

%======================================================================================================
%Babel Package Settings%
%======================================================================================================

\usepackage{filecontents}


\usepackage[bidi=basic,layout=lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,language=Default]{english}

\babelfont{rm}{Latin Modern Roman}
\babelfont[arabic]{rm}{Simplified Arabic}
\babelfont[english]{rm}{Times New Roman}

\babelcharproperty{980000}[990000]{direction}{al} 


%=============================================================
%BIBLIOGRAPHY SETTINGS%
%=============================================================
\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}
}
@book{bob,
 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}
\DeclareBibliographyStrings{%
  inherit          = {english},
  and              = {{و}{و}},
  page             = {{صفحة}{صفحة}},
  pages            = {{صفحات}{صفحة}},
  references       = {{مراجع}{مراجع}},
  seenote          = {{انظر الملاحظة}{انظر الملاحظة}},
}
\end{filecontents}

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



\usepackage[%
  language=auto,
  autolang=other,
  citestyle=numeric-comp,
  bibstyle=numeric,
  backend=biber,
  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}}}

\usepackage{footnote} % For footcite to work in talbes and captions fgures
\makesavenoteenv{figure}
\makesavenoteenv{table}

%So as to have commas between consecutive \footcite command, declare after bibaltex package so as to see the command
\usepackage{fnpct}
\AdaptNoteOpt\footcite\multfootcite
\setfnpct{punct-after=true,mult-fn-sep =،} 

%==================================================
%Start actual document %
%===================================================
\begin{document}

\begin{otherlanguage}{english}
All citations appear correctly upon using a cite command on each citation
\cite{Browning1983}
\cite{Sharoni1969}
\cite{bob}
\newline
Citation numbering appear according to the "langid" in reference definition, how to unify output language to a chosen language??
\newline
English numbering \cite{Browning1983}
\newline
Arabic numbering \cite{Sharoni1969}
\newline
English numbering \cite{bob}
\newline
Issue displaying the second reference upon putting each citation on a separate line
\cite
{
Browning1983,
Sharoni1969
}
\newline
Issue displaying the second reference in the same "cite" command
\cite{Browning1983,Sharoni1969}
\\
Issue using the cites command
\cites[30]{bob};[40]{bob};[60]{Sharoni1969};{Browning1983}

\newline

Issue using citec command on more than one line for clarity of coding
\cites
[30]{bob};
[40]{bob};
[60]{Sharoni1969};
{Browning1983}


\end{otherlanguage}

\printbibliography

\end{document}
 


``````````````````````````````````````````````

[![enter image description here][1]][1]

[![enter image description here][2]][2]


  [1]: https://i.sstatic.net/KOyoI.jpg
  [2]: https://i.sstatic.net/56NlM.jpg

1 Answer 1

1
  1. With

    \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
    

    you are defining a bibliography environment that does not use numeric labels. This looks like a definition that would work for style=authoryear or style=authortitle, but not for style=numeric. For a numeric style you want to take

    \defbibenvironment{bibliography}
      {\list
         {\printtext[labelnumberwidth]{%
            \printfield{labelprefix}%
            \printfield{labelnumber}}}
         {\setlength{\labelwidth}{\labelnumberwidth}%
          \setlength{\leftmargin}{\labelwidth}%
          \setlength{\labelsep}{\biblabelsep}%
          \addtolength{\leftmargin}{\labelsep}%
          \setlength{\itemsep}{\bibitemsep}%
          \setlength{\parsep}{\bibparsep}}%
          \renewcommand*{\makelabel}[1]{\hss##1}}
      {\endlist}
      {\item}
    

    as a basis, so maybe

    \defbibenvironment{bibliography}
      {\list
         {\printtext[labelnumberwidth]{%
            \printfield{labelprefix}%
            \printfield{labelnumber}}}
         {\setlength{\labelwidth}{\labelnumberwidth}%
          \setlength{\leftmargin}{\labelwidth}%
          \setlength{\labelsep}{\biblabelsep}%
          \addtolength{\leftmargin}{\labelsep}%
          \setlength{\itemsep}{\bibitemsep}%
          \setlength{\parsep}{\bibparsep}}%
          \renewcommand*{\makelabel}[1]{\hss##1}}
      {\endlist}
      {\item\leavevmode}
    

    works.

  2. The biblatex option language=auto, switches bibliography entries and citations according to langid. If you drop language=auto, (and thus go back to only the default language=autobib,) only bibliography entries change according to langid. Citations will use the surrounding language settings.

  3. I could not see this issue in the MWE.

  4. biblatex reads citations as comma-separated lists. Spaces at the beginning of list items (i.e. after commas) are dropped, but spaces at at the end of items (i.e. before commas) are not dropped. This means that when you say

    \cite
    {
    Browning1983,
    Sharoni1969
    }
    

    biblatex looks for citations called Browning1983 (which is found) and Sharoni1969 (with a space at the end, which isn't found). You could use

    \cite
    {
    Browning1983,
    Sharoni1969%
    }
    

    to escape the implied space, but I really can't recommend this. I would recommend a slightly more compact input like

    \cite{Browning1983,
    Sharoni1969}
    

    which will definitely work.

  5. The correct syntax for multi-cite commands like \cites does not use semicolons between citations.

    \cites[30]{bob};[40]{bob};[60]{Sharoni1969};{Browning1983}
    

    should be

    \cites[30]{bob}[40]{bob}[60]{Sharoni1969}{Browning1983}
    

    Similarly,

    \cites
    [30]{bob};
    [40]{bob};
    [60]{Sharoni1969};
    {Browning1983}
    

    should be

    \cites
    [30]{bob}
    [40]{bob}
    [60]{Sharoni1969}
    {Browning1983}
    
7
  • all suggestions worked, the proposed environment worked fine, however, the english references are not aligned to the LHS in the bobliography, and also the reference numbering apear with its bracket reversed "]1[" instead of [1], also regarding the language used for numbering the references in the bibliography, is there a way to control whether it matches the default language or the reference language or set it to a chosen language. Also is there a way to control where apears (Whether all numbers apear on RHS or LHS or written on before the reference (aligned according to reference lang
    – Silva
    Commented Dec 13, 2020 at 17:44
  • regarding the option, language=auto, is there a way to set it to a default language throughout the whole document?, I need to make it apear in arabic letters even if I am using a different environment
    – Silva
    Commented Dec 13, 2020 at 17:48
  • Also if I remove the environment I defined as well as the environment you defined, upon compilation it gives the same result as that which is generated by the environment you defined.
    – Silva
    Commented Dec 13, 2020 at 17:58
  • @Silva Mhhh, I can see a difference between the output with \leavevmode and without. But I'll admit that both results don't look right. Unfortunately, I don't know enough about how mixed-language RTL/LTR lists are handled and my playing around did not really result in something that appears to work completely, so the only option that I can offer is to generate one English and one Arabic bibliography. But as I say, I don't know enough about that. So if you'd like me to delete the answer so you can get another one, please let me know.
    – moewe
    Commented Dec 13, 2020 at 18:31
  • @Silva In principle you can force a particular language for biblatex, but that would apply both to citations and the bibliography, so doesn't seem advisable here. It might be possible to code something that always switches your citations to the same language by redefining \blx@beglangcite and \blx@endlangcite.
    – moewe
    Commented Dec 13, 2020 at 18:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .