  An axially symmetric ansatz is proposed to investigate the properties of
baryon in a uniform magnetic field. The baryon number is shown to be conserved,
while the baryon shape is stretched along the magnetic field. It is found that
with increasing magnetic field strength, the static mass of the baryon first
decreases and then increases, while the size of the baryon first increases and
then decreases. Finally, in the core part of the magnetar, the equation of
state strongly depends on the magnetic field, which modifies the mass limit of
the magnetar.
