showlabels change of font size

I am using \usepackage[left]{showlabels} to print labels for my equations.

For example, I have an equation as:

$$x = a + b \label{eqn:a_b}$$


The label is printed as:

Sometimes the label names are long so I wanted to change the font size, I did that using the following line:

\renewcommand{\showlabelfont}{\tiny}


However, the underscore "_" in my label name gets replaced after I change the fontsize.

There is no more "_" in the printed label. What is going on?

• Show a complete example. That makes it more easier to test your issue. – Ulrike Fischer Jan 30 at 19:18
• \documentclass{article} \usepackage[left]{showlabels} \renewcommand{\showlabelfont}{\tiny} %COMMENT AND UNCOMMENT \begin{document} $$x = a + b \label{eqn:a_b}$$ \end{document} – Alex Jan 30 at 19:24

\documentclass{article}
$$x = a + b \label{eqn:a_b}$$