• Last edited on Nov 13, 2014, 10:46:01 AM by 3005188 Ffisegydd

Markdown is used in Stack Overflow for formatting text in both Q+As and chat. This page is a set of examples showing how markdown can be used to produce various effects. The examples are aimed more at chat than the main site, but should be applicable to both.

Text formatting

Text can be formatted in a variety of ways, some basic formatting includes:

  • Bold text**Bold text** or __Bold text__ (N.B.: double underscore)
  • Italic text*Italic text* or _Italic text_ (N.B.: single underscore)
  • Bold italic text***Bold italic text*** or ___Bold italic text___ (N.B.: triple underscore)
  • Strikethrough---Strikethrough---

Code formatting

When presenting code it is typical to use a monospaced font, this makes it easier to read and distinguises from normal text.

Code can be formatted in-line by using backticks:

  • I love the python print function print() – I love the python print function `print()`

If your code spans more than one line, you can place it inside a code block by indenting by 4 spaces. Alternatively, you can select your text and press Ctrl+K to automatically convert the code.

N.B.: In SO chat you cannot have both a text block and a code block in the same “message”, it will fail and everything will appear as text.


Links can be provided inline easily with the following format

  • Chat![Chat!](http://chat.stackoverflow.com/rooms/6/python)