# Change font only in a tikzpicture in beamer document class

I'm doing a presentatin with the beamer documentclass. I use tikzpicture to annotate a figure. I do it like this

\begin{figure}[htp]
\centering
\begin{tikzpicture}
\node[anchor=south west, inner sep=0] at (0,0) {\includegraphics{somepicture}};
\node[anchor = west] at (5,0) {Some text with $some math$};
\end{tikzpicture}
\end{figure}


I'm trying to annotate this figure, which I made with xmgrace. The default font in this program is Helvetica, if I'm not wrong. So I would like to change the font of every text within my tikzpicture into an Helvetica font. But I cannot find any solution for this. The font of the tikzpicture does not seem to change at all ...

• The easiest thing would be to use Helvetica for the whole beamer document, \usepackage[scaled]{helvet} does this for you ctan.org/pkg/helvet Dec 24, 2015 at 21:03
• Adding \tikzset{every node/.append style={font=\fontfamily{phv}\selectfont}} changes the text font, but not the math font, so perhaps not good enough. Dec 24, 2015 at 23:21
• Or you can just say \begin{tikzpicture}[font={\fontfamily{phv}\selectfont}] which should, I think, change it for non-nodes as well. (Some nodes don't seem to count as node-nodes although I'm not sure what the distinction is based on.)
– cfr
Dec 31, 2015 at 0:48
• @cfr Your comment sounds like it could answer the question. Do you want to write an answer? Nov 14, 2016 at 13:18
– cfr
Nov 14, 2016 at 16:57

To convert cfrs comment into a (partial) answer that does not deal with math:

\documentclass{beamer}

\usepackage{tikz}

\begin{document}
\begin{frame}

\begin{figure}
test in normal font

\begin{tikzpicture}[font={\fontfamily{phv}\selectfont}]
\node[anchor=south west, inner sep=0] at (0,0) {test in phv};
\end{tikzpicture}
\end{figure}

\end{frame}
\end{document}