  We study the formation and evolution of pillars of dense gas, known as
elephant trunks, at the boundaries of H II regions, formed by shadowing of
ionising radiation by dense clumps. The effects of magnetic fields on this
process are investigated using 3D radiation-magnetohydrodynamics simulations.
For a simulation in which an initially uniform magnetic field of strength
|B|=50 uG is oriented perpendicular to the radiation propagation direction, the
field is swept into alignment with the pillar during its dynamical evolution,
in agreement with observations of the "Pillars of Creation" in M16, and of some
cometary globules. This effect is significantly enhanced when the simulation is
re-run with a weaker field of 18 uG. A stronger field with |B|=160 uG is
sufficient to prevent this evolution completely, also significantly affecting
the photoionisation process. Using a larger simulation domain it is seen that
the pillar formation models studied in Mackey & Lim (2010) ultimately evolve to
cometary structures in the absence of dense gas further from the star.
