The electronic properties of hexagonal graphite have been studied in the framework of the density-functional technique, using nonlocal ionic pseudopotentials and a large number of plane waves. The valence charge density and the density of states are presented, as well as the band structure and the charge-density contributions of some typical wave functions. The electronic energies, at the Fermi level, are parametrized by the Slonczewski-Weiss-McClure model, and compared with the parametrization of experimental data. The numerical accuracy of the calculation has been controlled, in order to provide a reliable comparison between theory and experiment. In particular, the agreement obtained in the framework of the density-functional theory for electronic energies at the Fermi level is surprisingly good.