I want to apply a unit to my axis. Usually I use the siunitx
package for that. However, this time I would like to use a Greek letter with a subscript \mu_\text{B}
but my document won't compile.
Here is a MWE which compiles if you remove the $
s.
\documentclass[]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{pgfplots,tikz}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\begin{document}
\begin{figure}[tbch]
\centering
\begin{tikzpicture}
\begin{axis}[
axis line style={very thick},
axis lines = left,
y unit ={$A$},
unit marking pre={\text{in }},
unit marking post={},
ylabel = Yupp
]
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}