6

I am creating a document;it's main language beeing greek. What I am trying to do, unsuccessfully is to have bibliography entries in two languages, Greek and English that is.

My code is

\RequirePackage{filecontents}
\begin{filecontents*}{testbib.bib}
@comment Datei testbib.bib

@article{Mayer,
title = "The 11B(p,a)8Be nuclear reaction and 11B(p,p)11B backscattering cross sections for analytical purposes ",
journal = "Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms ",
volume = "143",
number = "3",
pages = "244 - 252",
year = "1998",
note = "",
issn = "0168-583X",
doi = "http://dx.doi.org/10.1016/S0168-583X(98)00383-8",
url = "http://www.sciencedirect.com/science/article/pii/S0168583X98003838",
author = "M. Mayer and A. Annen and W. Jacob and S. Grigull",
language  ="English",
hyphenation="english"
}

@Mastersthesis{Vpaneta,
    author = "Συγγραφέας",
    title  = "Τίτλος",
    year   = "2012",
    month  = "μήνας",
    school = "Κατι",
    language  ="Greek",
    hyphenation="greek"
}
\end{filecontents*}

\documentclass[11pt,a4paper]{book}

\usepackage[english,greek]{babel}
\usepackage[iso-8859-7]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{kerkis}
\usepackage{pifont}
\usepackage[unicode]{hyperref}
% \usepackage[bibencoding=auto,backend=biber,babel=other]{biblatex}
% \addbibresource{testbib.bib}

\newcommand{\sw}{\selectlanguage{english}}
\newcommand{\sq}{\selectlanguage{greek}}
\newcommand{\eng}[1]{\latintext#1\greektext}
\newcommand{\gre}[1]{\greektext#1\latintext}

\begin{document}
 \tableofcontents
 \chapter{Κεφάλαιο}
  \section{Ενότητα}
  σδφγηξκλ\cite{Mayer}hgfkhgjfkhgfkhg\cite{Vpaneta}
  \section{Ενότητα}
 \addcontentsline{toc}{chapter}{Βιβλιογραφία}
  \bibliographystyle{plain}
  %\selectlanguage{english}
  \bibliography{testbib}
  %\printbibliography
\end{document}

Preferably I would like to use utf8 encoding in order to have greek contents in the pdf viewer. However when using utf8 encoding there's no way to produce the .pdf file. There are errors stating that

Package inputenc Error: Unicode char \u8:��2 not set up for use with LaTeX

therefore I have to use iso-8859-7 encoding. Note that I change my editor's encoding accordingly.

What can I do to prefferably use a utf8 encoding to create the bibliography and use 2 different languages or as a last solution to use iso-8859-7 encoding to create in the same way(i.e. using 2 languages) the bibliography?

My output using iso-8859-7 encoding is

enter image description here

When changing the language to English the output is

enter image description here

8
  • 1
    For multilingual bibliographies, biblatex is the only way to go (I don't think babelbib supports Greek).
    – egreg
    Commented Sep 14, 2014 at 10:01
  • @egreg : I am not sure if I am using babelbib... I think I am using bibtex or what is default when running quick build from Kile.
    – Thanos
    Commented Sep 14, 2014 at 10:04
  • No, you're not using babelbib. Note that @comment Datei testbib.bib is syntactically incorrect and will produce errors.
    – egreg
    Commented Sep 14, 2014 at 10:21
  • I will erase it! Any idea how to produce the bibliography using utf8?
    – Thanos
    Commented Sep 14, 2014 at 10:29
  • See section 3.10.3 in the documentation of biblatex
    – egreg
    Commented Sep 14, 2014 at 10:30

1 Answer 1

4

you don't need to use XeLaTeX with biblatex, it works with pdflatex too. You sample compiles fine for me with pdflatex, utf8 option of fontenc, biblatex and biber for unicode bibliography support, and fontenc package with T1 and LGR options for font support (although it seems it works even without fontenc):

\RequirePackage{filecontents}
\begin{filecontents*}{testbib.bib}

@article{Mayer,
title = "The 11B(p,a)8Be nuclear reaction and 11B(p,p)11B backscattering cross sections for analytical purposes ",
journal = "Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms ",
volume = "143",
number = "3",
pages = "244 - 252",
year = "1998",
note = "",
issn = "0168-583X",
doi = "http://dx.doi.org/10.1016/S0168-583X(98)00383-8",
url = "http://www.sciencedirect.com/science/article/pii/S0168583X98003838",
author = "M. Mayer and A. Annen and W. Jacob and S. Grigull",
language  ="English",
hyphenation="english"
}

@Mastersthesis{Vpaneta,
    author = "Συγγραφέας",
    title  = "Τίτλος",
    year   = "2012",
    month  = "μήνας",
    school = "Κατι",
    language  ="Greek",
    hyphenation="greek"
}
\end{filecontents*}

\documentclass[11pt,a4paper]{book}

\usepackage[english,greek]{babel}
\usepackage[T1,LGR]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage[utf8]{inputenc}
\usepackage{kerkis}
\usepackage{pifont}
\usepackage[unicode]{hyperref}
 \usepackage[bibencoding=auto,backend=biber,babel=other]{biblatex}
 \addbibresource{testbib.bib}

\newcommand{\sw}{\selectlanguage{english}}
\newcommand{\sq}{\selectlanguage{greek}}
\newcommand{\eng}[1]{\latintext#1\greektext}
\newcommand{\gre}[1]{\greektext#1\latintext}

\begin{document}
 \tableofcontents
 \chapter{Κεφάλαιο}
  \section{Ενότητα}
  σδφγηξκλ\cite{Mayer}hgfkhgjfkhgfkhg\cite{Vpaneta}
  \section{Ενότητα}
 \addcontentsline{toc}{chapter}{Βιβλιογραφία}
 % \bibliographystyle{plain}
  \selectlanguage{english}
  %\bibliography{testbib}
  \printbibliography
\end{document}

compile it with

 pdflatex filename.tex
 biber filename
 pdflatex filename.tex

and of course, file filename.tex must be in utf8 encoding enter image description here

8
  • Thank you very much for your answer. I run pdflatex file.tex, then biber file.tex but I got errors INFO - This is Biber 1.9 INFO - Logfile is 'testBibliography.tex.blg' ERROR - Cannot find control file 'testBibliography.tex.bcf'! - did you pass the "backend=biber" option to BibLaTeX? INFO - ERRORS: 1...
    – Thanos
    Commented Sep 14, 2014 at 11:36
  • @Thanos just run biber filename, without .tex extension. I will modify my answer.
    – michal.h21
    Commented Sep 14, 2014 at 11:39
  • Now it's working!!! Thank you very much for your help and time!!!
    – Thanos
    Commented Sep 14, 2014 at 12:10
  • 1
    @Thanos Just remove the language field from each bibliography entry if you don't want its contents printed. It is the hyphenation (preferred name langid) field that actually switches the language.
    – mvkorpel
    Commented Sep 15, 2014 at 12:06
  • 1
    @giannis references are numerical, but normal English text is printed with Greek letters because Greek is selected as the document language
    – michal.h21
    Commented Apr 30, 2015 at 10:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .