Positron acceleration in a shock wave in an electron-positron-ion plasma is studied with one-dimensional, fully kinetic, electromagnetic particle simulations, with particular attention paid to the effect of inhomogeneity of external magnetic field B-0. First, acceleration to gamma similar to 10(4), where gamma is the Lorentz factor, is demonstrated for a shock wave in a uniform B-0 with the shock speed v(sh) close to c cos theta, where c is the speed of light and theta is the angle between B-0 and the wave normal. The acceleration is not saturated till the end of the simulation run. Then, the effect of nonuniformity of B-0 is investigated: Comparisons are made between the case in which the difference (v(sh) - c cos theta) at the shock front changes from negative to positive values as the shock wave propagates and the case with this relation reversed. The latter is found to create a greater number of high-energy particles than the former. (C) 2012 American Institute of Physics. [doi:10.1063/1.3676632]