I use moderncv to compile my cv, I know that the best solution is biblatex
, so I followed this solution to make it properly work with moderncv
.
My bibliography has entries in three different languages (english, french and greek), and I want to keep the entry's language in the reference list. I have found this solution. I want to use different .bib files for my papers with prefix by category and reverse numbering (i.e. first paper with number 1, but put on the bottom).
I have succesfully put them all together, but missed only one thing: the main language of the document is greek, but I need the prefixes to be in latin characters, i.e. D instead of Δ. I tried with \latintext
and \foreignlanguage{english}{...}
, but apparently I cannot use anything starting with a \
as a value for prefixnumbers
.
MWE:
\documentclass[11pt,a4paper,sans]{moderncv}
\usepackage[francais,english,greek]{babel}
\usepackage[LGR,OT1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{filecontents}
\begin{filecontents}{theses.bib}
@article{gp01,
author = {Georgiou, George and Poulios, John},
title = {A very interesting {P}aper},
year = {2001},
journal = {Science},
volume = {12},
number = {9},
pages = {390--451},
hyphenation = {english}
}
@book{pg13,
author = {Poulios, John and Georgiou, George},
title = {Une livre très importante},
year = {2013},
publisher = {Springer},
address = {Paris},
hyphenation = {francais}
}
\end{filecontents}
\begin{filecontents}{journals.bib}
@CONFERENCE{CP15,
author = {Makridis, Andreas and Poulios, John},
title = {Assembly 2015 (Poster)},
booktitle = {Astronomical Conference},
address = {Athens, Greece},
date = {28 June -- 7 July,},
year = {2015},
pages = {54},
hyphenation = {english}
}
@ARTICLE{CAgr,
author = {Πούλιος, Ιωάννης and Μακρίδης, Ανδρέας},
title = {Ελληνικό συνέδριο},
journal = {Χρονικά},
year = {2014},
volume = {54},
pages = {043018},
hyphenation = {greek}
}
\end{filecontents}
\usepackage[sorting=ydnt,% Sort by year (descending), name, title
style=numeric,%
firstinits=true,% Initials on first names
defernumbers=true,% Required to use 'prefixnumbers' option in \printbibliography
maxnames=99,% Show all authors
autolang=other%
]{biblatex}
% Reverse numbering
% SRC: https://tex.stackexchange.com/a/37850/51724
\AtDataInput{%
\csnumgdef{entrycount:\strfield{prefixnumber}}{%
\csuse{entrycount:\strfield{prefixnumber}}+1}}
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\newrobustcmd*{\mkbibdesc}[1]{%
\number\numexpr\csuse{entrycount:\strfield{prefixnumber}}+1-#1\relax}
% biblatex for moderncv
% SRC: https://tex.stackexchange.com/a/123809/51724
\defbibenvironment{bibliography}
{\list
{\printtext[labelnumberwidth]{% label format from numeric.bbx
\printfield{prefixnumber}%
\printfield{labelnumber}}}
{\setlength{\topsep}{0pt}% layout parameters from moderncvstyleclassic.sty
\setlength{\labelwidth}{\hintscolumnwidth}%
\setlength{\labelsep}{\separatorcolumnwidth}%
\leftmargin\labelwidth%
\advance\leftmargin\labelsep}%
\sloppy\clubpenalty4000\widowpenalty4000}
{\endlist}
{\item}
% Make one author bold
% SRC: https://tex.stackexchange.com/a/211821/51724
\newcommand{\makeauthorbold}[1]{%
\DeclareNameFormat{author}{%
\ifnumequal{\value{listcount}}{1}
{\ifnumequal{\value{liststop}}{1}
{\expandafter\ifstrequal{##1}{#1}{\textbf{##1\addcomma\addspace ##4\addcomma\isdot}}{##1\addcomma\addspace ##4\addcomma\isdot}}
{\expandafter\ifstrequal{##1}{#1}{\textbf{##1\addcomma\addspace ##4}}{##1\addcomma\addspace ##4}}}
{\ifnumless{\value{listcount}}{\value{liststop}}
{\expandafter\ifstrequal{##1}{#1}{\textbf{\addcomma\addspace ##1\addcomma\addspace ##4}}{\addcomma\addspace ##1\addcomma\addspace ##4}}
{\expandafter\ifstrequal{##1}{#1}{\textbf{\addcomma\addspace ##1\addcomma\addspace ##4\addcomma\isdot}}{\addcomma\addspace ##1\addcomma\addspace ##4\addcomma\isdot}}%
}%
}%
}
\addbibresource[label=T]{theses.bib}
\addbibresource[label=J]{journals.bib}
% moderncv themes
\moderncvstyle{casual}
\moderncvcolor{blue}
\firstname{Εγώ}
\familyname{Επώνυμο}
\title{Βιογραφικό Σημείωμα}
\address{Εδώ}
\email{me@gmail.com}
\usepackage{xpatch}
\xapptocmd\emailsymbol{\latintext}{}{} % email address written in latin characters
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
\makecvtitle
\makeauthorbold{Poulios}
\begin{refsection}[J]
\nocite{*}
\printbibliography[heading=subbibliography, title={Δημοσιεύσεις},prefixnumbers={J}]
\end{refsection}
\begin{refsection}[T]
\nocite{*}
\printbibliography[heading=subbibliography, title={Διατριβές},prefixnumbers={D}]
\end{refsection}
\end{document}