  We describe a technique for constructing a symplectic transfer map for a
charged particle moving through an accelerator component with arbitrary
three-dimensional static magnetic field. The transfer map is constructed by
symplectic integration; by representing the map at each step of the integration
by a mixed-variable generating function, exact symplecticity is ensured. By
using an appropriate integration algorithm, there is no necessity to make the
paraxial approximation. The technique is illustrated by application (in one
degree of freedom) to a quadrupole magnet with strong octupole component and
fringe field.
