plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
520 stars 118 forks source link

Indentation for multilingual references in numeric style of referencing #1142

Open vinoruto opened 3 years ago

vinoruto commented 3 years ago

For the shown MWE, I am using Lualatex (Babel: default language = Arabic) + Biblatex. Citations are prepared from resources with various languages. I arranged the Bibliography such that the references are filtered based upon the used language. However, in the bibliography, I have noticed the following:

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

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

 \usepackage{tocbibind} 

\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 = {جمعية مارمينا العجايبي},
 keywords = {Arabic},
 langid = {arabic}
}
@book{Browning1983,
 author = {Browning, Robert},
 year = {1983},
 title = {Medieval and Modern Greek},
 publisher = {Cambridge University Press},
 keywords = {English}, 
 langid = {english}
}
@book{bob,
 author = {Browning, Robert},
 year = {1983},
 title = {Medieval and Modern Greek},
 publisher = {Cambridge University Press},
 keywords = {English}, 
 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=autobib,
  autolang=other,
  citestyle=numeric-comp,
  bibstyle=numeric,
  backend=biber,
  doi=false,
  isbn=false]{biblatex}   

\addbibresource{\jobname.bib}

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

\begin{otherlanguage}{english}
mmmm
\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
erer \cite{Browning1983}
\newline
erer \cite{Sharoni1969}
\newline
erer \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

\printbibheading

\printbibliography
[
keyword=Arabic,
heading=subbibliography,
title=
{مراجع}
]
\printbibliography
[
keyword=English,
heading=subbibliography,
title=
{
\foreignlanguage{english}{english resources}
}
]

\end{document}

Tp3n2

moewew commented 3 years ago

I'm afraid I know nothing about RTL typesetting in general and Arabic typesetting in particular in TeX. I'm guessing in order to make it possible a lot is going on behind the scenes (e.g. also for things like enumerate) and that that does not always plays nicely with how biblatex does things. But I have no idea where to start looking. Sorry.


As I say I know nothing, but here is a guess. I think it might be tricky to generate a combined English/Arabic bibliography where individual entries switch languages. It might be easier to have two separate lists: One typeset entirely in English and one typeset entirely in Arabic. This would also allow us to use different list definitions for the bibliographies in case that is something that helps make the output look better.


When I run your example, the keyword filter appears to work. I get three different bibliographies. One containing all three references, one with only the Arabic reference and one with the two English sources.

vinoruto commented 3 years ago

In all cases, even if you separate the bibliography using the keyword, the indentation issue is still there. In addition, Upon making separate bibliographies for each language, the references are not organized numerically in an ascending order and therefore it won't be appropriate/ suited for the document in its final form.

vinoruto commented 3 years ago

/cc @dcpurton

moewew commented 3 years ago

With two separate bibliographies the numbering could be fixed with defernumbers (as the warning suggests). But yeah, at the moment that does not give the (I guess) expected ouptut either, because numbered lists as used by biblatex are (apparently) tricky in RTL. What I was guessing above was that it might be much easier to get two separate bibliographies (one LTR one RTL) going than one combined bibliography that switches directions all the time. But as I also said above, I don't have enough knowledge about RTL to be able to help with either...

EvanAad commented 2 years ago

I don't get the output shown in the original post when I compile with lualatex, biber, lualatex, even when I replace the Simplified Arabic font with one that's available on my system and that supports Arabic, such as FreeSerif or Amiri. Here's what my PDF file looks like: ArabicExample