If he's only been with you a few weeks, he's probably still settling in! Cats can display appeasement behaviour which is they will do anything they can to make you love them so you won't hurt them/abandon them/etc. It will probably take him a few weeks to get into a routine, but until then I would be wary of shutting him out of the room whilst you're doing work (although completely understand why at night-time). Instead, take him off your books, plonk him on the floor with a firm no, and keep doing it. It is tedious (I had to do it with my three kittens and uni work), but they do get the message.