An efficient and general method for the analytic computation of the nonandiabatic coupling vector at the multireference configuration interaction (MR-CI) level is presented. This method is based on a previously developed formalism for analytic MR-CI gradients adapted to the use for the computation of nonadiabatic coupling terms. As was the case for the analytic energy gradients, very general, separate choices of invariant orbital subspaces at the multiconfiguration self-consistent field and MR-CI levels are possible, allowing flexible selections of MR-CI wave functions. The computational cost for the calculation of the nonadiabatic coupling vector at the MR-CI level is far below the cost for the energy calculation. In this paper the formalism of the method is presented and in the following paper [Dallos et al., J. Chem. Phys. 120, 7330 (2004)] applications concerning the optimization of minima on the crossing seam are described.