Public libraries put up stiff defence in battle for the books