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.
\XeTeXtracingfonts= 1
to your document, and then compile on the command line withxelatex --nopdf file
andxdvipdfmx -vv file.xdv
then the log and the terminal output will show the pathes of the fonts used..Try
\setmonofont{Bitstream Vera Sans Mono}[Scale=0.9]` instead.