5

I have a problem with the newpxmath package, which I would like to use in beamer for a presentation.

The symbol appearing when I use \bar{} is wrong.

For example with the simple code g\to q\bar{q} I get the result shown in the image below.

with the newpxmath package

However when I remove the package, and compile without newpxmath, I get the correct output

without the newpxmath package

Any ideas as to what might be causing this issue ?

The following code gives rise to the problem described above:

\documentclass{beamer}
\usepackage{newpxtext,newpxmath}
\begin{document}
\begin{frame}
$g\to q\bar{q}$
\end{frame}
\end{document}

Thanks.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jan 8 '15 at 20:56
  • I do not get this problem. There must be an issue with interactions with other (unspecified) packages or else something is out of date. Please provide an MWE so that we can compare. – Steven B. Segletes Jan 8 '15 at 20:58
  • In my own MWE, if I put \usepackage{newpxmath} before \usepackage[T1]{fontenc} I do not get the error. If I put newpxmath after fontenc I do get the error. But we need to see your code to understand the problem. – musarithmia Jan 8 '15 at 21:02
  • I've posted an MWE that gives rise to the problem the OP mentions. I'm conjecturing that it's actually the newpxtext package rather than the newpxmath package that's causing the problem: If newpxtext is not loaded, i.e., if only newpxmath is loaded, the math mode font problem does not seem to arise. – Mico Jan 8 '15 at 21:03
  • @Mico Thanks for your input. To put things in context, I am using the beamer template Stockholm available here : overleaf.com/2081728vjjnkb The problem however only seems to appear because of the newpxmath/newpxtext packages that are called, which is why I didn't mention the template in the original post. – deSitter Jan 8 '15 at 21:10
6

You need to tell beamer that you want to use custom fonts:

\documentclass{beamer}
\usefonttheme{professionalfonts}
\usepackage{newpxtext,newpxmath}
\begin{document}
  \begin{frame}
    $g\to q\bar{q}$
  \end{frame}
\end{document}

bar again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.