  Ferroic materials enable a multitude of emerging applications, and optimum
functional properties are achieved when ferromagnetic and ferroelectric
properties are coupled to a first-order ferroelastic transition. In bulk
materials, this first-order transition involves an invariant habit plane,
connecting coexisting phases: austenite and martensite. Theory predicts that
this plane should converge to a line in thin films, but experimental evidence
is missing. Here, we analyze the martensitic and magnetic microstructure of a
freestanding epitaxial magnetic shape memory film. We show that the martensite
microstructure is determined by an invariant line constraint using lattice
parameters of both phases as the only input. This line constraint explains most
of the observable features, which differ fundamentally from bulk and
constrained films. Furthermore, this finite-size effect creates a remarkable
checkerboard magnetic domain pattern through multiferroic coupling. Our
findings highlight the decisive role of finite-size effects in multiferroics.
