# Use math equation as bchart label

I used bchart to generate a chart, it worked well in almost case, however I have to put a math equation into bar label but it is unable to compile.

My document worked well

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{bchart}

\begin{document}
\begin{bchart}[max=0.3]
\bcbar[label=$\theta$]{0.2}
\end{bchart}
\end{document}


Now I have to change the label to $\theta=a^2$, how can I put the equation into the label value

You have to enclose in a group, i.e. { }, the text:

\bcbar[label={$\theta=a^2$}]{0.2}


The complete example:

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{bchart}

\begin{document}
\begin{bchart}[max=0.3]
\bcbar[label={$\theta=a^2$}]{0.2}
\end{bchart}
\end{document}


The result:

• @KhoiNguyen Thanks are better conveyed by accepting (clicking the green tick mark) and upvoting the answer :-)
– user11232
Nov 8, 2013 at 9:48