In situ synthesis of supported metal nanocatalysts through heterogeneous doping