CO2 turned into a nitrogen doped carbon catalyst for fuel cells and metal–air battery applications