I have to include algorithms in a paper and they must appear as follows:
[A] X ← X-1
Y ← Y+1
IF X ≠ 0 GOTO A
so I am trying to replicate this exactly, exploring some new packages as well but unfortunately it seems I can't get the hang of it. I'm finding particularly difficult including the [A]
label before the statement and then the space on the next line. Is there any formatting tip I can follow or any package I can include?
Edit: For the assignment part I would love to use the math mode, mostly because there are lots of math signs I have to include, as for the appearence it should really be rendered as shown above: the label on the left, if present and if not there should be a nice space and all the statements must be stacked and aligned.
alltt
package and environment?tabular
?tabbing
environment?tabular
there should be a line between the label and the statement, shouldn't it? I definitely don't want that.\begin{tabular}{@{}ll@{}}
will give you the alignment you need. Alsotabbing
could be a possibility, as @guillem says. Can you add some more details? Should it use math mode for the "assignment parts"? What about the label? Should the whole thing be centered or flush left?