  We investigate the effects of a magnetic field on the thermodynamics of a
neutron system at finite density and temperature. Our main motivation is to
deepen the understanding of the physics of a class of neutron stars known as
magnetars, which exhibit extremely strong magnetic fields. Taking into account
two facts, (i) the existence of a pressure anisotropy in the presence of a
magnetic field and (ii) that the quantum field theory contribution to the
pressure is non-negligible, we show that the maximum value that the inner
magnetic field of a star can reach while being in agreement with the
magnetohydrostatic equilibrium between the gravitational and matter pressures
becomes $10^{17}$ G, an order of magnitude smaller than the previous value
obtained through the scalar virial theorem; that the magnetic field has a
negligible effect on the neutron system's equation of state; that the system's
magnetic susceptibility increases with the temperature; and that the specific
heat $C_V$ does not significantly change with the magnetic field in the range
of temperatures characteristic of protoneutron stars.
