We study the emergence of \emph{exact Majorana zero modes} (EMZMs) in
one-dimensional spin systems by tuning the magnetic field acting on individual
spins. By focusing on the quantum transverse compass chain with both the
nearest-neighbor interactions and the transverse fields varying over space, we
derive a formula for the number of the emergent EMZMs, which depends on the
\emph{partition nature} of the lattice sites on which the magnetic fields
vanish. We also derive explicit expressions for the wavefunctions of these
EMZMs, which are found to depend on fine features of the foregoing partition of
site indices. As a specific case, the exact solution for an open compass chain
with uniform nearest-neighbor interactions and an alternating magnetic field is
provided. It is rigorously proved that, besides the possibly existing EMZMs, no
\emph{almost Majorana zero modes} exist unless the fields on the even and odd
sublattices are both turned off. Our results provide a precise scheme to
manipulate the number and spatial distributions of the EMZMs by solely tuning
the external fields, and may shed light on the control of ground-state
degeneracies in more general systems.