When I think of Mark Twain, I think of an older gentleman in Hannibal, Mo., wearing a white suit, maybe holding a copy of his classic novel, "The Adventures of Tom Sawyer." Rarely, if ever, have I imagined him as a young, struggling writer — in California! — whose initial attempts at journalism whipped his audience into a fevered pitch of anger or sank like stones.

Ben Tarnoff's meticulously researched and exhilarating "The Bohemians: Mark Twain and the San Francisco Writers Who Reinvented American Literature" has forever changed my image of Twain, his spotless white suit and the role of California and its writers in the post-Civil War surge of American literature.

Twain may be the main draw of Tarnoff's book, but Tarnoff's writing about a few of Twain's contemporaries — Bret Harte, Charles Warren Stoddard, Ina Coolbrith — is just as engaging. In 1863 San Francisco, where "even the shaggiest miner aspired to bardhood, and poets were pop stars," these up-and-coming writers were mining not for gold, but for words.

While these "Bohemians" had one another for support and encouragement, each of them still struggled with his or her demons. As sole provider for her mother and other family members, Coolbrith had to fit her writing time somewhere between a full-time job and the relentless demands of her household. Stoddard's writing success was inconsistent as he fought with society's expectations and came to terms with his own homosexuality. Harte suffered ridicule at the hands of his classmates for his physical appearance, and intolerance by his mother of his literary aspirations. Twain's own mother pleaded with him from the East Coast to get a respectable job.

As much as this is a story of the men and (few) women who made up San Francisco's burgeoning literary community, it is also a thorough treatise on the mid-19th-century newspaper culture on the West Coast and beyond. While there are many ways that Tarnoff could have swerved off topic, he manages to put the world of these writers into historical context without overwhelming the reader with superfluous facts.

These Bohemians shared many difficulties with the writers of today: They fought to publish in a vast sea of voices; they struggled daily with self-doubt, and their supportive community was paramount. There was also the stark fact that some writers, such as Twain, would continue on to lasting fame while others, such as Coolbrith, would drift into obscurity.

Meganne Fabrega is a writer and a member of the National Book Critics Circle.