0

I am trying to figure out how to configure proper indentation when writing an algorithm in LaTex.

The algorithm code should look like:

Let a = 0
let b = 1
if (a > b)
    do action 1
else if (a = b)
    do action 2
else 
    do action 3
all done

I could have more than one level of indentation involved in the algorithms, so it needs to be a flexible solution.

Any suggestions are greatly appreciated.

Werner
  • 603,163
dnraikes
  • 455
  • 1
    You should take a look of one of the dedicated packages, most notably algorithms, algorithm2e and algorithmicx. – Bernard Oct 18 '17 at 23:40
  • Not sure if I understood, but verbatim environment and lstlisting or minted seems related to me (just for manual indenting) – koleygr Oct 19 '17 at 01:20

0 Answers0