The electronic-structure and band-gaps in transition-metal compounds