1

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 – samcarter_is_at_topanswers.xyz Dec 24 '15 at 21:03
  • 1
    Adding \tikzset{every node/.append style={font=\fontfamily{phv}\selectfont}} changes the text font, but not the math font, so perhaps not good enough. – Torbjørn T. Dec 24 '15 at 23:21
  • 1
    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 '15 at 0:48
  • @cfr Your comment sounds like it could answer the question. Do you want to write an answer? – samcarter_is_at_topanswers.xyz Nov 14 '16 at 13:18
  • @samcarter Please just undelete your answer since you've already written it! – cfr Nov 14 '16 at 16:57
1

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}

enter image description here

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.