Generalized dipole correction for charged surfaces in the repeated-slab approach | Synapse