The literary concept of heteronym, invented by Portuguese writer and poet Fernando Pessoa, refers to one or more imaginary character(s) created by a writer to write in different styles. Heteronyms differ from pen names (or pseudonyms, from the Greek "False Name") in that the latter are just false names, while the former are characters having their own supposed physiques, biographies and writing styles.
In Pessoa's case, there are at least 70 heteronyms (according to the latest count by Pessoa's editor Teresa Rita Lopes); some of them are relatives or know each other; they criticise and translate each other's works. Pessoa's three chief heteronyms are Alberto Caeiro, Ricardo Reis and Álvaro de Campos; the latter two consider the former their master. There are also two whom Pessoa called semi-heteronyms, Bernardo Soares and the Baron of Teive, who are semi-autobiographical characters who write in prose, "a mere mutilation" of the Pessoa personality. There is, lastly, an orthonym, Fernando Pessoa, the namesake of the author, who also considers Caeiro his master.
The heteronyms dialogue with each other and even with Pessoa in what he calls "the theatre of being" or "drama in people". They sometimes intervened in Pessoa's social life: during Pessoa's only attested romance, a jealous Campos wrote letters to the girl, who enjoyed the game and wrote back.
Pessoa, also an amateur astrologer, created in 1915 the heteronym Raphael Baldaya, a long bearded astrologer. He elaborated horoscopes of his main heteronyms in order to determine their personalities.
Fernando Pessoa on the heteronyms
How do I write in the name of these three? Caeiro, through sheer and unexpected inspiration, without knowing or even suspecting that I’m going to write in his name. Ricardo Reis, after an abstract meditation, which suddenly takes concrete shape in an ode. Campos, when I feel a sudden impulse to write and don’t know what. (My semi-heteronym Bernardo Soares, who in many ways resembles Álvaro de Campos, always appears when I'm sleepy or drowsy, so that my qualities of inhibition and rational thought are suspended; his prose is an endless reverie. He’s a semi-heteronym because his personality, although not my own, doesn’t differ from my own but is a mere mutilation of it. He’s me without my rationalism and emotions. His prose is the same as mine, except for certain formal restraint that reason imposes on my own writing, and his Portuguese is exactly the same – whereas Caeiro writes bad Portuguese, Campos writes it reasonably well but with mistakes such as "me myself" instead of "I myself", etc.., and Reis writes better than I, but with a purism I find excessive...)