6

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?

8

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.

  • 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 '14 at 11:32

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.