# Pseudo-code support?

Do we have something for more convenient pseudocode typing? The current setup is not very user-friendly:

• Manual indentation (with \quad's or whatever)
• No standard constructs like "for", "if", "while", etc.
• No visual help, like line numbering and vertical lines for scope (like vlined option from algorithm2e)

Even typing a small piece of code is pretty annoying, and I would need to brace myself for a large piece of code. Do we have a better alternative? I want to be able to do something like

$$\begin{algorithm}[] s \gets 0 \For{i = 1..n} { a_i \gets i^2 \\ s \gets s + a_i } \end{algorithm}$$


At the very least, do we have some pseudo-code tutorial? If we do, it should be easy to find for an asker (since I don't know one and even searching in the help center doesn't work, it's not easy to find). When someone uses a code block, we should also show a message like "consider using a pseudocode [link]".

• I support adding such a mechanism. Current code environments cannot handle MathJax. – Yuval Filmus Apr 10 at 21:55