1

I want to write pseudocode in TeXShop, with my own commands. The only commands I need to have are save, repeat, return, and if/elif/else. Can someone please help me with that? I was trying to figure it out by using the algorithmicx package to define the new commands, but I kept getting errors. (I don't actually care which package I use as long as it outputs the correct code.)

Here's the pseudocode I want it to display:

save count = 0
save i = 0
repeat len(L)
    if compare(e, L[i]) == 0
        count += i
    i += 1
return count

0 Answers0