  Results based on {\em ab initio} density functional calculations indicate a
general graphitization tendency in ultrathin slabs of cubic diamond, boron
nitride, and many other cubic structures including rocksalt. Whereas such
compounds often show an energy preference for cubic rather than layered atomic
arrangements in the bulk, the surface energy of layered systems is commonly
lower than that of their cubic counterparts. We determine the critical slab
thickness for a range of systems, below which a spontaneous conversion from a
cubic to a layered graphitic structure occurs, driven by surface energy
reduction in surface-dominated structures.
