JAIPUR, India — Literary notables including Margaret Atwood, Aleksandar Hemon and Thomas Piketty came to this northern city toward the end of January, appearing before large crowds at the Diggi Palace, an 18th-century complex temporarily filled with tents, food kiosks and bookstores. Some 330,000 people showed up, breaking the attendance record and once again making the Jaipur Literature Festival the largest event of its kind in the world.  The event began nine years ago, and its increasing size is a reminder of the seemingly limitless growth of literary festivals in India. Close to 100 populate the land; not long ago, the concept was virtually unknown here. They have sprouted in cities large and small, in the Himalayas and at beach spots, with some dedicated to specific genres like crime writing or children’s literature.  As the festivals have blossomed, they have also turned into something more than strictly literary: a mixture of the public square and the television studio, or forums where India talks to itself. “What tends to happen is that the tamasha, or spectacle, is a large part of the festival,” said Aakar Patel, a prominent writer and columnist, using the Urdu and Hindi word. “We have sessions that are deeply political, and they are colored very strongly by emotion and feeling and the politics and divisions of our time.”  The final session at this year’s Jaipur festival was a debate on freedom of expression, a subject of anxiety among Indian liberals and thus an almost inevitable theme at literary events here. (The subject is especially pertinent to this festival because Salman Rushdie pulled out of attending in 2012 amid reports that he had been physically threatened over his authorship of “The Satanic Verses,” a 1988 novel that angered many Muslims and is still banned in India.)  One of the panelists at this closing session was Anupam Kher, a popular actor and vocal supporter of Narendra Modi, India’s prime minister, whose government has been faulted for failing to protect free speech. Mr. Kher’s presence led to scenes rarely seen at a literature festival: The language frequently descended into something less than parliamentary, and Mr. Kher found himself booed and cheered in equal measure.  Increasingly, literature festivals in India are being thrust into wider culture wars. In November, Vikram Sampath, director of the Bangalore Literature Festival, resigned just a few days before it was to begin after participating writers threatened to boycott the proceedings. They were angry that Mr. Sampath had criticized dozens of writers who had returned awards to India’s national academy of letters to protest what they saw as a rising climate of intolerance on Mr. Modi’s watch.  At the closing session in Jaipur, Mr. Kher’s supporters chanted Mr. Modi’s name as other speakers tried to talk. Conversely, Mr. Kher was roundly booed in December at a festival in Mumbai for suggesting the audience had been paid to heckle him.  William Dalrymple, a historian and co-founder of the Jaipur Literature Festival, defended the decision to invite Mr. Kher.  “Liberal folks can’t just talk to themselves all the time, “ he said. “You need two different points of view.” He suggested that the problem was a shortage of genuine conservative intellectuals in India, saying that thinkers in the country overwhelmingly tended to be from the left.  Mr. Dalrymple is a pivotal figure in the mushrooming of literature festivals in India: He started the Jaipur Literature Festival in 2007. For the first edition, he managed a literary coup of sorts, persuading Mr. Rushdie to attend.  “It was Salman’s first appearance in a public event in India since the fatwa,” Mr. Dalrymple said, referring to a 1989 call for his assassination issued by Ayatollah Ruhollah Khomeini, then the supreme leader of Iran, over “The Satanic Verses.” “And suddenly there was a lot of buzz in Delhi.”  Over four days at the 2007 festival, the crowds increased from about 100 to 2,000, he said. “From that point onwards, it just grew and grew.”  The extraordinary success of the Jaipur Literature Festival was soon felt, leading new events to crop up each year. Media conglomerates and large corporations like The Hindu newspaper in Chennai and the multinational Tata Group in Mumbai led the charge, sponsoring festivals in their traditional home bases. There were offbeat events, too, like the Khushwant Singh Literary Festival, founded in 2012 to honor that grand old man of Indian literature, who died two years later at 99.  Mr. Patel remembers attending a literature festival for the first time in 2011 and being struck by the size of the crowds. The event was in Mumbai and organized by The Times of India, the country’s largest English-language daily newspaper.  Mr. Dalrymple noted that India has a centuries-old tradition of public performances of literature. He cited the poets who recited to large audiences in the ancient Sangam period in southern India and the mushaira, a kind of poetry symposium common in the medieval Mughal era.  “There was something very deep we were tapping into,” he said.  Despite a rapidly expanding middle class and growing levels of disposable income, Indian cities can boast of only a smattering of high-quality live events. “In Hong Kong or Paris or even the smaller cities in the West, there are many things you can go to and be part of — you could go to theater or live music,” Mr. Patel said. “We don’t have enough of that in India.”  The festivals have therefore stepped into a vacuum. They are less costly than staging high-profile concerts, which have high licensing and tax costs, for example, and corporate sponsorships are easy to come by. Most festivals are between the cooler months of October and February. The Jaipur Literature Festival now has outposts in Boulder, Colo., and in London, a rare Indian cultural pastime to be exported to the West.  Mr. Patel, the columnist, who is a speaker at several festivals each year, said he expected the scene to expand. “I can’t think of a literature festival that hasn’t succeeded,” he said. “They all find sponsors, they all come back year after year.”  A version of this article appears in print on February 24, 2016, on page C2 of the New York edition with the headline: India’s Literary Festivals Tap Into Anxiety. Order Reprints| Today's Paper|Subscribe
A festival in Jaipur drew 330,000 people, testifying to the popularity of what is proving to be a lightning rod for politics and emotions.