The race for the Republican presidential nomination was over seven weeks ago, when Rick Santorum conceded defeat. It’s now even more over: with yesterday’s Texas primary (Tuesday, American time), Mitt Romney officially reached the required number of pledged delegates to guarantee him victory at the Republican convention in August.

If Santorum, or another not-Romney, had performed better in the early stages, Texas might have been an important contest. But long drawn-out nomination fights are the exception rather than the rule, so it’s no surprise that the later primaries have turned out to be an extended victory procession for Romney.

Beating other Republicans was the easy part. The big question is whether Romney can beat incumbent Barack Obama, and that contest has another five months to run. At the moment, however, it’s shaping up to be close.

Look first at the polls — RealClearPolitics aggregates them, with a handy graph. They show that Romney has narrowed Obama’s lead, down to about two percentage points from almost six back in March. While you’d rather be Obama with those numbers — any lead is better than none — it’s much too close for comfort, and Romney can be pretty pleased with the way he’s going.

The betting market doesn’t look quite as tight. Intrade as of this morning gives odds of 56.7% for Obama, to 39.2% for Romney. But that too has narrowed; Romney has been steadily climbing, while Obama has fallen from his highs of above 60%, although his price has recovered after a sharp drop about a week ago.

At this stage, Obama’s team will probably be looking more closely at the economic numbers than either the polls or the odds. This week’s headlines have consumer confidence at an eight-month low, despite recent improvements in employment. The general picture is mediocre; most indicators are positive, but weakly so, and while the recovery is continuing, it’s still much slower than most people expected.

A European implosion in coming weeks could change that, but of course nobody knows how much.

If the economy is bad enough, it tends to overwhelm incumbents regardless of how they try to spin it. But when, like now, things are more mixed, the political effects depend crucially on the narrative that rival politicians can put across. Obama’s strategy rests on two themes: that bad conditions are not his fault — he inherited an economic mess and the Republicans in Congress have blocked his plans to fix things — and that Romney has no credible plan for recovery.

The first leg of the argument has some potential, since although Obama’s approval ratings aren’t very good, Congress’s are much worse. But a lot of weight will have to be borne by the attack on Romney’s policies, record and general credibility.

Specifically, the president wants to drive home the message that Romney’s main priority is tax cuts for the rich, an extremely unpopular policy. The fact that Romney himself would benefit greatly from such policies, and that he seems unable to understand why that makes people uneasy, is a definite plus for the Obama campaign.

And of course, Bill Clinton notwithstanding, it’s not just “the economy, stupid”. Voters care about other things as well; about values, about social policy, about America’s standing in the world and whose finger will be on the nuclear button. By having had to compete with the likes of Santorum and Newt Gingrich, Romney has taken up some positions on these things that are well outside the mainstream, and he may still pay an electoral price for that.

Indeed, Romney is still having trouble distancing himself from the embrace of the Republican Party’s crazies. This week he held a high-profile function with Donald Trump, who among other things is still doggedly maintaining that Obama was born in Kenya. That’s not the way to win over swinging voters.

Two weeks ago, Nate Silver summed up by saying that Romney’s position was slightly on the improve, and that “when an election is quite close, it does not take very much to shift the race from one candidate being a 60/40 favorite to it being about even”. Conversely, a shift the other way could see an apparently close race blow out to a very lopsided result.

Romney is very much in with a chance, but there’s still a big task ahead of him.