  Commonly used semilocal density functional approximations for the
exchange-correlation energy fail badly when the true two dimensional limit is
approached. We show, using a quasi-two-dimensional uniform electron gas in the
infinite barrier model, that the semilocal level can correctly recover the
exchange-correlation energy of the two-dimensional uniform electron gas. We
derive new exact constraints at the semilocal level for the dimensional
crossover of the exchange-correlation energy and we propose a method to
incorporate them in any exchange-correlation density functional approximation.
