  In this work we review the formalism normally used in the literature about
the effects of density-dependent magnetic fields on the properties of neutron
and quark stars, expose some ambiguities that arise and propose a way to solve
the related problem. Our approach explores more deeply the concept of pressure,
yielding the so called chaotic magnetic field formalism for the stress tensor.
We also use a different way of introducing a variable magnetic field, which
depends on the energy density rather than on the baryonic density, which allows
us to build a parameter free model.
