There are many rules governing the writing of compounds, and many
exceptions to the rules. I would say that you should always first
consult a good dictionary to see if the compound has an established
form. From
Webster's Third New International Dictionary, here are
some of the rules governing prefixes:
1.
Prefixes in borrowed compounds. A hyphen is often used between duplicated vowels:
co-operate, but usually the form is solid:
cooperate. If the letters (vowels or consonants) are different, the word is usually solid:
coalesce, coerce, collect, diagram, anarchy.
2.
Prefixes in compounds formed within English. Open styling is usually
not used. "Some combinations are usually close-styled (
in- and
un-, as in
inexpressible, untenable), some are usually hyphened (
ex- in
ex-president), some are frequently styled either way (
anti-, co-, extra, non-, pre-, semi-)." Hyphens are used to avoid vowel duplications:
anti-intellectualism. Hyphens are less common if the vowels are different:
deadjectival, foreoath. Solid styling is usual for junctures with consonants:
nonmetallic, nonalcoholic, extralegal.
3. "When the base word begins with a capital, a hyphen is usual:
un-American."
4. Some "prefixes" function as adjectives when they are open before a noun:
a pseudo liberal, quasi independence.
5. Sometimes, the hyphened word has a different etymology, pronunciation, and meaning:
r
ecover: to get back
re-cover: to cover again.
recreation: play.
re-creation: a creating again.