Context
I would like to add automatically numbered highlighted comments in text.
Attempt
Following this answer I wrote the following
\documentclass{article}
\usepackage{color}
\usepackage{soul}
\newcounter{mycounter}
\newcommand\showmycounter{\stepcounter{mycounter}\themycounter}
\definecolor{aquamarine}{rgb}{0.5, 1.0, 0.83}
\newcommand{\my}[1]{\sethlcolor{aquamarine}
\protect\hl{Comment \showmycounter: #1} \sethlcolor{yellow}}
\begin{document}
some text
\my{my first comment}\
some more text
\my{my second comment}
\end{document}
which unfortunately for some strange reason increments the counter in steps of five.
Question
Could you please tell me how to get a unit increment on this counter?
PS: I am a bit of a newbie at latex programming. Let me apologise in advance if this question is dumb.



\stepcounterinside the argument of\hl, so change the definition of\myto\newcommand\my[1]{\stepcounter{mycounter}\sethlcolor{aquamarine}\protect\hl{Comment \themycounter: #1}\sethlcolor{yellow}}Do you intend to use this in a moving argument (so\caption,\section, etc.)? – Skillmon Sep 08 '20 at 13:16\DeclareRobustCommandinstead of\newcommanddefines\myto be\protect\my␣and\my␣is then what you want. – Skillmon Sep 08 '20 at 13:28\DeclareRobustCommanddoesn't check whether the macro is defined or not and silently redefines it in case it is already defined. – Skillmon Sep 08 '20 at 13:31