# How should I put a command in \circled?

I want to write a command, for example \pi or \rightarrow, inside a circle. I tried \circled{\pi} but this doesn't work.

How do I do it?

Define \circled in your preamble:

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=1](char) {#1};}}


Use math environment:

\circled{$\pi$}


\tikz \node[circle,draw] {$\rightarrow$};