[Tex/LaTex] How to use Ubuntu font with TeXLive 2012

fontsinstallingtexliveUbuntu

I really like the Ubuntu sans font, I want it be the section and title font as a replacement of Linux-Biolinum?

With Ubuntu 12.04 LTS + Texlive 2012, how to figure this out?

Best Answer

Use XeTeX, it comes with TeXLive 2012 and can use any system font automatically.

Here is a MWE that should work on Ubuntu. Copy to a new file, save as test.tex and compile it with xelatex test.tex from your console:

% !TEX TS-program = xelatex
% !TEX encoding =UTF-8 Unicode

\documentclass{scrartcl}
\usepackage{fontspec} % Allows font customization
\usepackage{xltxtra}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Ubuntu} % Main document font

\begin{document}

A one-line test.

\end{document}
Related Question