JOHANNESBURG — Cyril Ramaphosa, who was sworn in Thursday as South Africa’s president, recently did what many politicians do at pivotal points in their careers.

He released a book.

The book told of one of his passions — his love for a Ugandan breed of royal cattle that he imported to South Africa at great expense. Anticipating criticism of his wealth in a country where millions still live in shacks, Mr. Ramaphosa argued at his book launch that the cattle were not meant as trophies for the elite like him, but to help struggling black farmers in South Africa.

Now, Mr. Ramaphosa, the former labor leader who Nelson Mandela had hoped would succeed him as president, has an even trickier argument to make as the nation’s new leader replacing Jacob Zuma, who was forced to resign this week.