As Robert says a sharp tap on the snout usually puts them off.
It all goes back to when they were babies and you allow them to chew your trouser legs because it is cute and doesn't hurt, problem is they still think they can do it when they're grown ups and it does hurt!
We have the same problems with knee climbing on, as weaners they clamber all over you when you sit in the straw often stayiing on your lap for a tummy rub, trouble is at 2yrs old and 20 odd stone they still think they can

especailly when they want a grumble or a mammy love! mention no names Clover!
Mandy