[Tex/LaTex] Linux Libertine O and Linux Biolinum O not found

fontsfontspeclibertinewarningsxetex

I have TeX Live 2011. I set

\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}

but I get a warning that these fonts are not found! If I try \usepackage{libertineotf}, I get the same warning. I compile with xelatex. Please tell me what is wrong.

Best Answer

I use the following code to help with supporting xetex and pdftex with Linux Libertine and Latin Modern Mono along with Biolinum. You need to use fontspec, and you don't need to load the libertine package at all with xetex unless you want some of the libertine-specific glyph commands, so you can remove it.

\usepackage{ifxetex}
\usepackage{ifthen}

\ifxetex
    \usepackage{libertine}
    \usepackage[log-declarations=false]{xparse} % same as below
  \usepackage[quiet]{fontspec} % remove quiet option to check for errors
  \setromanfont[Ligatures={Common,TeX}]{Linux  Libertine O}
  \setmainfont[Ligatures={Common,TeX}]{Linux  Libertine O}
    \setmonofont[SmallCapsFont={Latin Modern Mono Caps}]{Latin Modern Mono Light}
    \setsansfont{Linux Biolinum O}
    \usepackage{xunicode}
\else
    \usepackage{sansmath}
    %\usepackage{lmodern}
    \usepackage{libertine}
    \usepackage{DejaVuSansMono}
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage{textcomp}
  \usepackage{epstopdf}
  \usepackage[final,expansion=true,protrusion=true,spacing=true,kerning=true]{microtype}
\fi

TeX Live should have the fonts installed already, but I use miktex, so I can't help with distribution specific troubles. Remember to rehash your db.

Update: disregard DejaVuSansMono and update the pdftex code accordingly.