FIrst of all, punishing her will only encourage the behaviour. YOu are returning aggression with aggression and that will only escalate the problem. Secondly, try carrying a ping-pong ball with you, so that when you notice her underfoot, you can drop the pingpong ball and she will attack that instead.
Some cats are ticklish, and if you stroke too hard, or in the wrong place or in the wrong direction, then they will respond by curling up and biting (much the same way I respond when someone tickles me against my will). If, instead of reacting, you just let your hand go loose, so that it is completely relaxed, she will stop biting. You should then withdraw your hand slowly. If she attacks again, repeat the procedure until you have your hand back.
It must be hard, in your third trimester, to keep your cool at times, but remember you are a lot bigger than her and can accidentally hurt her, quite badly if you smack in the wrong place, so view restraining from smacking as good training for when the little one arrives and starts driving you up the wall. I am sure you would not smack them...