Robert H. Williams, 64, a reporter and editor with The Washington Post for 30 years, died June 10 at Suburban Hospital after an apparent heart attack. He had undergone cataract surgery on Monday.

Earlier this year, Mr. Williams became a staff writer in news obituaries. Before that, he held a wide variety of jobs at the newspaper, including years as an assistant national editor, and assignments with the Style section and News Desk. Over the years, he was a columnist, edited copy and was a layout editor and comics editor. He became "Captain Index" after putting together the newspaper's index for more than a decade.

In addition to his other duties, he edited "The Right Word," an in-house report that examined the writing and editing of the paper. In the mid-1970s, he wrote the Saturday "Postscript" column, a humorous look at news events that ran in the paper's front section.

As for his many jobs, he once declared that his proudest moment, in the job title sense, came when his name appeared in Editor and Publisher magazine as The Post's "Home Furnishings Editor."

If his official title usually involved the word "editor," he will be remembered by many as a supremely gifted writer of off-beat feature pieces. Among them were strange tips on cooking, the occasional book review and his own brand of essay.

These were usually hilarious, sometimes heart-breaking works that often were about his own hard-lived and wide-ranging life or of events he had witnessed. His fellow writers at the paper thought they were first rate.

Mr. Williams wrote about his childhood memories in Illinois of World War II, hunting and dysfunctional relatives. He recounted poignant memories of the beautiful girl in high school who had turned him down. He wrote a moving piece about being part of a group caring for a man dying of AIDS.

Post Executive Editor Leonard Downie Jr., announcing Mr. Williams's death to the staff yesterday, cited Mr. Williams's "dedicated craftsmanship" as well as "his sharp wit and his devotion to this newspaper."

Gene Weingarten, a Style reporter and former editor who edited many of Mr. Williams's pieces, said he "had the rarest combination for a writer: vulnerability and arrogance. He was a shy man, but there was nothing shy about his writing. His writing was bold.

"It teetered precariously on the edge of a precipice: genius above, madness below. He would taunt you with an occasional apparent misstep, only to smile and recover his balance, and leave you breathless."

Among the passages Weingarten recalled was one in which Mr. Williams described an eccentric demagogue with great public appeal:

"As I interviewed him before the campaign, he sucked on a peach, and after he'd inhaled the flesh from it, he spat its pit into an empty steel wastebasket with a clang I can hear today, if I listen carefully during the pre-dawn hours."

Perhaps his role as editor and writer best came together back in 1978 when Mr. Williams, then a National Desk copy editor, was asked to do a piece for The Post's op-ed page describing exactly what a copy editor was.

He wrote: "Just what a copy editor does seems to puzzle many reporters and, from time to time, the very management of a newspaper. But while the duties of the copy editor may be hard to define, it has been found that newspapers do not function very well, if at all, without them.

"A friend, visiting Washington several years ago, asked me what it is, exactly, I do for a living, and when I told him my duty was to change `that' to `which' and `which' to `that' wherever those words appear, he looked at me as if I were quite mad, which may be the case after 20 years of trying to get printers to put in the fourth dot when an ellipsis ends a sentence."

Mr. Williams went on to explain that, no matter how careful an editor is, mistakes will happen. Even copy editors, it is believed by many, are human beings, he noted. This leads not only to endless cases of shot nerves and high blood pressure but to less than pleasant encounters with higher-ups, he said.

"One of the senior editors of this newspaper once asked me, in not so gentle terms, why in God's name I'd written a headline calling the governor of Michigan the governor of Ohio, and my response was, `Harry, I'd be telling you a lie if I said I did it on purpose.' "

In addition to his writing and editing, he held a variety of unofficial newsroom jobs. The management often called on him to give tours and to explain the workings of the paper to visitors.

He also organized and supervised the newsroom's annual Christmas and New Year dinners. These started when The Post cafeteria cut back its hours on holidays and it became obvious that there were few places near the newsroom to eat on the holidays. Mr. Williams organized a pot luck affair for workers stuck in the newsroom, and it grew each year as more people took part in the activity and dishes became ever more lavish.

A measure of the events' success was that some staffers attended even though they were not scheduled to work. On the other hand, because of his organizing obligations, Mr. Williams was forced to come to work and run the dinner even though he had finally gotten a holiday off.

Many of his co-workers felt that he organized the holiday buffet to publicize his own great culinary triumph, the baked ham, which he did in his own, colorful "Midwest" style. His recipe, amazingly enough, called for a 20- to 25-pound ham, two cups of apple juice, a half box of dark brown sugar, a half cup of dark corn syrup, a tablespoon of dry mustard, a can of cherry pie filling, a heaping teaspoon of freeze-dried instant coffee, a tablespoon of vinegar, two teaspoons of ground cloves, a handful of raisins, and a small can of four pineapple slices and their juice."

He had also played on the newsroom softball team for years. He loved to play third base, despite the fact that he often ended the game with numerous shin bruises. His greatest moment on the diamond came when he made a game-winning hit in an extra-inning game against the New York Times.

Mr. Williams had long been active in Alcoholics Anonymous, and wrote in The Washington Post about the organization and his membership. He did volunteer work for AA and other organizations and had been a leader of AA groups across the Washington area. He also counseled others at The Post and at suburban Maryland hospitals.

Robert Hunter Williams was born in East St. Louis, Ill., and served with the Army for two years in Texas. He graduated, with distinction, from the University of Missouri with a degree in English.

He began his career in journalism in 1958 as a reporter with the East St. Louis Journal, then worked in public relations from 1959 to 1962. After eight months as night city editor of the Arizona Journal, he joined the Miami Herald, where he was an assistant city editor from 1962 to 1966. He then spent three years at the Suffolk Sun on Long Island, N.Y., where he was columnist and editor.

He was the author of a book about police corruption and had contributed articles to magazines that included New Republic and Esquire.

Survivors include his wife of 43 years, Shirley D., of Silver Spring; a son, Geoffrey H., of Los Angeles; and two daughters, Kelly S. Williams of Moore, Okla., and Joelle L. Williams of Silver Spring.

CAPTION: Robert H. Williams wrote a piece for The Post's op-ed page describing the duties of a copy editor.