This is what I do when it's time for all-day studying/writing/research:

1) Drink something that's not water. Caffeine doesn't really affect me, but a strong taste and carbonation helps keep me from getting drowsy. Coke is my drink of preference.

2) Have food that you can munch on continuously. It's not about filling yourself up; again, it's about keeping awake and focused. Pretzels, for example, are perfect for something that you can just keep eating all day.