TransWikia.com

Biblatex - Numeric citation style not working in arabic document with multilingual references

TeX - LaTeX Asked on July 7, 2021

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}
  {itemleavevmode}% 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}
AdaptNoteOptfootcitemultfootcite
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.stack.imgur.com/KOyoI.jpg
  [2]: https://i.stack.imgur.com/56NlM.jpg

One Answer

  1. With

    defbibenvironment{bibliography}
      {list
         {}
         {setlength{leftmargin}{bibhang}%
          setlength{itemindent}{-leftmargin}%
          setlength{itemsep}{bibitemsep}%
          setlength{parsep}{bibparsep}}}
      {endlist}
      {itemleavevmode}% 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}
      {itemleavevmode}
    

    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}
    

Answered by moewe on July 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP