Richard A. Macksey, a longtime professor at Johns Hopkins University, in his personal library. (Johns Hopkins University)

Richard A. Macksey, who spent more than 60 years at Johns Hopkins University as a student and then a professor, teaching comparative literature, film and humanities courses, and building a reputation as one of the university’s intellectual giants, died July 22 at an assisted-living center in Towson, Md. He was 87.

The cause was aspiration pneumonia, said his son, Alan Macksey.

Dr. Macksey (pronounced “Maxie”) was a wide-ranging scholar and polymath whose expertise extended from ancient and modern literature — in at least six languages — to medical history, biophysics, critical theory and film. He had joint appointments in Johns Hopkins’s School of Arts and Sciences and the medical school, where he helped design a curriculum that included writing and the humanities.

He developed the university’s first courses on African American literature, women’s studies, scholarly publishing and film studies. In 1966, he organized an academic conference that introduced Jacques Derrida and other French critics to the nation, along with the new academic concept of deconstructionism.

The gathering “changed the intellectual landscape of the nation: It brought avant-garde French theory to America,” literary scholar Cynthia Haven wrote.

The same year, he helped found the Humanities Center (now the Department of Comparative Thought and Literature), for the interdisciplinary study of literature, history, art and philosophy.

His interests seemed to have no limit, yet all were “connected to one another in a network of understanding,” said his next-door neighbor Paul R. McHugh, a former head of the psychiatry department at Johns Hopkins School of Medicine.

Dr. Macksey wrote poetry and fiction, edited scholarly journals and published academic papers on everything from Hungarian revolutionary poems to mathematics to French literature. (His doctoral dissertation on novelist Marcel Proust was written in French.)

He also was a founder of what is now the Maryland Film Festival in Baltimore and volunteered to work in the night shift at a free book exchange. He seemed to subsist on three hours of sleep and pipe tobacco.

As remarkable as Dr. Macksey’s erudition was his personal library, which overflowed a converted garage and filled every room of his house. He owned more than 70,000 books in what was described as the largest private library in Maryland.

“I’m almost certain that that’s true,” Winston Tabb, the dean of libraries, archives and museums at Johns Hopkins, said in an interview. “I’ve been in many, many private libraries, but never one like Professor Macksey’s.” (The library will eventually become part of the university’s collection.)

As a teacher, Dr. Macksey introduced thousands of students to the life of the mind.

“You’re lucky if, in your lifetime, you have one or two teachers who inspire you the way he did,” Caleb Deschanel, a 1966 Hopkins graduate and six-time Oscar-nominated cinematographer, said in an interview. “I think he approached teaching in the way someone creates a work of art. If you think about the way art is created, it comes from some mysterious place. Macksey’s approach to teaching comes from that mysterious place.”

Deschanel was among the students who helped persuade Dr. Macksey to offer the university’s first film courses — and to act in a student-produced movie.

In far-ranging classroom discussions, Dr. Macksey was likely to quote from Greek poetry (in the original Greek, of course) and, on another day, to discuss the animated cartoons of Chuck Jones. He often held classes at his house near the campus, with students sitting at a table surrounded by books.

“You could never mention an author, historian or book that he did not have an expert knowledge of,” one former student, Rob Friedman, said in an interview. “He had such a capacious mind.”

Friedman, who graduated in 1981 and went on to a career in finance, felt out of place at Hopkins until a fellow student guided him to Dr. Macksey. Friedman left a humorous note on his desk, then immediately received a comical response from Dr. Macksey, who became his academic adviser.

“If not for Dick, I probably would not have made it through Hopkins and certainly would not have graduated on time,” Friedman said. “His base of knowledge was staggering and was always presented as great fun, and therefore it was never intimidating. He was one of the least intellectually snobby people I’ve ever known.”

Years later, Friedman and another former student were in Dr. Macksey’s library. Among the Chinese scrolls, nautical instruments and centuries-old books, they knocked a letter to the floor. When they picked it up, they saw that it was written by British novelist D.H. Lawrence, who died in 1930.

Beneath it, they found another letter, from a century earlier, signed by one of the founders of the Romantic school of poetry — “an actual letter from Samuel Taylor Coleridge, just sitting there.”

Richard Alan Macksey was born July 25, 1931, in Montclair, N.J. His father was a businessman, his mother a homemaker. He began to collect books as a child, when he thought he might become a doctor.

“It got adults off your back when you said you were going to study medicine,” he told a Johns Hopkins publication in 1999. “But I didn’t have the temperament of a real clinician.”

He also studied mathematics and physics, later saying his “non-career in the sciences” proved helpful when he decided to concentrate on literature.

“While I lacked the drive and focus that made a great scientist,” he said in 1999, “I had enough interest to learn some habits of inquiry that may have helped me as a teacher.”

Dr. Macksey studied at Princeton University before transferring to Johns Hopkins. He graduated in 1953 and received a master’s degree in creative writing (what the university calls “writing seminars”) in 1954. He received a doctorate in comparative literature from Hopkins in 1957 and joined the faculty a year later. He formally retired in 2010 but continued to teach at least one course a semester until 2018.

His wife of 43 years, the former Catherine Chance, who taught French at Johns Hopkins, died in 2000. Survivors include a son, R. Alan Macksey Jr. of Baltimore County; and a granddaughter.

Johns Hopkins has a lecture named in Dr. Macksey’s honor, as well as an endowed chair in the humanities — “It is a little daunting to join the exalted ranks of Breuer, Eames, Le Corbusier, and Mies, who have chairs named for them,” he once quipped. Another award bearing his name goes to a student in the Phi Beta Kappa honor society who has taken the most challenging and varied coursework.

Former students remarked that Dr. Macksey had the ability to recall almost anything from any page of his 70,000 books. What remains in dispute is the number of languages he could speak or write — it was at least six and possibly as many as 18.

Two years ago, Friedman took him to a lecture on the classics, which an increasingly frail Dr. Macksey sat through with his eyes closed. At the end of the lecture, he promptly raised his hand to ask a question of the lecturer — in Latin.