Carrying weapons... I don't know about that. It could end up not being in your favour but that's your choice.
If you have that feeling again, or for some reason that person runs into you again, immediately go to the librarian or someone else and say that you feel uncomfortable and feel that you're being followed. Although they may not take it all that seriously, they will be more wary.
Also, try sitting in a more crowded place, or at least a place with a few other people.
And also, if you're going to call or text someone, contact someone that can come and find you. Even if they aren't a close friend, they can find someway to help.
Or you could get a rape whistle.
"Even a broken clock is right twice a day."