I know the XKCD post is strictly about keyboard energy, but still, this is a poor estimate for how much energy writing a novel actually takes. Based on cursory googling, a human brain consumes something on the order of 10W-- vastly more power than you need to type with, and more than enough to power a MacBook Air for light tasks like word processing.
Obviously not all of that energy is used for thinking. According to... erm... io9.com, thinking accounts for 20-50 calories per day, or between 1 and 2.5W. If you're, say, Thomas Pynchon, let's say it takes 3 years to write a novel and it takes up 1/10 of your waking thoughts over that period. Call it 2W of power on the assumption that this is high-end thinking; 1/10 of 3 years is 3.2 megaseconds, so in total you've expended 6.3MJ of energy to write that novel. That's about the energy released by 1.3kg (46oz) of TNT.