IN 1878 THE PRESIDENT of Johns Hopkins University got the notion that "one of the noblest duties of a university" was to spread knowledge "far and wide" beyond the classroom - by going into the book business. The message spread further than he thought. One out of six U.S. books in print today comes from a university press. A startling number come from presses right around here - and they are case histories of survival in a worsening world.

In Baltimore, Johns Hopkins University Press, the pioneer in the trade, starts celebrating its 100th anniversary this February. The American Association of University Press ("our 75 sister scholarly presses," as a John Hopkins man describes them) will convene there in May, and in lieu of a Ceremonial Edition, the press will hold an open house and exhibit some of its prize-winning works of yesterday. It will be a fitting tribute to one of the forces that has helped keep the press in the black. (The press is a division of the university, but it is supposed to support itself - and it does, give or take a couple of narrow squeaks.) The massive Johns Hopkins backlist (84 pages' worth in the centennial catalogue, with 90 new titles a year) accounts for 45 per cent of its sales.

An unwavering sense of continuity may be another source of its strength. The bi-monthly American Journal of Mathematics, first published in 1878, continues uninterrupted to this day (now joined by nine other scholarly journals, quarterlies and bulletins). The Johns Hopkins University Studies in Historical and Political Science is the oldest continuously published book series in the United States.

The personnel has been as durable as the book. The press has had only four directors in a hundred years. Jack Goellner, who took over in 1974, had already worked these for 13 years before he was tapped for the top job.

Has he learned any tricks to survive? "Well, we work very hard at controlling operating expenses and having a good list of books and effective marketing. But we're not miracle workers. The income from our backlist is a major help."

Like other university presses, they have dabbled in "regional publishing" - popular books rather than scholarly monographs. Hence Colonial and Historical Homes of Maryland, with 100 etchings by Don Swann, and Lacrosse: Techniques & Traditions, by Bob Scott.

Two of their authors have won the Nobel Prize (John C. Eccles and Kenneth J. Arrow); their 18-inch model of the human skeleton is in great demand as is The Johns Hopkins Atlas of Human Functional Anatomy. But their all-time best seller has been The Individual, Sex, and Society, a handbook for teachers and counselors.

In Annapolis, the nonprofit, nongovernment U.S. Naval Institute Press occupies its own private enclave on the grounds of the Naval Academy. The Institute's scholarly journal first appeared in 1873 - five years ahead of Johns Hopkins's Journal of Mathematics, but its first book, The Log of the Gloucester (in the war with Spain,) didn't surface until 1899. But it has been publishing 25 to 30 titles a year ever since - on navigation and seamanship, nautical art and lore, science and engineering, maritime water craft, naval biographies, history and current affairs. (And it is greatly helped toward survival by 60,000 $15-a-year dues-paying members all over the world, who get discounts on Institute books and a "special book club type rate" on naval books by other publishers).

The Institute plans to reprint 80,000 copies of Commander Benjamin Dutton's Navigation and Piloting, which first appeared in 1926. (Yachting magazine calls it "The Bible of navigators;" book promotion manager Paul Larsen calls it "our flagship;" and it is a prime source for America's Cup racers.) Also on the way: a 400-page lavishly illustrated history of the U.S. Navy by Nathan Miller, co-published with American Heritage Press, to sell for $34.95.

Closer to home, Catholic University's press has survived by strategic retreat. "We had a large program until about 1971," says Dr. David McGonagle, a classics scholar who now oversees press affairs. Since then, they've been printing 1,000 copies each of four or five scholarly titles a year - philosophical works, a translation of a Cornish miracle play, a biography of a World War I general who specialized in Armenian problems - aimed at a "very restricted market." Books published by Georgetown University issue from the Publications Department of the School of Languages and Linguistics. They have an editorial force of two people and a dog, and cope with shipping and billing with a business staff of two. Their best sellers are language books, and 55 per cent of their orders come from overseas.

Howard University Press has been matching a clearly defined sense of commitment against today's newer and tougher odds. "Howard University Press was created when other presses were failing," Executive Director Charles F. Harris points out. "Our survival has been significant. It hasn't all been peaches and cream. But while others were going down, Howard University Press went up. When the picture was bleak, we were able to start and were able to maintain ourselves with costs 75 per cent higher than we anticipated."

Howard published 16 books in 1974 and 14 a year ever since. Some of the earliest books (From the Dark Tower, a critical evaluation of black writers, by Dr. Arthur P. Davis and A Poetic Equation, by Margaret Walker and Nikki Giovanni) are still selling well. Coming in September: The Changing Mood in America, a study of the decline of affirmative action by Dr. Faustine Jones, funded by Howard's Institute for the Study of Educational Policy. "They're upstairs and we're here," Mr. Harris said. "The uniqueness of Howard gives us our identity. We have to understand who we are. Howard has an intellectual tradition for us to capitalize on."

But the economic equation is more bleak. Without the cushion of a Johns Hopkins-style backlist, "It's difficult to see how scholarly presses that depend on universities for their operating capital can survive. Maybe one way would be through some kind of government grants, or specially created fund. I'll be interested to see what the Carter Administration - and the Endowment for the Humanities - does about these things."