9

Consider the following simple tikz picture

\begin{tikzpicture}
\tikz \draw (1,0) node{$\pi$} circle (1);
\end{tikzpicture}

enter image description here

I want to scale (increase the size) of the pi, but not of the circle itself.

I already tried to use a scalebox, but the resulting text wasn't placed inside the circle. I also tried

\begin{tikzpicture}
  \tikz \draw (1,0) node{\large $\pi$} circle (1);
\end{tikzpicture}

and

\begin{tikzpicture}
  \tikz \draw (1,0) node[font=\large]{$\pi$} circle (1);
\end{tikzpicture}

but both result in the error "TeX capacity exceeded, sorry [input stack size=5000]."

Can you tell me if there is a way to properly increase the font size for math mode inside tikz pictures?

1 Answer 1

13

You can use scale

\documentclass[tikz]{standalone}
\begin{document}
  \begin{tikzpicture}
  \draw (1,0) node[scale=6]{$\pi$} circle (1);
\end{tikzpicture}
\end{document}

enter image description here

or use font=\fontsize{60}{60}\selectfont with lmodern loaded.

\documentclass[tikz]{standalone}
\usepackage{lmodern}
\begin{document}
  \begin{tikzpicture}
  \draw (1,0) node[font=\fontsize{60}{60}\selectfont]{$\pi$} circle (1);
\end{tikzpicture}
\end{document}

BTW \tikz \draw should be \draw inside tikzpicture environment.

1
  • 2
    thank you for both, the answer to my font size problem and the answer to the problem with the input stack size error (which was to remove the \tikz)!
    – muffel
    Dec 7, 2014 at 11:32

You must log in to answer this question.

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