7

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

1 Answer 1

7

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:

enter image description here

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

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.