  We show that a lattice formulation of density-functional theory (DFT), guided
by renormalization-group concepts, can be used to obtain numerical predictions
of energy gaps, spin-density profiles, critical exponents, sound velocities,
surface energies and conformal anomalies of spatially inhomogeneous quantum
spin chains. To this end we (i) cast the formalism of DFT in the notation of
quantum-spin chains, to make the powerful methods and concepts developed in
{\em ab initio} DFT available to workers in this field; (ii) explore to what
extent simple local approximations in the spirit of the local-density
approximation (LDA), can be used to predict critical exponents and conformal
anomalies of quantum spin models; (iii) propose and explore various nonlocal
approximations, depending on the size of the system, or on its average density
in addition to the local density. These nonlocal functionals turn out to be
superior to LDA functionals.
