I am using Bera Sans Mono as the monospaced font for typesetting code listings using the listings
package. This is done for slides which are produced using beamer
and XeLaTeX. My preamble includes the following (which used to work before a recent update to the MikTeX engine, the fontspec package, and the above-mentioned packages):
\usepackage{fontspec}
\setmonofont{Bera Sans Mono}[Scale=0.9] % for code listings beramono is used
\newfontfamily\quotefont{Linux Libertine O}[Ligatures=TeX] % selects Libertine for quotation marks
If I do not use \setmonofont
and have the following preamble instead, the correct output is produced:
\usepackage{fontspec}
\usepackage[scaled]{beramono}
\usepackage[T1]{fontenc}
\newfontfamily\quotefont{Linux Libertine O}[Ligatures=TeX] % selects Libertine for quotation marks
Why am I unable to use \setmonofont{Bera Sans Mono}[Scale=0.9]
(which used to work before)?
Some additional points to note:
- XeLaTeX is able to find the font
\setmonofont
appears to work correctly with other fonts, just not Bera Sans Mono.
Best Answer
There is no opentype font
Bera Sans Mono
, xelatex finds the normal type1 version and as it is not unicode encoded you get garbage.To quote the CTAN info (http://www.ctan.org/pkg/bera)
So with xelatex you should use