I'm writing my final project report in LaTeX and I'm using XeTeX to compile my files, because all the report is in hebrew.
The problem is when I'm trying to print the bibliography (using BibLaTeX, with BibTeX as the backend), the whole bibliography list doesn't contain the year field.
You can see for example that in the 1st reference, after the name Geoff in the first line, I get empty brackets instead of the brackets with the year of the reference inside them.
Compiler: XeTeX
Using also : BiDi, BibLaTeX, BibTeX
Running on Windows 10, using TeXStudio.
Note: The bibliography itself is in English (inside an LTR environment), but the whole report is in hebrew)
document.tex
\documentclass{report}
% Add XeTeX Packages support for hebrew
\usepackage{polyglossia}
\usepackage{fontspec}
\usepackage{bidi}
% Set BibTeX
\usepackage[backend=bibtex,bibstyle=numeric]{biblatex}
\addbibresource{sources}
% Fonts Support
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{David}
\let\hebrewfonttt\ttfamily
\setmainfont{David}
\setmonofont{David}
\setsansfont{David}
\title{מסמך בדיקה}
\author{יוצר בדיקה}
\begin{document}
\maketitle
\tableofcontents
% Some Text
\chapter{בדיקה ראשונה}
שלום עולם, מה שלום כולם ?
\nocite{*}
% References' List
\begin{LTR}
\begin{sloppypar}
\printbibliography[title=Bibliography]
\end{sloppypar}
\end{LTR}
\end{document}
sources.bib
@inproceedings{domingos2000mining,
title={Mining high-speed data streams},
author={Domingos, Pedro and Hulten, Geoff},
booktitle={Proceedings of the sixth ACM SIGKDD international conference on Knowledge discovery and data mining},
pages={71--80},
year={2000},
organization={ACM}
}
@article{garcia2010pattern,
title={Pattern classification with missing data: a review},
author={Garc{\'\i}a-Laencina, Pedro J and Sancho-G{\'o}mez, Jos{\'e}-Luis and Figueiras-Vidal, An{\'\i}bal R},
journal={Neural Computing and Applications},
volume={19},
number={2},
pages={263--282},
year={2010},
publisher={Springer}
}
Best Answer
This works, but I'm almost sure this is not the way to do it.
\setmainfont
,\setsansfont
and\setmonofont
need to specify the font for English because\normalfontlatin
relies on the main document font being a Latin Script (Polyglossia manual, 6).This may not matter so much if you are using a single font for English and Hebrew, of course.
You need to switch the language to English for the bibliography. This is pretty easy for the entries - just add
language=english
to Biblatex's options.But you need to also ensure this is done for the title of the chapter, if you want that in English.
I also switched the language of the surrounding document to English using
However, I had greatest trouble with the numeric labels in the bibliography, which are being taken by default from the Hebrew font. On my machine, this means they are just boxes. To ensure a consistent font for the bibliography, I added
which is why it matters a lot that this behaves as expected, of course.
I've also added the standard TeX ligatures to the Latin font setup since the bibliography uses things like ``, which won't work otherwise.
The final problem was that
\MakeUppercase
is then not defined when you switch the language to English. I assume this is a bug in something (Polyglossia?). Anyway, to work around this I created a new command to restore the default definitionand added
\restoreuppercase
after starting theenglish
environment and before executing\printbibliography
.The result:
Complete code:
I used Biber, but this may well work with BibTeX as the back-end, if you really don't want to use Biber.