My technique was not to punish in public, but to clearly indicate to the child that even though he misbehaved in public, he WILL get his payback when at home. And then deliver on the payback when home. Children catch on quite quickly. Then if misbehaving in public again, all it takes is a whisper.
;^)