Structure and rare-earth magnetism in (Nd1-xGdx)2CuO4.