First off, are you sure the library allows food? I have been in plenty that didn't. If you can, you can always pack a sandwich. Trail mix is something to at least snack on. Nuts are high in protein which is brain food.
I study and do homework at the library every day until 9pm so it has become clear to me that I ought to start taking my meals there (too early to eat beforehand, too late to eat after.) Any pack-and-go meal ideas?
What about protein granola bars? They come packaged and you can keep them in your backpack.