Outgoing Mayor Rahm Emanuel already is making plans for after he leaves City Hall, including a deal to write a book about his theories on the increasing importance of cities in a country and world where federal government paralysis has forced municipalities to rely more on themselves.

Alfred A. Knopf will publish “The Nation City: Why Mayors Run the World” in spring 2020, according to Emanuel’s office. The announcement comes just two weeks after the mayor revealed he wouldn’t seek a third term, setting off a mad scramble among hopefuls vying to succeed him.

The mayor on Tuesday said the book deal has been in the works for months, and he initially planned to write it in his third term before opting out of the race. He said the project isn’t about protecting his legacy against whomever comes next. Rather, it will be a look at how mayors he knows are tackling challenges.

“You can’t do it about Chicago,” he said. “Will Chicago be part of it? Yeah. It’s my experience. But I’ve already talked to — there’s a lot of other mayors around the globe and around the United States whose experiences and … successes for their own locality are going to be part of this. That’s the only way to tell this story.”

Emanuel said he didn’t have the specifics about the money he will get from the book deal. He said he and his wife, Amy Rule, are planning to donate a portion of the proceeds to youth mentoring programs.

Emanuel has long touted the primacy of mayors in the 21st century, arguing increasing gridlock at other levels of government is making local officials innovate and collaborate to get things done “where the rubber hits the road.”

And he has worked to position himself at the forefront of American mayors protecting undocumented immigrants and other Chicago residents against more conservative policies favored by President Donald Trump’s administration.

But Emanuel’s particular view of how to best prepare Chicago for the future has come under blistering attack from progressives and grassroots groups almost from the moment he took office in 2011. They say he focuses too much on downtown development and wooing corporations, to the increasing detriment of working-class and poor residents struggling to make ends meet in outlying neighborhoods.

He faced a dozen announced challengers for mayor when he opted not to run. They were focusing much of their energy on ripping the shortcomings of the Emanuel administration, from violent crime and police misconduct, to school and mental health clinic closings and a lack of jobs in neighborhoods with large minority populations.

When he leaves office in May 2019, Emanuel will have a chance to start making the case for his brand of Democratic leadership without having to suffer critics’ daily slings and arrows.

“That’s not the basis (of the book),” Emanuel said when asked whether it can be used to plant a flag for the decisions he made. “But I think if you’re going to be a mayor that keeps Chicago a global city on the world stage, that fulfills the needs of people, there are things you’re going to have to do on community colleges, infrastructure, quality of life, that I’m going to at least say, ‘Here’s what I’ve done and here’s what other mayors are doing.’”

It’s a common move for elected officials to move quickly to get their version of things into print to stake a claim for their legacy as those who follow them in office take a different tack and fire shots at their predecessors. And Emanuel, notoriously hard-charging and well-aware of his spot in the American political landscape, is wasting no time in going to bat for himself.

But he said like the 2007 book he co-wrote, “The Plan,” the new book will discuss a lot of policy ideas rather than the political aspects of his years in office and their aftermath.

“I know I’m perceived as a political animal, and I like politics. I think you can’t do politics without knowing something about politics,” he said. “But if you look at my other book, it was about policy. This is consistent both with that appreciation of politics as well as the role policy plays in a political world.”