William M. Hoffman, a playwright who forced theatergoers to confront the stigma and agony of AIDS with his pathbreaking work “As Is,” died April 29 at a rehabilitation facility in the Bronx. He was 78.

Hoffman, who cultivated gay authors as an editor and anthologist, was also celebrated as the librettist of composer John Corigliano’s opera “The Ghosts of Versailles.” His death was confirmed by his husband, William Russell Taylor II, who said the apparent cause was cardiac arrest.

When “As Is” premiered in New York City in 1985, scientific knowledge of AIDS was in its infancy. Few treatments existed to halt its deadly course. In the cultural realm, there were few literary works to guide patients, their loved ones and the public to understand the epidemic erroneously known at the time as the “gay cancer.”

Hoffman, who memorialized individual AIDS patients by listing their names in playbills, said his purpose in writing “As Is” was to “show that there are people involved in this catastrophe — not numbers.”

“In every death there are people,” he told the New York Times in 1985. “It’s not ‘they.’ It’s ‘we.’”

The play was co-produced by the Glines, a gay theater production company, and the Circle Repertory Company and quickly moved to Broadway under the direction of Marshall W. Mason. It starred Jonathan Hogan as Rich, a novelist newly diagnosed with AIDS, and Jonathan Hadary as his abidingly devoted former lover Saul, who accepts the dying Rich “as is.”

The play was the product of intense study – and intense suffering – by Hoffman. He told the Times he went to “memorial service after memorial service,” often wondering, “Who’s going to be next? Am I?”

To better understand the experience of AIDS patients, he attended support groups where he alone was not suffering from the disease.

“Of one group I attended, everyone is now dead,” Hoffman told The Washington Post in 1987. “At the same time my father and my uncle were dying [not of AIDS] and my cat was dying too. I was surrounded by death and dying – and at the same time by life. … The play was my therapy.”

The play proved therapeutic for viewers, as well.

“With both charity and humor,” wrote Times theater critic Frank Rich, Hoffman “reaches out to examine the impact of AIDS on hetero- and homosexual consciences as well as to ask the larger questions (starting with, ‘Why me?’) that impale any victims of terminal illness.”

“As Is” was nominated for three Tony Awards, including best play. It joined Larry Kramer’s play “A Normal Heart” (which premiered weeks after “As Is”) and Tony Kushner’s two-part, Pulitzer Prize-winning “Angels in America” (first staged in the early 1990s) as classic theatrical works addressing the AIDS crisis.

The taboo surrounding AIDS proved stronger in television than on stage. Several networks rejected a TV adaptation of “As Is” before Showtime produced one in 1986, with Robert Carradine as Rich and Hadary reprising his role as Saul.

“A vociferous minority – large numbers of people, particularly in the hinterlands – not only fear gay people, but hate them,” Hoffman told the Los Angeles Times in 1990. “The film community correctly perceives that this poses problems in terms of marketing and box office.”

He spoke ruefully of gay actors and writers in Hollywood who shied away from homosexuality in their work, comparing them to Jews during World War II who felt compelled by anti-Semitism to avoid references to the Holocaust. Most of his extended family had died in the Nazi slaughter.

William Moses Hoffman, a son of Jewish immigrants from Eastern Europe, was born in New York City on April 12, 1939. His father was a caterer, and his mother sold jewelry and told fortunes, said his husband.

The experience of anti-Semitism informed Hoffman’s play “Riga” (1999), about an interracial gay couple that contends with the dual struggles of racism and homophobia.

Hoffman studied English and Latin at the City College of New York, where he received a bachelor’s degree in 1960.

He launched his career as an editor at the publishing house Hill & Wang, where his projects included “Gay Plays: The First Collection” (1979). Rich, his protagonist in “As Is,” remarks that he so yearned for stories of people like him that he “would look for them in the indexes of books, under H.”

Over the years, Hoffman was a professor and a television writer, with credits including the soap opera “One Life to Live.”

After “As Is,” he received his greatest critical acclaim for “The Ghosts of Versailles,” an opera buffa commissioned by the Metropolitan Opera which premiered in 1991 with a star-studded cast including Teresa Stratas, Marilyn Horne and Renée Fleming under the baton of James Levine.

Hoffman said he did not see the libretto – about the ghosts of courtiers to King Louis XVI – as “a vehicle for musical ideas” but rather as an “opera that would stand on its own dramatically.”

“To me, the opera is primarily a love story, but it is also about the French Revolution, the nature of revolution in general, the nature of love and the nature of time,” Hoffman told the New York Times.

Hoffman and Taylor were married in 2012. Besides his husband, of Beacon, New York, survivors include a brother.

Hoffman said he wished “As Is” would be rendered obsolete by the defeat of AIDS and the conquering of homophobia. Until such time, he offered the play in the service of greater understanding.

When theater patrons “come to a show like ‘As Is’ and see gay people portrayed like them, they see that AIDS is like the cancer their mama had or the heart failure their son had,” Hoffman told the Times in 1987. “At one performance on Broadway, an obviously straight guy was crying in the lobby afterwards, and I heard him say over and over again, ‘I didn’t know. I didn’t know.’ In a way, that’s my deepest wish – to make AIDS more ordinary, to make people understand that it’s not a moral affliction, it’s another disease.”