# Sans serif fonts in block headers while using another package [duplicate]

I'm brand new to TeX and am making my first beamerposter. I'm using XeLaTeX and I like the package pxfonts for the math and the body text. However, I'd like to have sans serif text in the block headers, and I don't like the default sans serif font that results from the pxfonts package. Can someone explain to me, in simple terms, why I cannot use the package fontspec to modify the sans serif font after I have loaded pxfonts? And what should I use instead?

Consider the code below. How can I change the font of the sans-serif part while keeping the first paragraph and the equation as they currently appear?

\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{pxfonts}

\begin{document}
\blindtext

$\int_0^1 x^2 \, dx = 1/3$

\sffamily \blindtext %This is the text whose font I wish to change to something already loaded on my computer.
\end{document}


-

## marked as duplicate by ChrisS, Svend Tveskæg, Sean Allred, Jesse, egregApr 23 '14 at 22:33

Can you add an example of code? –  egreg Apr 22 '14 at 21:40
@egreg Actually the whole beamerposter context is unimportant. Really I just want to know how to switch between the serif and sans-serif font...without having to use the default sans-serif font provided by pxfonts. –  user1577636 Apr 22 '14 at 23:20
The content is unimportant, but it's easier for us to have some code to play with, rather than starting from scratch. –  egreg Apr 22 '14 at 23:22
@egreg Alright, does this edit help? –  user1577636 Apr 22 '14 at 23:33
That site is mistaken if you have TeX Live. I don't know about MiKTeX. If you have TeX Live, you can install it by running getnonfreefonts-sys and selecting the appropriate package. The script will handle the installation etc. Optima cannot be distributed as part of TeX Live. –  cfr Apr 23 '14 at 2:02

You can install Optima by running getnonfreefonts-sys and selecting the appropriate package if you have TeX Live. Once the font is installed you can use this:

\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{pxfonts}
\renewcommand{\sfdefault}{uop}

\begin{document}
\blindtext

$\int_0^1 x^2 \, dx = 1/3$

\sffamily \blindtext %This is the text whose font I wish to change to something already loaded on my computer.
\end{document}


-