In Philadelphia the main response has been to raise more money privately. The William Penn foundation grant will pay for ageing stacks in the central library to be replaced by a collegiate “shared working space”. Beneath, a “business and entrepreneur innovation centre” will be opened to provide space for startups. Smaller neighbourhood branches will be refurbished too. Libraries should be less like “temples of knowledge” and more like community centres, says Ms Reardon. One clever experiment already underway involves installing kitchens—the idea is that teaching people to cook will encourage them to read recipe books. That has helped keep Philadelphia's libraries busy. In other places, things have gone further still: a library in Bexar County, Texas, opened last year that has no printed books to lend out, only e-readers.

Such innovation upsets some—many librarians dislike the idea of their hallowed spaces becoming publicly-funded alternatives to bars, cafes or creches. Yet libraries face a curious challenge. Supporters tend to see them as instruments of social improvement—making available high culture and specialist knowledge to the poor. The William Penn foundation describes them as “gateways to opportunity”. But if they are to make a difference—and justify the money spent on them—they have to get people to visit. Echoing marble and the smell of gently decaying paper is not enough to compete with smartphones.

Dig deeper: A profile of an architect who is reinventing libraries