To switch between different languages in the bibliography, biblatex uses babel's or polyglossia's macro \selectlanguage
. xgreek seems to be similar to babel and polyglossia, but it doesn't define \selectlanguage
.
You can try to put
\RequirePackage{polyglossia}
\newfontfamily\greekfont[Script=Greek]{Gentium} % or other font with support for greek
\setmainlanguage[variant=monotonic]{greek} % variant can be polytonic, monotonic, or ancient
\setotherlanguage{english} % you need to put here \setotherlanguage for each language that you are using in the bibliography
to your style file instead of xgreek
. Study polyglossia
manual for more details.
maybe try to remove some unnecessary options of biblatex:
\RequirePackage[
backend=biber
,bibencoding=utf8
,natbib=true
,style=authoryear
,babel=hyphen
]{biblatex}
part of problem was, that you have explicitly set bibliography language to greek.
I'd go directly to unicode-math:
\documentclass[a4paper]{article}
\usepackage{mathtools} % loads amsmath that should go before unicode-math
\usepackage{unicode-math}
\setmainfont[Numbers=OldStyle]{Palatino Linotype}
\setsansfont{Optima}
\setmonofont{Consolas}
\setmathfont{Asana Math}
Asana Math is based on the MathPaZo fonts.
If you really need brackets and parentheses from the MathPaZo fonts, it's doable:
\DeclareSymbolFont{brackets} {OT1}{zplm}{m}{n}
\SetSymbolFont{brackets}{bold} {OT1}{zplm}{b}{n}
\DeclareSymbolFont{largebrackets} {OMX}{zplm}{m}{n}
\SetSymbolFont{largebrackets}{bold}{OMX}{zplm}{m}{n}
\DeclareMathDelimiter{(}{\mathopen} {brackets}{"28}{largebrackets}{"00}
\DeclareMathDelimiter{)}{\mathclose}{brackets}{"29}{largebrackets}{"01}
\DeclareMathDelimiter{[}{\mathopen} {brackets}{"5B}{largebrackets}{"02}
\DeclareMathDelimiter{]}{\mathclose}{brackets}{"5D}{largebrackets}{"03}
For the Knuth calligraphic font, add
\setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{XITS Math}
For a "better" \vDash
symbol, add
\setmathfont[range=\vDash]{XITS Math}
The "not belonging to" symbol should always be specified with \notin
rather than with \not\in
.
Finally, for the AMS blackboard bold:
\DeclareSymbolFont{AMSb}{U}{msb}{m}{n}
\protected\def\mathbb#1{{\mathchar\numexpr256*\symAMSb+`#1\relax}}
Best Answer
The simplest way to get correct English hyphenation in your setup is to use
\foreignlanguage
:You may want to define a shorthand in the preamble, such as
so the input can be
Note that loading
xltxtra
is not recommended any more. The most recent versions offontspec
take care of what used to be delegated toxltxtra
, including the default font features.