Compatible mixed formulations for elastoplastic models