# How should I represent/display pseudo code in Stack Exchange?

This semester I'm attending a course on Algorithms and Data Structures. I will probably have a few questions to post to Computer Science or Mathematics. The slides of my teacher use math symbols such as $\leq$; $\geq$ and $\neq$.

To keep the right indenting I thought I would be using code blocks, but then the math-symbols would not be correctly formatted.

I only know Python and I'd represent the symbols as <= ; >= and !=. But I am wondering if these are universally understood or should I use code blocks which are interupted by math sections using the symbols (e.g. $\leq$)?

How can I correctly represent my pseudo code on ANY suitable SE site?

• you can also use Unicode symbols in your post, such as ≠ ≡ ≢≣ ≤ ≥ ≦ ≧ ≨ ≩ ≪ ≫≮ ≯ ≰ ≱ Oct 1 at 13:36
• @Marijn that still only works outside of code blocks, right? Oct 1 at 13:38
• No, it works everywhere, you might have noticed that I used code formatting in my comment. For code blocks in a post itself it is advised to switch off the coloring with none because the highlighter may not understand the symbols, but even that is not necessary. Oct 1 at 13:40
• @Marijn wanna turn that into an answer? As this seems to be the only one that might allow me to keep line numbers as shown in my book and slides. Oct 1 at 14:22

Having said that, the symbols <=, >=, and !=` are extremely widespread in the computing industry, and any experienced person working in software engineering or computer science should understand what they mean. If you prefer, you can also use the Unicode symbols that Marijn suggests in the comments. On the other hand, the two-character symbols are much less common in pure and applied mathematics, so on Math.SE and MathOverflow, it's probably better to use MathJax (LaTeX) formatting instead. If you are unsure which style to use, it's probably best to ask at the per-site meta.