I wanted to know how to change the comment style in the algorithm2e package. I want to make my comments of a smaller font and a different color:
\documentclass{article}
\usepackage{color}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\begin{document}
\begin{algorithm}[H]
\DontPrintSemicolon
\CommentSty{\color{blue}}
\KwData{Training set $x$}
$\Delta_{ji}^l := 0$ \tcp*{will be used to compute $\partial x$}
\tcc{iterate over all training examples}
\caption{Example code}
\end{algorithm}
\end{document}


\tcpit adds a new line after the code comment, so my code skips a line. Why is this? I am usingalgorithm2eand the line looks like:set $cost\_vector \; \vv{c_{p,v}} = \left\lbrace \right\rbrace$\tcp*{will be used to compute $\partial x$}\;– Dhruv Ghulati Sep 09 '16 at 16:20*/? – Dr.PB Jul 01 '17 at 10:16*/) – user202729 Jun 14 '22 at 11:33