The formation and evolution of galaxies within merging dark matter haloes* | Synapse