As the sun set over Petroleos Mexicanos' huge downtown office complex one evening last week, Cesar Baptista, deputy director for industrial production and a 36-year employe of the state-owned oil monopoly, lit his pipe and patiently explained Mexico's oil policy to an American reporter.

Outside his door, an American network television crew adjusted its lights and waited for Baptista to emerge and tell the whole story again on camera.

Meanwhile, seven floors above, Jorge Diaz Serrano, executive director of Pemex, was engaged in a similar exercise with another major U.S. newspaper.

Just two years ago, Baptista noted, nobody came to see them.The overnight celebrity is of course due to the confirmation of massive oil and gas deposits in southern Mexico.

On Wednesday, President Carter will arrive here prepared to negotiate a "framework" for the U.S. purchase of Mexican natural gas, and the interviews all revolve around the question of whether Pemex will sell.

The official answer is no.

"Right now," Baptista said, "we have no gas to sell." Following a 1977 U.S. Department of Energy veto of a private industry offer to buy Mexican gas, Mexico has decided to use the gas itself, he said.

But then again, Baptista suggested, the answer could be yes.

"It depends on a lot of things," he said, including such wide-ranging items as price, politics and U.S. imports of Mexican tomatoes.

Selling Mexican gas to the United States is clearly in the best interest of both countries, and it is likely that a deal eventually will be struck. But once-bitten and proud Mexico can be expected to drive a hard bargain.

Two years ago, Pemex agreed to sell six American companies, led by Tenneco Inc., gas that would amount to about 4 percent of U.S. consumption. The gas was price-indexed by mutual agreement to the cost of heating oil -- at that time the equivalent of about $2.60 per thousand cubic feet of gas.

U.S. Energy Secretary James Schlesinger, who at the time was trying to sell the administration's energy package, called on Pemex to lower its price to the equivalent price of residual fuel oil, then about $2.35. The Mexicans angrily walked out of the talks.

The embarrassment of the price battle was doubled for Mexican President Jose Lopez Portillo, who had gone out on a limb by offering the gas in the first place. Since expropriating oil companies in 1938, Mexicans have taken a nationalistic approach to their energy resources. They are also particularly sensitive about getting taken by the United States, which they believe usually happens in Mexican-U.S. relations.

Despite Schlesinger's continuing calls for developing domestic gas instead of importing more, there is heavy congressional and public pressure on Carter to obtain a gas deal with Mexico.

Part of the rationale for such pressure is that if Mexico is willing to sell natural gas to the United States, it will be happy to sell large amounts of oil in the future.

The irony of the tale is not lost on the Pemex directors. They insist they harbor no ill will toward Schlesinger, whom Diaz Serrano described at the time on the original gas deal fiasco as "incredibly arrogant."

When gently provoked, however, Baptista showed a glimmer of emotion. Mexico, he said, has not even thought about producing more gas to sell to the United States.

"How can we put all our mechanisms to work on hypothetical problems when every week your secretary of energy says, 'we don't want your gas, we have no use for your gas, we don't want to pay for your gas' " he asked.

"We are in business to produce and to sell hydrocarbons," Baptista said. "we've been in that business for 40 years. We are very serious people. Our government, and our president, are serious people.

Mexico currently produces approximately 1.5 million barrels of petroleum a day, 71 percent more than it was pumping two years ago. Despite U.S. intelligence assertions that much of the gas produced along with the oil is being burned as waste, Pemex says it is using almost all of the gas.

By 1980, when a two-year oil production level of 2.25 million barrels daily is scheduled to be reached, Baptista said, only three percent of the resultant gas -- a minimal amount -- will be flared off.

The rest, he said, will be piped through a nationwide system to supply Mexican industry. The newest pipeline, nearly 1,000 miles from north to south and costing $800 million, is due to open March 18.

U.S. officials here dispute not only the flaring figures -- they say Mexico is burning much more than it says -- but also insist that Mexican industry will be unable to use all the gas produced by its oil production increase.

Disputed figures aside, Mexico, in addition to its huge gas-producing oil fields, has a number of separate gas fields it is not now tapping. A decision to develop them, and supply gas to the United States, Baptista said, would be both politically and economically based.

Politically, Mexico wants to use its energy wealth to negotiate trade and immigration concessions from the United States.

"We think that the United States should be interested in a Mexico that is growing and getting stronger," Baptista said. "We think we should improve all our relations including, let's say, things like energy and things like tomatoes."

Mexico long has accused the United States of arbitrarily setting and changing import regulations to protect U.S. producers of winter vegetables at the expense of Mexican growers.

Both trade and immigration deals allowing the continued smooth flow of illegal Mexican aliens into the United States will be touchy issues for Carter. The U.S. constituency that favors Mexican gas and oil deals does not necessarily favor more Mexicans and Mexican goods.

As for price, U.S. officials here now say that $2.60 per thousand cubic feet of gas is no problem. They say, however, that they would like to see price escalations pegged to something unrelated to energy costs.

Pemex still publicly insists that a fair peg is the price of heating oil -- which has brought the gas price up to more than $3.00

Still, should the United States offer something less, with attractive sweeteners, Baptista said, "We don't know exactly what our position would be.

"All agreements have room for fundamental adjustment."