0

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}

mwe

  • 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
  • @ChrisS My issue is different because I want to use fontspec only for certain contexts, and the package pxfonts for others. The question you've cited merely shows how to switch between various fonts using fontspec. – user1577636 Apr 23 '14 at 01:11
  • You can't use fontspec for part and pxfonts for part as I understand it. You can certainly use pxfonts and change the sans-serif afterwards. But if you insist on doing so with fontspec you are out of luck. Why not simply use fontspec? What does pxfonts do which fontspec cannot? – cfr Apr 23 '14 at 01:41
  • @cfr I want Palatino font for my math equations, but math-supported Palatino is not stored on my computer. – user1577636 Apr 23 '14 at 01:49
  • @cfr I'm ok with not using fontspec if you have some alternative method to achieve my desired result... – user1577636 Apr 23 '14 at 01:51
  • @cfr Actually you mentioned that "You can certainly use pxfonts and change the sans-serif afterwards." Where would this be done? – user1577636 Apr 23 '14 at 01:52
  • What do you want to change it to? You could use mathpazo before fontspec, by the way. – cfr Apr 23 '14 at 01:53
  • @cfr Optima. (I get the error that 'uop' is not found when I do it the obvious way...) – user1577636 Apr 23 '14 at 01:54
  • You'd have to use something which you have installed for TeX i.e. not a system font but one from your TeX installation. – cfr Apr 23 '14 at 01:57
  • @cfr I tried using mathpazo before fontspec and everything was changed to cmr!! – user1577636 Apr 23 '14 at 01:57
  • @ cfr This website: http://www.tug.dk/FontCatalogue/optima/ says that I should have it... – user1577636 Apr 23 '14 at 01:58
  • 1
    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 02:02

1 Answers1

1

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}

Palatino with Optima

cfr
  • 198,882