2

Is there a way to use Hebrew in the title field of bibliography database, so it might be displayed properly when the bibliography is generated by biblatex? What happens is: the Hebrew text appears correctly (utf8 encoding) but the last world becomes the first.

To give you some context: The rest of the bibliographic citation has latin characters as I'm writing in Italian, but with some Hebrew in the text and in the bibliography.

\documentclass{article}[9pt]
\begin{filecontents*}{Midrash.bib}
@book{frenkelYvnymBvlmvHrvkhny1981a, 
title = {עיונים בעולמו הרוחני של ספור האגדה.}, 
author = {Frenḳel, Yonah.}, 
date = {1981}, 
publisher = {{Hakibuts Hame'uḥad}}, 
location = {{Tel-Aviv}}, 
langid = {hebrew} 
} 
\end{filecontents*}
\usepackage{reledmac} 
\usepackage{fontspec} 
\usepackage{polyglossia} 
\usepackage{wrapfig} 
\setdefaultlanguage{italian} 
\setotherlanguage{hebrew} 
\setmainfont{Times New Roman} 
\usepackage[style=verbose-trad3,doi=false,isbn=false,url=false,eprint=false]{biblatex}
\bibliography{Midrash.bib} 
\Xarrangement[A]{paragraph} 
\begin{document} 
see \cite{frenkelYvnymBvlmvHrvkhny1981a} 
\printbibliography 
\end{document}

The result is shown in the image below:

enter image description here

Thanks!

LEo
  • 772
Haim
  • 487
  • Are you using babel? With pdfTeX, XeTeX, LuaTeX? – Javier Bezos Nov 05 '21 at 14:48
  • \usepackage{polyglossia}

    \setdefaultlanguage{italian} \setotherlanguage{hebrew} \setmainfont{Times New Roman} \newfontfamily{\hebrewfont}{New Peninim MT}

    – Haim Nov 05 '21 at 14:54
  • And I'm compiling with xelatex, biber – Haim Nov 05 '21 at 14:54
  • And this is the bibliographic entry: – Haim Nov 05 '21 at 14:55
  • @book{frenkelYvnymBvlmvHrvkhny1981a, title = {עיונים בעולמו הרוחני של ספור האגדה.}, author = {Frenḳel, Yonah.}, date = {1981}, publisher = {{Hakibuts Hame'uḥad}}, location = {{Tel-Aviv}}, langid = {hebrew} } – Haim Nov 05 '21 at 14:56
  • Not an answer, but I think you misspelled סיפור in your title. – Don Hosek Nov 05 '21 at 14:59
  • Good point! I imported automatically from WorldCat... – Haim Nov 05 '21 at 15:00
  • Also, it would be helpful if you can edit your question to include a complete minimal document that shows the problem (it should run from \documentclass to \end{document} and you can add your bib file as a separate code block (use the {} button to show your code as code. – Don Hosek Nov 05 '21 at 15:01
  • Sorry I don't know how to show the code as code – Haim Nov 05 '21 at 15:10
  • \documentclass{article}[9pt]

    \usepackage{reledmac}

    \usepackage{fontspec} \usepackage{polyglossia} \usepackage{wrapfig}

    \setdefaultlanguage{italian} \setotherlanguage{hebrew} \setmainfont{Times New Roman} \newfontfamily{\hebrewfont}{New Peninim MT}

    \usepackage[style=verbose-trad3, doi=false,isbn=false,url=false,eprint=false]{biblatex}

    \bibliography{Midrash.bib}

    \Xarrangement[A]{paragraph}

    \begin{document}

    see \cite{frenkelYvnymBvlmvHrvkhny1981a}

    \printbibliography

    \end{document}

    – Haim Nov 05 '21 at 15:13
  • It is not a solution, but you set hebrew as the main language and the text will be right order. I've tried explicitly using \texthebrew{...} or \begin{hebrew}...\end{hebrew}to enter the bibliography title, but it did not work. – LEo Nov 05 '21 at 17:58
  • Thanks! Cannot set Hebrew as main language as the main text is left to right. There are Hebrew quotations in the text using \begin{hebrew}...\end{hebrew} which works just fine to isolate to right to left chunks... I guess I will just transliterate the Hebrew titles in the bibliography. – Haim Nov 05 '21 at 21:10
  • @Haim What, you can’t cite only palindromes? – Davislor Nov 06 '21 at 21:28

1 Answers1

3

My understanding is that you have to tell polyglossia what font to use for each language, and when you are using each language.

hebrew bib

Blue is FreeSerif font set as \hebrewfont.

By the time biblatex/biber reads the .bib file, the polyglossia command in the .bib file is already established, because polyglossia has been loaded before biblatex.

The dummy bib ref is just a random snippet from the Wikipedia article on the solar system.

MWE

% !TeX TS-program = lualatex

\documentclass{article}[9pt] \begin{filecontents}[overwrite]{Midrash.bib} @book{frenkelYvnymBvlmvHrvkhny1981a, title = {\begin{hebrew}עיונים בעולמו הרוחני של סיפור האגדה\end{hebrew}.}, author = {Frenḳel, Yonah.}, date = {1981}, publisher = {{Hakibuts Hame'uḥad}}, location = {{Tel-Aviv}}, langid = {hebrew} } @book{מ, title={\begin{hebrew}מערכת השמש\end{hebrew}}, author={\begin{hebrew}נפטון\end{hebrew}}, } \end{filecontents} \usepackage{reledmac} \usepackage{xcolor} \usepackage{fontspec} \usepackage{polyglossia} \usepackage{wrapfig} \setdefaultlanguage{italian} \setotherlanguage{hebrew} \setmainfont{Times New Roman} \newfontfamily\hebrewfont{FreeSerif}[Script=Hebrew,Color=blue] \usepackage[style=verbose-trad3, doi=false, isbn=false, url=false, eprint=false, backend=biber ]{biblatex} \addbibresource{Midrash.bib} \Xarrangement[A]{paragraph} \begin{document} \section{אבגד -- without environment} \section{\begin{hebrew}אבגד \end{hebrew} -- with environment} \begin{hebrew}אבגד הוז חטיך כלםמ ןנסע ףפץצ קרשת\end{hebrew}

See \cite{frenkelYvnymBvlmvHrvkhny1981a,מ} 
\printbibliography 

\end{document}

I used biblatex's \addbibresource command, as well.


Addendum

Babel package

Lualatex can identify scripts by using Unicode algorithms, so explicit markup is not generally needed. (Multiple runs of different scripts diving in and out of the main script, like the Latin texts in the Hebrew-version bibliography, will need markup, for a tidier presentation.)

For a comparison of intermingled languages (ignoring runs), using babel package compiled with lualatex to take advantage of this feature, with Italian as the main language:

italian main

MWE

\documentclass{article}[9pt]
\begin{filecontents*}[overwrite]{\jobname.bib}
    @book{frenkelYvnymBvlmvHrvkhny1981a, 
        title = {עיונים בעולמו הרוחני של סיפור האגדה.}, 
        author = {Frenḳel, Yonah.}, 
        date = {1981}, 
        publisher = {{Hakibuts Hame'uḥad}}, 
        location = {{Tel-Aviv}}, 
        langid = {hebrew} 
    } 
    @book{מ,
    title={מערכת השמש},
    author={נפטון},
    }
\end{filecontents*}
\usepackage{reledmac} 
\usepackage{xcolor}
\usepackage{wrapfig} 
\usepackage{fontspec} 
\usepackage[italian,bidi=basic]{babel}%<--- main language 
\usepackage[autostyle]{csquotes}

\babelfont{rm}{Noto Serif} \babelfont{sf}{Noto Sans} \babelfont{tt}{Noto Sans Mono} \babelprovide[import, onchar=fonts ids]{hebrew} \babelfont[hebrew]{rm}[Color=blue]{LiberationSerif}

%\makeatletter%workaround to satisfy biblatex parms - not needed %\newtoggle{blx@lang@captions@english} %\makeatother

\usepackage[style=verbose-trad3, doi=false, isbn=false, url=false, eprint=false, backend=biber ]{biblatex} \addbibresource{\jobname.bib}

\Xarrangement[A]{paragraph} \begin{document} \section{אבגד} אבגד הוז חטיך כלםמ ןנסע ףפץצ קרשת

The cat sat on the mat.

\section{הוז}
        אבגד הוז the cat חטיך כלםמ ןנסע ףפץצ קרשת


See \cite{frenkelYvnymBvlmvHrvkhny1981a,מ} \printbibliography \end{document}

and with Hebrew as the main language:

hebrew main

MWE

\documentclass{article}[9pt]
\begin{filecontents*}[overwrite]{\jobname.bib}
    @book{frenkelYvnymBvlmvHrvkhny1981a, 
        title = {עיונים בעולמו הרוחני של סיפור האגדה.}, 
        author = {Frenḳel, Yonah.}, 
        date = {1981}, 
        publisher = {{Hakibuts Hame'uḥad}}, 
        location = {{Tel-Aviv}}, 
        langid = {hebrew} 
    } 
    @book{מ,
    title={מערכת השמש},
    author={נפטון},
    }
\end{filecontents*}
\usepackage{reledmac} 
\usepackage{xcolor}
\usepackage{wrapfig} 
\usepackage{fontspec} 
\usepackage[bidi=basic]{babel} 
\usepackage[autostyle]{csquotes}

\babelfont{rm}{Noto Serif} \babelfont{sf}{Noto Sans} \babelfont{tt}{Noto Sans Mono} \babelprovide[import, main, onchar=fonts ids]{hebrew}%<-- main language \babelfont[hebrew]{rm}[Color=blue]{LiberationSerif}

\makeatletter%workaround to satisfy biblatex parms \newtoggle{blx@lang@captions@english} \makeatother

\usepackage[style=verbose-trad3, doi=false, isbn=false, url=false, eprint=false, backend=biber ]{biblatex} \addbibresource{\jobname.bib}

\Xarrangement[A]{paragraph} \begin{document} \section{אבגד} אבגד הוז חטיך כלםמ ןנסע ףפץצ קרשת

The cat sat on the mat.

\section{הוז}
        אבגד הוז the cat חטיך כלםמ ןנסע ףפץצ קרשת


See \cite{frenkelYvnymBvlmvHrvkhny1981a,מ} \printbibliography \end{document}

Cicada
  • 10,129
  • Thanks it works. – Haim Nov 09 '21 at 01:06
  • Only 2 questions: – Haim Nov 09 '21 at 01:06
  • It does not seem to work with XeLatex (tell me if I'm wrong) then I will have to investigate LuaLatex, which I do not use and do not know...; 2. It is a bit weird to have the \beginhebrew environment in my Zotero library with makes it unsuitable for other copy paste usages...
  • – Haim Nov 09 '21 at 01:08
  • 1
    (1) babel package with lualatex can auto-detect the script(s), no need of environments; (2) https://tex.stackexchange.com/questions/138992/help-getting-started-with-hebrew-in-babel/611604#611604 may help; (3) choosing a compiler is done simply via a drop-down list in TeXworks editor in TeXLive distribution (on Windows); how do you choose to run xelatex/lualatex/pdflatex/etc? (4) make sure all your packages and distribution are up-to-date; (5) ask a separate question (linking back to this one) about running under a specific setup, version or package combination(s) - more eyes on it. – Cicada Nov 09 '21 at 04:22
  • Thanks for the clarifications! – Haim Nov 09 '21 at 17:50