President Carter formally announced, yesterday that he will veto the public works appropriations bill as the White House mounted an all-out campaign to mobilize public opinion against a congressional override-and at the same time to portray the president as the nation's leading inflation fighter.

The $10 billion spending bill would provide funds for energy research and development and for Army Corps of Engineers and Bureau of Reclamation dams and other construction projects - including, to Carter's chagrin, 27 new water projects he opposes and six projects he thought were killed last year that have been resurrected on Capitol Hill.

The president has described the bill as a classic example of "pork-barrel" legislation. Yesterday, he denounced it again as "inflationary and wasteful" and "absolutely unacceptable."

His comments were accompanied by an intense White House effort to assure that the president is viewed as leading the fight against inflation even if it means - as it does in the case of the public works bill - that he is pitted against the leadership of his own party in Congress.

That effort also included a flood of paper from the White House press office describing the water projects Carter opposes as generally beneficial to only a handful of landowners, as well as environmentally destructive and economically wasteful because costs would far outweigh benefits.

The split in Democratic ranks over the issue was illustrated last night as Senate Majority Leader Robert C. Byrd (D.W.Va.) took to the Senate floor to criticize the president for making "the wrong decision" and to say he hopes the Senate overrides the veto "a good bill."

Byrd said the Senate is as interested as Carter in halting government waste, but added that "it is counter-productive and self-defeating to shelve legislation that relieves the potential for disaster, creates jobs and results in lasting capital improvements to many communicities."

The day's activities began with an unusual and apparently hastily called afternoon Cabinet meeting at which Carter discussed the inflationary impact of a number of bills moving toward enactment in the final days of the congressional session.

The president followed that up by calling key House Republicans to the White House to ask their support in sustaining the veto. While House officials described the meeting as "good," but said there were no commitments made by the Republicans for the up-coming override vote on the House side, which both sides agree will be close. (Administration head-counters say the Senate is almost sure to vote to override, so that the president must rely on the House to be sustained.)

Finally, Carter summoned reporters to the Oval Office, where he announced his intention to veto the measure to a battery of television cameras.

He said no problems are more serious that "inflation and the high tax burden and waste in government" and that those concerns "press very heavily on me as president." That is why, he said, he intends to veto the public works bill.

The president added:

"It's important that I and the Congress set an example for the rest of the nation in controlling inflation, and this public works bill is exactly the wrong example . . . It's inflationary, it's wasteful and it pend the taxSH its wasteful and it spends the taxpayers' money in a very inefficient and inappropriate way. . .I, along with the people of our country, are tried of seeing the taxpayers' money wasted, and I am determined to see the fight against inflation succeed."

Asked if he thinks he can win an override fight, he said, "I am determined to win it, yes."

In the midst of this, Carter did everything except actually veto the bill. That could occur as early as today, with the House override attempt shortly thereafter. It takes a two-thirds vote of both houses to override.

The White House turned the president's announcement of his "intention" to veto the bill into a major production because the override test is viewed as a symbolically and substantively important political battle for Carter.

Symbolically, the public works bill - and especially the dispute over the water projects-is a reminder of the early frustrations of Carter and his aides. Last year, the president threatened to veto a similar measure, then backed off and compromised with Congress. Several weeks ago, he ruefully remarked at a news conference that he wished he had vetoed that measure.

But of more important is the opportunity a veto presents for the president to wage a highly visible campaign against inflation, which is viewed in the White House as a political plus whatever the outcome.

Meanwhile, Rep. David A. Stockman (Mich.), one of the republicans who met with Carter yesterday, said the group agreed to help the president.

House Rep ublicans are scheduled to hold a meeting on the veto vote today, and sources predicted it will be "stormy" since Minority Leader John J. Rhodes (Ariz.), who comes from a state where water projects are considered vital is strongly in favor of overriding the veto. Other Republicans are reluctant to contribute to another presidential victory that might further strengthen Carter's post-Camp David image. However, there are also Republicans arguing that a vote for a public works bill containing "pork-barrel" projects would be inconsistent with GOP demands for fiscal responsiblility and cutbacks in federal spending to curb inflation.

One House member reported yesterday that members of the public works subcommittee are "playing hardball" in their effort to gain override votes.

He noted that funding for the Department of Enerty is in the bill and said members who didn't have water projects in their districts, but who were looking for a project such as a solar research lab under the energy section, were being told those projects would be "far closer than it should be" because including the energy funds in the bill "gives them 10 times more chips than they would normally have."