HAVANA -- A professor at the University of Havana was saying the other day that beards are back in vogue in Cuba. But the explanation owes nothing to nostalgia for the revolutionary image of Fidel Castro and his stubble-chinned band of barbudos.

"Check the markets," the bewhiskered professor shrugged. "See if you can find any shaving cream."

A housewife in Havana's Playa neighborhood leaned forward conspiratorially, as if to whisper a favorite recipe. "Shampoo is very difficult to find," she said. "Lots of people mix their own: Water. Raw sugar. Detergent. It leaves a strange smell, but it works."

And a dentist recounted buying a pair of shoes on the two shopping days for such items she is allowed each month under Cuba's elaborate rationing system.

"The first day, I looked everywhere. I stood in lines for hours and finally came home empty-handed. I was exhausted," she said. "The second day I finally found a pair after hours and hours. They fit, but I don't even like them."

At bakeries and grocery stores, at pharmacies and pizza parlors, the lines grow longer and the shortages more severe. Virtually everybody in Havana, a lovely, crumbling city of 2 million people, is feeling the pinch of what may be revolutionary Cuba's most severe economic crisis.

Canned foods, automotive parts and machinery from Eastern Europe already had grown scarce as former East Bloc allies turned their backs on socialism and on Cuba.

Now, the shortages are closer to home. Cuban rum and beer have been added to the rationing card. Pork, as integral a part of Cubans' Christmas as is turkey to Americans' Thanksgiving, was hard to find in Havana during the holidays after Castro declared an "amnesty" for pigs.

Bananas, while not officially rationed, are often scarce in the capital. Eggs, a protein staple, had been difficult to find but still available. Then, with two days' warning, the government announced a limit of four eggs per person, per week, beginning Jan. 21.

Other monthly allotments are enough to keep food on the table, but barely. Residents of Havana receive five pounds of rice a month, 10 ounces of red beans, 20 ounces of lentils, a half-pound of cooking oil (when available), four pounds of sugar and three small cans of condensed milk.

Three 12-ounce portions of chicken are included in the rationing each month. One 12-ounce serving of beef per month is generally, but not always, offered.

Butter and yellow cheese disappeared from Havana markets more than a year ago. Other items that are still listed in people's ration booklets, such as yogurt and vegetables, are sometimes available, sometimes not.

Buying shoes, clothing and toiletries is at least as difficult, with complex rules spelling out the days when shopping is permitted, and limiting the purchases of items found.

The shortages are partly a byproduct of Cuba's radical austerity program, officially known as the "special period in peacetime." One feature -- slashing fuel consumption to make up for cuts in Soviet oil deliveries since 1989 -- has played havoc with Cuba's distribution systems. The result is the paltry selection on the shelves of Havana's markets of some items, such as bananas, that are in abundance outside the capital.

Castro has vowed not to deviate from Cuba's centrally planned socialist economy. Instead, he has warned of continuing hardships while the island increases food production, especially of pork and fish. Planners say the goal is to reach food self-sufficiency by 1994. That was one of Castro's original goals.

"Everyone thinks he's crazy {not to move to a market-oriented economy}, but he's not so crazy," said a European diplomat. "There are two main ways of dealing with the {economic} problem: going into debt or cutting consumption. Since the first isn't an option" given Cuba's already huge debt problems, "he's chosen the second."

{Nevertheless, the Cuban Chamber of Commerce announced Feb. 2 that to attract foreign investment, Cuba will offer incentives for creation of joint ventures, including tariff exemptions and unrestricted repatriation of profits. Until now, a modest amount of foreign investment has occurred in tourist enterprises, but the authorities said it now would be welcome in all fields.}

Cuban officials play down the long lines and grumbling, attributing the problem to a largely unjustified "psychology of consumer anxiety," in the words of Eugenio Balari, president of the Cuban Institute for Research and Orientation of Internal Demand.

There is a "phenomenon of diminished expectations creating a kind of panic in the markets," said Balari, who maintained that the supply of food staples was undiminished. "I really don't think the people have felt anything yet. . . . They're well prepared for a much worse situation."

"Lines are not necessarily negative," said Carlos Aldana, the Communist Party's ideology chief. "The positive aspect of lines is that there are products and people get in lines to buy them."

Food shortages in some Eastern European countries, particularly Poland, provided the sparks for democratic reform. But there is no sign of imminent revolt in Cuba.

No one in Cuba is starving or homeless, and free health care and education take the edge off the scarcity of some foods and consumer items. Most of the Caribbean island's 10.5 million people live in agricultural-based rural areas, where food is grown or raised and the growing season lasts year-round.

The private ownership of pigs, which has been allowed throughout the island since October, makes pork much more widely available outside the capital. And many Havanans rely on country cousins as a source for extra food.

"They're in serious economic trouble, but it's easy to exaggerate," said an envoy. "Their needs aren't that great. You'll never get a harsh winter here so the shortages don't pinch that much."

The shortages do produce jokes, told with a snicker -- as well as a glance to see who might be listening. At the University of Havana, some students and professors refer to the courses on Marxism as science fiction. Others point out that Castro's tough-it-out slogan, "Socialism or Death," is a redundancy.

A few jokes are aimed at the still-revered image of Castro:

Fidel, worried about his popularity and declining consumer confidence, asks a witch doctor to summon his mother from the dead to consult on the future. Castro asks, "Mother, will the people be with me in 1991?"

"Yes, son, they will," she replies.

"Phew," says Castro. "And in 1992, will the people be with me then?"

"No, son, they'll be with me."