2

I have a .bib bibliography that has some entries completely in English and some completely in Hebrew.

I'd like to display the bibliography items so that the Hebrew items are justified right-to-left and the English items left-to-right. The bibliography should all be under one title ("Bibliography" or "References"), then all the Hebrew items, then all the English items.

I've tried many things but could not get anything to work. I am using LyX, so I prefer a solution using pdflatex and bibtex, but biber with biblatex might also be okay.

MWE

In this MWE both files (.tex and .bib) are CP1255-encoded; the same result occurs with UTF8-encoding, but with UTF8, I need to \DeclareUnicodeCharacter all the Hebrew characters or it won't compile...

mwe.bib

@article{EnglishExample,
    title={Example},
    author={John McAuthor},
    year={2016},
    journal={American Journal of Examples}
}

@article{HebrewExample,
    title={דוגמה},
    author={מחבר},
    year={2016},
    journal={כתב העת הישראלי לדוגמאות}
}

mwe.tex

\documentclass[oneside,hebrew,english]{book}
\usepackage[T1]{fontenc}
\usepackage[cp1255,latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter
\usepackage{apacite}

\makeatother

\usepackage{babel}
\begin{document}
\inputencoding{cp1255}%
\inputencoding{latin9}test \inputencoding{cp1255}\R{בדיקה}

\inputencoding{latin9}\bibliographystyle{apacite}
\nocite{*}
\bibliography{mwe}

\end{document}

In this example, the "test" in the document itself renders fine:

test1.png

However, the bibliography looks like this:

test_bib.png

I want it to look like this (excuse the inconsistent styling - I made this with MS Word...):

test_bib_hebrew.png

  • 1
    Which things? Your question is unanswerable by anybody who cannot write or find some Hebrew. (I've answered questions on RTL typesetting, but only when they've contained an MWE. I'm probably not alone in this.) My guess is that BibTeX is hopeless for this. Or very, very painful. Biblatex can be used with BibTeX, but you want Biber here. You also want XeLaTeX and polyglossia for anything like a smooth experience. Mind you, I'm thinking unicode. Maybe you have Hebrew entries transliterated? In that case, scotch everything I said. – cfr Feb 15 '16 at 2:47
  • 1
    Note that bidirectional typesetting really is much easier with XeTeX. How are you typesetting Hebrew now? cumulus? If that's the best LyX can do, I'd ditch LyX. Life will be easier by far. – cfr Feb 15 '16 at 2:51
  • Thanks for the reply. I'll edit with a MWE soon, but basically, I have actual Hebrew, not transliterated. regarding Unicode, sure, I don't mind the encoding though - easiest would be UTF-8 but I don't mind cp1255 or ISO-8859-8 either. Clearly, if I switch to xetex with polyglossia, which LyX seems to kinda support, Unicode will be more native, but I still haven't figured out how to make it work... Right now I'm using culmus. – Yoni Rozenshein Feb 15 '16 at 6:53
  • Edited with a MWE. – Yoni Rozenshein Feb 15 '16 at 7:56
  • As cfr said, your life will be easier without LyX in this case. – Johannes_B Feb 15 '16 at 8:19
5

An approach using XeLaTeX with polyglossia and biblatex.

yonirozenscheinHebrewBib

%\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @article{EnglishExample,
        title={Example},
        author={John McAuthor},
        year={2016},
        journal={American Journal of Examples},
        language={engllish},
        keywords={english}
    }

    @article{HebrewExample,
        title={דוגמה},
        author={מחבר},
        year={2016},
        journal={כתב העת הישראלי לדוגמאות},
        language={hebrew},
        keywords={hebrew}
    }
\end{filecontents}
\documentclass{article}
\usepackage{blindtext}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{hebrew}
\usepackage[style=apa]{biblatex}
\addbibresource{\jobname.bib}
\DeclareLanguageMapping{english}{english-apa}
\defbibenvironment{hebbib}{\begin{otherlanguage}{hebrew}
    \list
     {}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
    {\endlist\end{otherlanguage}}{\item}
\begin{document}
\blindtext

\begin{otherlanguage}{hebrew}בדיקה
     (נהגה לַטֶךְ) היא שפת סימון ועריכת מסמכים. לרוב מסומנת
     בלוגו \LaTeX. הרעיון העומד מאחורי שפה זו הוא לחסוך את
     הטרחה שבעיצוב מכותב המסמך, ולהטיל מלאכה זו על 
\end{otherlanguage}

\nocite{*}
\printbibheading
\printbibliography[heading=subbibliography,keyword=english,title={english refs}]
\printbibliography[heading=subbibliography,keyword=hebrew,title={hebrew
refs},env=hebbib]


\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.