Here, the \tcc{iterate over all training examples} command, produces a large gap between examples and */. Left alignment is fine. But how to reduce the gap and make it compact?

1 Answer 1


Use the command \SetNoFillComment locally inside an algorithm environment or use the global option nofillcomment when loading algorithm2e.

MWE (borrowed from the linked answer):



\SetNoFillComment % <---------------------------
  \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}



enter image description here

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.