I've set some pgfkeys such as precision=2 and use comma. Now I wonder how do I get the results of


to be bold and/or sans serif?

I thought this is easy, but everything I find online is just concerning plots, and does not work for me.

  • A good answer to your question heavily depends on what you are doing: could you post an example starting with \documentclass, ending with \end{document}? Commented Jun 15, 2013 at 14:34

1 Answer 1


Regular text formatting doesn't apply to math mode and \pgfmathprintnumber inherently uses \ensuremath behind the scenes around the number. You can turn it off via

\pgfmathprintnumber[assume math mode=true]{123.567}

Then it will assume that it is already in the math mode and won't modify the number printing. That means the number will be interpreted as regular text.

But I recommend keeping the math mode and (changing the math font) or (using \mathbf{} type of math font modifiers).

  • ah ok, did not know that it uses \ensuremath. thanks. Commented Jun 15, 2013 at 15:25
  • additionally, how would one change the font size \pgfmathprintnumber prints?
    – joaocandre
    Commented Nov 16, 2013 at 20:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .