Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When using comments in the algorithmicx package like in the code below, the comment is aligned at the right. How do I change that? I'd like the comment to appear next to the code, separated by a tab.

\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{algorithm}
\begin{algorithmic}
\State $var$ \Comment{comment about var}
\end{algorithmic}
\end{algorithm}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can re-define how the comment is formatted, perhaps something like this:

\renewcommand{\algorithmiccomment}[1]{\hskip2em$\triangleright$ #1}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.