Forced obedience: Layer-structured montmorillonite (MMT) was used as a nanoreactor for the generation of planar pyridinic and pyrrolic N sites in nitrogen-doped graphene (NG; see picture). The selectivity for the formation of planar N sites was inversely proportional to the interspace width (δ) of the MMT and reached a maximum of 90.27 %. The NG catalyst exhibited low electrical resistance, high electrocatalytic activity, and good stability.