A former teacher is on trial accused of murdering a baby he adopted together with his partner.