Wikipedia's Manual of Style has specific rules about using titles of people. Generally, titles and
positions such as "president" or "king" are common nouns and should appear in lowercase. However, this is not the case when a title appears in conjunction with the title holder's name, such as "President Obama". [This was written in December, and we're keeping it. —Ed.] Titles are also capitalized when used to refer to a "specific and obvious" individual as a substitution, such as saying "the Queen" instead of Elizabeth II.
Finally, formal titles are capitalized when treated like a proper name, such as "King of France". Using the example provided by the manual of style, this means Louis XVI was "King of France", and the "French king". This also includes honorifics and styles of nobility, such as "Her Majesty" or "His Holiness".