These are the most popular propositions so far. Note that these are merely guidelines, and not intended as strict policy rules. This is a community wiki; feel free to improve it.
Words and phrases as a topic of dicussion
When a particular word or affix is the topic of discussion it should be written in italics, which is formatted with asterisks. A short phrase should also be presented in italics, with a translation in quotes afterwards:
(Spanish) feliz cumpleaños 'happy birthday'
IPA
IPA transcriptions can be presented inline as in [aɪ.pi.eɪ tɹænˈskɹɪp.ʃəns]. The normal linguistic covention is to use square brackets for phonetic transcriptions (either broad or narrow) and slashes (//) for phonemic transcriptions.
In cases where the phonetic vs. phonemic distinction is irrelevant or tangential to the question at hand, it may be acceptable to use backticks (``) to render the IPA symbols as monospaced text
(often called "code formatting"). For exampleː "should I use the single glyph ʧ
(U+0287) or the sequence tʃ
(U+0074 U+0283)?" Beware however that the monospaced fonts may do a poorer job of handling IPA than the main text font (especially when using diacritics), so it is probably best to use code formatting only when it makes the question or answer substantially clearer or removes ambiguity.
Glosses
Longer or more detailed examples should be presented as three or four line glosses, with the original in the first line, a word by word, or morpheme by morpheme gloss in the second, and a free translation in the third.
Unfortunately there is no good way to present these in the formatting supported by Stack Exchange. For simple examples you can present them using a quote box, with the first line in italics:
Gwenn eo ar c'haz
White is the cat
“The cat is white”
For more complex examples it helps if the words can be aligned. To do this, write the example in monospaced type by indenting each line with four spaces:
Gwenn eo ar c'haz
White is the cat
“The cat is white”
Slashes and dashes may be used for compound words:
Bayerische Seenschifffahrt
Bavarian / lakes-shipping
“Bavarian lakes shipping”
Diagrams and trees
You can use EL&U's tools for diagramming