Every time he wrote, John ­McNamara sought the gem for his story that would grab readers’ attention, leaving them smiling — or perhaps, shedding a tear.

Whether covering a Maryland Terrapins game or a local government meeting, McNamara dug deep.

“He had personality, he had work ethic, family values and a burning desire to be the very best writer he could possibly be — and he was,” said Johnny Holliday, a play-by-play sportscaster for the Maryland Terrapins who knew McNamara for 30 years.

“Everybody loved, everybody respected John McNamara,” he told the family members, friends and co-workers gathered Tuesday for a memorial service for the man many knew as “Johnny Mac.”

McNamara, 56, was killed with four others in a shooting rampage at the Capital Gazette newsroom June 28 near Annapolis when police say a gunman with long-held hostility toward the paper opened fire as they worked at their desks.

McNamara personified what a reporter should be, missing only the cigarette and a fedora to complete the image, said Bowie Mayor G. Frederick Robinson, whose city McNamara covered in his most recent job as editor and reporter for the Bowie Blade News and Crofton-West County Gazette.

“If you look up reporter in the dictionary, you would see his picture there,” Robinson said.

And to the reporters he worked alongside, he was always ready to help guide the youngest and bolster the veterans.

Considerate and conscientious, he would never leave the office before his peers without first asking “is there something I can help with?” said Gerry Jackson, now a sports editor at The Baltimore Sun who had sat next to McNamara at the Capital Gazette for more than 20 years.

McNamara’s service in Memorial Chapel at the University of Maryland at College Park was the last of the memorials for those who died and was held on the campus McNamara knew well.

The attack also took the lives of Rob Hiaasen, Wendi Winters, Gerald Fischman and Rebecca Smith. Memorials for Hiaasen, a columnist, and Winters, a features writer, were held last week. Services for Smith, a sales assistant, and Fischman, an editorial page editor, took place Sunday.

Jarrod W. Ramos, a 38-year-old from Laurel who had waged a losing legal battle with the newsroom for years, is charged with five counts of murder.

On Tuesday, friends and colleagues recalled McNamara’s encyclopedic and “uncanny” knowledge of sports, foremost the Maryland Terrapins teams, which he could discuss for hours on end. McNamara wrote two books about Maryland athletics: the “University of Maryland Football Vault,” and “Cole Classics!,” which he co-authored with sportswriter David Elfin.

He attended the University of Maryland as an undergraduate and was a beat reporter for Maryland athletics at The Diamondback, the university’s student newspaper.

McNamara grew up in Bethesda, one of seven children in a large, Catholic family and lived recently in Silver Spring with his wife, Andrea Chamblee.

His dedication to the Terps was surpassed only by his love for his wife and his siblings.

“He was so devoted to them,” Jackson said. “I know how much John was devoted to his family, and how much he cherished them.”

Jackson called McNamara one of the best co-workers and friends he could’ve asked for and said it was evident how many lives McNamara touched by the several hundred people in the audience.

“Those of us in the journalism business know the last couple years have been tough,” Jackson said, citing difficult assignments, longer hours and fewer raises. “But John took it all with his chin up and continued to do what was right for him and his family and his profession.”

That professional, even after moving from a years-long career in sports to an editing role that included covering local communities, remained tenacious and fair, said Robinson, the Bowie mayor.

He was a “throwback,” Robinson said, who would wait patiently in city hall after covering a contentious council meeting, pull out his notepad and ask Robinson, “Can you tell me what you think just happened?”

“There was neither prejudice nor preference in stories about our community,” Robinson said. “His words were founded in facts and presented in a clear, honest way.”