2

I am making a beamer presentation with some pgfplots figures and I want to change the font family to sans serif for all tick labels. The problem is that it doesn't work for the y-axis as you can see below. It works if I don't use the 'professionalfonts' font theme but I need it. It also works for normal axis instead of semilogyaxis. Is this a bug?

I use the very latest 1.12.1 revision of pgfplots.

\documentclass{beamer}
\usefonttheme{professionalfonts}
\usepackage{pgfplots}

\begin{document}

\begin{frame}
  \begin{tikzpicture}
    \begin{semilogyaxis}[tick label style={/pgf/number format/assume math mode=true,font=\sffamily}]
    \end{semilogyaxis}
  \end{tikzpicture}
\end{frame}

% this works but I want to use 'semilogyaxis'
\begin{frame}
  \begin{tikzpicture}
    \begin{axis}[tick label style={/pgf/number format/assume math mode=true,font=\sffamily}]
    \end{axis}
  \end{tikzpicture}
\end{frame}

\end{document}

labels of the y-axis are not sans serif: enter image description here

this is how it should look like (comment '\usefonttheme{professionalfonts}' out): enter image description here

closed as off-topic by Stefan Pinnow, Zarko, user31729, Werner, CarLaTeX Feb 17 '17 at 20:14

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • IMHO it's not a bug. The purpose of the professionalfonts theme is explicitly to not mess with the fonts in any way, assuming the user has set them up the way he/she wants. This means the normal beamer font substitution (using sans serif math) does not happen when professionalfonts is used. Because no math font was set up in the code, the default Computer Modern (serif) math font is used. – Paul Gessler May 24 '15 at 21:03
  • 1
    Consider that the same thing also happens with just \begin{frame} $e = mc^2$ \end{frame}, it may help to think about it without pgfplots involved at all. – Paul Gessler May 24 '15 at 21:09
  • Thanks for you comment but everything works as expected for non-logarithmic axis. '/pgf/number format/assume math mode=true' should remove the math mode flags but it doesn't (at least for log. axis). – user3226575 May 24 '15 at 22:06
  • 2
    Because the log axis has to use math mode to typeset exponents. – Paul Gessler May 24 '15 at 22:07
  • 4
    I'm voting to close this question as off-topic because the log axis has to use math mode to typeset exponents. – Stefan Pinnow Feb 17 '17 at 18:10

Browse other questions tagged or ask your own question.