As long as you don't have any sugar then you remain in ketosis. The problem is there is sugar in lots of things. Things that maybe you wouldn't think of, like fruit, potatoes, rice, pasta, bread, carrots, sweetcorn, fizzy drinks etc and the obvious sweets/biscuits/choc will all knock you out of ketosis.