The evolution of hierarchical porosity in self-templated nitrogen-doped carbons and its effect on oxygen reduction electrocatalysis

Pyrolitic self-templating synthesis is an e ﬀ ective method for creating hierarchically porous N-doped carbons. We study the evolution of microstructure in self-templated carbons derived from magnesium nitrilotriacetate, in the 600 – 1000 (cid:1) C temperature range. The materials are characterised using N 2 adsorption, Hg intrusion, X-ray di ﬀ raction, X-ray photoelectron spectroscopy, Raman spectroscopy, elemental analysis, scanning electron microscopy and transmission electron microscopy. The carbons display high speci ﬁ c surface areas (up to 1830 m 2 g (cid:3) 1 ), and high pore volumes (up to 3.1 mL g (cid:3) 1 ). Interestingly, each porosity type – micro, meso, and macro – evolves along its own route. Micropore growth is most signi ﬁ cant between 600 and 700 (cid:1) C, yet it slows down and stops around 800 (cid:1) C; this indicates that micropores form by removal of tarry matter from the interstices between graphitic sheets, rather than by physical/chemical etching of these sheets. Mesopores, templated by spontaneously forming MgO nanoparticles, become dominant at 800 (cid:1) C; further agglomeration of these particles leads to macropore templating at 900 (cid:1) C. The porosity evolution is explained by the growth of MgO particles, as monitored by XRD broadening. Furthermore, the degree of disorder decreases with the pyrolysis temperature, most signi ﬁ cantly between 700 and 800 (cid:1) C, with the Raman I D / I G ratio dropping from 1.36 to 1.17. Correspondingly, the in-plane length of graphitic crystallites increases along the series, from 14 to 17 nm. Although the nitrogen content decreases with pyrolysis temperature, from 6.9 to 4.1 at%, the ratio between graphitic and pyridinic nitrogens remains constant. We then measure the performance of these carbons as electrocatalysts in the oxygen reduction reaction (ORR) at pH 13 using rotating disk electrode voltammetry and electrochemical impedance spectroscopy. Remarkably, the ORR activity trend is independent of nitrogen concentration or degree of disorder. Instead, it is governed by the microstructural parameters, most importantly surface area and microporosity.


Introduction
Activated carbon has been used as a dye and adsorbent for millennia, [1][2][3][4] and in catalysis for decades. 5,6 Lately, carbon has been hailed as a promising electrode material for electrochemical charge storage 7 in batteries, 7-9 supercapacitors, [10][11][12][13] and fuel cells. [14][15][16][17] Specically, carbons doped with heteroatoms such as nitrogen are a leading alternative to platinum as electrocatalysts in the oxygen reduction reaction (ORR) in alkaline solutions. [18][19][20][21][22][23][24] Both the elemental composition and the microstructure of carbon determine its catalytic performance. [15][16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] Carbon comprises matter (sp 3 /sp 2 carbon ratio, doping, crystallinity) and voids (pore sizes, shapes and distribution). Micropores (d < 2 nm) provide most of the surface area of the material. This means that most catalytic active sites are located in micropores. 3 Mesopores (d ¼ 2-50 nm) contribute more to the internal volume of the carbon, serving as immediate reservoirs for reagents and enabling the transfer of reagents/ products to/from the micropores. 32 In some cases, the mesopores are small enough to affect reaction pathways by connement effects. 33 Finally, macropore channels (d > 50 nm) are the highways for mass transfer through the carbon, contributing most to its internal volume. 34 The different pore levels must intersect, to enable the splitting of reagent/ product ow; only then can porosity be termed 'hierarchical' (Fig. 1). [21][22][23][35][36][37] Yet carbon structure is easier described than designed. Carbon synthesis protocols come in two very different types: empirical and rational. In the former, abundant carbonaceous precursors (biomass-based or petro-based) are pyrolyzed in hope for serendipity. [38][39][40][41][42][43] The resulting carbons are easily made and cheap, but controlling their porosity and composition is difficult. In the latter, chemical precursors are transformed with various external templating methods. This allows a high degree of control over the material properties, but preparation is more complex and costly. External templating methods include hard templating [44][45][46][47] (e.g. on silica, which is then etched away by HF) and so templating (based on organic self-assembly). 36,48,49 Other methods for controlling carbon structure include pyrolyzing preformed aerogels 50,51 and the etching of pores by chemical and physical means. 3 Self-templating is a powerful route to hierarchical porous carbons. [52][53][54][55][56][57][58][59] In this approach, simple metal-organic salts such as magnesium citrate are used as both carbon precursor and templating agent. During pyrolysis, nano-sized metal oxide particles (e.g. MgO) form within the carbon matrix. Washing out these particles leaves behind mesopores (in case of single nanoparticles) and macropores (for nanoparticle agglomerates). Recently, we reported the discovery of a family of self-templating nitrogen-doped carbons, based on the pyrolysis of various magnesium nitrilotriacetates (MgNTA). 23,30 These carbons exhibit an interpenetrating network of micropores, mesopores and macropores, lined with graphitic shells. However, despite having advantages such as hierarchical porosity, graphitic network and high doping, the challenge of 'designability' remains open. To address it, we must rst understand the mechanism of pyrolytic self-templating.
We now report a detailed study into the evolution of microstructure and composition in MgNTA-derived carbons, in the 600-1000 C temperature range. Using a broad array of experimental techniques, we follow the surface area, internal volume, micro-/meso-/macro-pore distribution, size of templating MgO nanoparticles, degree of graphitization, and nitrogen content and distribution. The result is a step-by-step description of how micropores are formed, and how mesopore-templating nanoparticles of MgO grow and agglomerate. Finally, we test how the evolving microstructure and composition affect the carbons' ORR activity at pH 13, a reaction of rising importance due to the rise of alkaline exchange membranes for fuel cells. 20

Procedure for synthesis of hierarchical porous carbons
This is a modication of a previously published procedure. 23 Briey, magnesium nitrilotriacetate (MgNH(CH 2 COO) 3 (H 2 O) 3 ) was precipitated from a 1 : 1 solution of basic magnesium carbonate (Strem) and nitrilotriacetic acid (Aldrich) at 85 C. Aer drying and grinding, the salt was pyrolyzed at a range of temperatures (600-1000 C) in Ar atmosphere for 1 h (heating rate 10 C min À1 ). The resulting MgO@N:C composite was washed in citric acid (0.5 M) overnight, dried, and annealed in argon (1000 C/1 h, heating rate of 5 C min À1 ).

Characterization of materials
Thermogravimetric analysis (TGA) was done on a Netzch Jupiter® STA 449F3 instrument, under argon (20 mL min À1 ) between 30 and 800 C. Transmission electron microscopy (TEM) was done on a Tecnai Osiris microscope at an accelerating voltage of 200 kV. Scanning electron microscopy (SEM) was done on a Zeiss EVO50 microscope operated at 15 kV. N 2 adsorption-desorption isotherms were measured on a Thermo Scientic Surfer instrument at 77 K, using vacuum dried samples (200 C/3 h). Isotherms were analyzed by the Thermo-Fischer Advanced Data Processing 6.0 soware. The isotherms were analyzed using the two-parameter Brunauer-Emmett-Teller (BET2) model for specic surface area, the Dubinin-Radushkevitch model for micropore volume, the Horvath-Kawazoe method for micropore size distribution, and non-local density functional theory (NLDFT) isotherm tting for mesomacropore size distribution. In the latter, the model used was N 2 /graphite at 77 K, with slit-shaped pores (giving a better t than cylindrical pores). Helium density was measured on a Micromeritics Multivolume Pycnometer 1305. Mercury intrusion was carried out on a Pascal 440 Porosimeter (CE Instruments) up to 400 MPa, on the same pre-treated samples. X-Ray diffraction (XRD) patterns were obtained with a MiniFlex II diffractometer using Ni-ltered Cu-K a radiation, at 30 kV and 15 mA. Approximate sizes of the coherently scattering domains (D) were calculated using the Scherrer equation: where l X is the X-ray wavelength (1.54056Å for Cu-Ka), b is the line broadening (in rad), and q is the Bragg angle. This equation only accounts for size-dependent broadening, so it gives a lower limit for actual particle sizes. 60,61 No calibration was done to account for instrument broadening, so the calculated D values are limited to studying trends within the series. Raman spectroscopy was performed on a Thermo Nicolet Almega XR Dispersive Raman microscope, with a Â50 lens and 10 exposures of 5 s. The laser wavelength is 532 nm (24 mW). First-order Raman spectra were t iteratively with four Lorentzian components, based on literature assignments. [62][63][64][65][66] The in-plane (a direction) lengths of graphitic crystallites (L a ) were calculated from the intensity ratios of tted D and G bands, according to the relation determined by Cançado et al., 67 Fig. 1 Scheme of hierarchical porosity (type II), 37 showing intersecting pore types.
where l l is the laser wavelength (532 nm). X-Ray photoelectron spectroscopy (XPS) measurements were carried out using a PHI VersaProbe II scanning XPS microprobe (Physical Instruments AG, Germany). Analysis was performed using a monochromatic Al Ka X-ray source of 24.8 W power with a beam size of 100 mm. The spherical capacitor analyzer was set at a 45 take-off angle with respect to the sample surface. The pass energy was 46.95 eV yielding a full width at half maximum of 0.91 eV for the Ag 3d 5/2 peak. Peaks were calibrated using the C 1s position. Curve tting was done using XPSPeak 4.1.

Procedure for electrochemical measurements
Inks of the carbon powders (0.80 mL DI water, 0.20 mL ethanol, 10 mL Naon® 5 wt% dispersion (Alfa Aesar), 1.0 mg carbon powder) were sonicated and dropcast (3 Â 10 mL) on a polished f ¼ 5 mm (A ¼ 0.196 cm 2 ) glassy carbon electrode (Gamry), and dried at 50 C. Total catalyst loading was 30 mg, or 153 mg cm À2 . Electrochemical experiments were performed in 0.1 M KOH at 25.0 AE 0.1 C, using a Gamry Reference 600 potentiostat and a Gamry RDE710 Rotating Electrode setup. Saturated calomel electrode (SCE) separated by a 10 cm bridge was used as a reference electrode, and a graphite rod as a counter electrode. Potentials were reported vs. reversible hydrogen electrode (RHE) by adding 1.011 for pH 13. N 2 or O 2 (both 99.999%) were bubbled for >60 min to saturate the solution, and were owed above the solution during the experiments. Voltammograms were collected from 1.01 to 0.31 V vs. RHE with a scan rate of 10 mV s À1 . RDE voltammograms were collected at rotating speeds of 2400, 2000, 1600, 1200, 900, 600 and 400 rpm. Reported current densities represent faradaic currents, aer subtracting the capacitive charging background current. The solution resistance (typically 44-48 ohm) was measured prior to each measurement set. A positive feedback automatic iR correction of 90% was used. Before measurements, surface adsorbed oxygen was reduced and the wetting was improved by cycling the electrode between 0 and À0.7 V vs. SCE for 20 cycles at 50 mV s À1 . Electrochemical impedance spectroscopy (EIS) was measured potentiostatically at AE5 mV around the half-wave potential for ORR, while bubbling oxygen and rotating at 1600 rpm. The electrochemical impedance spectroscopy frequency range was 0.2-10 6 Hz. The number of moles of electrons transferred per mol O 2 (n) was estimated by the Koutecký-Levich equation where J is the measured current density (mA cm À2 ), J K the kinetic (exchange) current density (mA cm À2 ), and u is the electrode rotation rate (rpm). The term B is given by D O is the diffusion coefficient of O 2 (1.9 Â 10 À5 cm 2 s À1 at 25 C in 0.1 M KOH), and n is the kinematic viscosity of the 0.1 M KOH electrolyte at 25 C (0.01 m 2 s À1 ). By plotting 1/J versus 1/u 1/2 at different potentials and tting linear equations to the data, the number of electrons could be calculated from the 1/B slope.

Results and discussion
3.1 Microstructure of the carbons N-Doped carbons were prepared by pyrolyzing magnesium nitrilotriacetate at ve different temperatures between 600 C and 1000 C (see Experimental section 2.1 for full procedure). Sample names denote the pyrolysis temperature in C (C600, C700, C800, C900 and C1000). All of the MgO-free carbons were then annealed at the same temperature (1000 C), removing any surface functionalities introduced during the acid wash step. 23,53,54 Carbonization of MgNTA is complete at 540 C, according to the thermogravimetric analysis in argon (Fig. S1 †). The reactions occurring during carbonization were described by Budkuley and Naik. 68 Here, we will focus on the subsequent microstructural changes. The surface area and porosity of the carbons were studied using N 2 adsorption. Fig. 2a shows the N 2 adsorption-desorption isotherms at 77 K for carbons C600 to C1000, as a function of equilibrium relative pressure (P/P 0 , where P 0 is the saturation pressure of N 2 at 77 K). 69 The initial sharp rise at P/P 0 < 0.01 corresponds to micropore lling, a primary physisorption process distinct from surface adsorption. The magnitude of the rise in carbons C700-C1000 reects abundant micropores. The consequent slope (P/P 0 > 0.2) corresponds to the lling of mesopores with monolayers and multilayers of N 2 . The ultimate rise (P/P 0 > 0.8) and subsequent desorption hysteresis are characteristic for capillary condensation in the nite-volume of the mesopores. While C600 exhibits a type III isotherm (typical for nonporous solids), C700-C1000 show typical type IVa isotherms, characteristic for micro-mesoporous materials. 69 The hysteresis loops in the latter are type H4. 69 Such hysteresis may arise by different mechanisms, such as adsorption metastability (delayed condensation), pore blocking at narrow pore necks, and/or cavitation-induced evaporation. 69 The carbons exhibit specic surface areas (SSAs) as high as 1830 m 2 g À1 (C900, Fig. 2b and Table 1) and total pore volumes as reaching 3.1 mL g À1 (C900, at P/P 0 ¼ 0.99). While high SSAs are oen observed in activated carbons, the high pore volumes reveal the predominance of mesopores and macropores. By quantifying the micropore volumes with the Dubinin-Radushkevitch model, we could separate the contributions of different pore types to the total volume ( Fig. 2c and Table 1). The relative volume of mesopores and macropores is highit rises from 65% in C600 to a stable 76-80% in C800-C1000. Moreover, while all pore types increase in volume as a function of the pyrolysis temperature, the micropore volume increases by a factor of 4, while the combined mesopore and macropore volume by as much as a factor of 9 (C600 vs. C900). When the pyrolysis temperature is further raised from 900 C to 1000 C, the surface area starts shrinking, probably due to pores collapsing. 70 To follow and quantify the evolution of microporosity, we analyzed the N 2 monolayer formation using the Horvath-Kawazoe model (Fig. 2b). 72 In all the carbons, micropores are smaller than 1 nm. Micropores grow as the pyrolysis temperature is increased, and the most signicant increase in micropore sizes occurs between 600 and 700 C. Further growth slows down and nally stops: there is barely any change in the microporosity from 800 C to 1000 C. Yet how do these micropores form? According to the TGA, the carbon loses 5.7% of its weight (0.84 percentage points in Fig. S1 †) between 550 C and 800 C. This, together with the growth deceleration, suggests that micropores form between 600 C and 800 C due to the elimination of tar from the interstices between the carbon sheets. 3 When this "tar supply" runs out (>800 C), the pore growth decelerates and stops. This is the most plausible mechanism in the absence of external activation agents. 3 The N 2 adsorption data can be further analyzed using NLDFT isotherm tting, giving information about mesopores and macropores ( Fig. 2d and S2 †). According to Fig. 2d, all carbons contain small ($5 nm), medium ($20 nm) and large ($40-50 nm) mesopores. All pore types become more abundant at higher pyrolysis temperatures. The NLDFT-derived pore size distributions are more qualitative, as they depend on a range of mathematical and physical assumptions for the tting process. 3,72 However, this method does shed some light on pore growth, especially at the transition between C800 and C900-C1000. The former shows two separate pore sizes at $33 and $48 nm, while the latter show a broader pore cluster at $40-50 nm. This  increase may reect pore growth or convergence near the mesopore/macropore boundary. We then studied the mesopore and macropore size distribution of carbons C600-C1000 by mercury intrusion (Fig. 2e). This method gives more reliable data on this type of porosity compared with simulation-based methods involving N 2 adsorption-desorption isotherms. 3,72 The measurement is robust and direct, and can also distinguish between pores inside particles and inter-particle volumes in particle agglomerates. At low pyrolysis temperatures (C600, C700), almost no intrusion occurs, reecting the absence of intraparticulate pores (mesopores or small macropores). When heated to 800 C, signicant mesoporosity develops (C800), creating 5-20 nm pores. As the pyrolysis temperature is increased further, this peak broadens and shis to larger pore sizes, all the way up to 150 nm. In this temperature range, the pore volume increases dramatically (by nearly 70%). Thus, the 700-800 C temperature range spans the micropore/mesopore transition, while the 800-900 C range spans the mesopore/macropore transition.
The evolution of the mesoporosity and macroporosity can be explained by the growth of MgO particles, which act as templates. Initially (#700 C), the MgO nanoparticles are too small and/or too few to give rise to signicant volumes of mesopores. As they grow (C800), they become large enough to serve as templates in the small mesopore region ($5-20 nm). The further broadening of pores, observed in C900, may result from particle growth and/or agglomeration; the two are hard to distinguish by N 2 adsorption alone. The consequent decrease in pore volume in C1000 may arise from further particle agglomeration, leading to segregation of the MgO from the carbon. Moreover, pore collapse becomes more signicant at higher temperatures. 3,70,71,73 To understand the evolution of the MgO nanoparticle templates, we studied the XRD patterns of the MgO@carbon composites immediately aer pyrolysis (before washing out the MgO particles). The diffractograms in Fig. 3 shows the typical broad carbon peak at $24 , corresponding to the (100) planes in carbon, and also three sharp peaks at 36.7 , 42.8 and 62.1 . These peaks are assigned to the (111), (200) and (220) planes of MgO, respectively (JCPDS card 45-0946). Control experiments showed that the MgO peaks in the MgO@carbon composites are broader than those in bulk MgO. This broadening proves that the MgO particles are indeed nanometric and allows following their growth on a semi-quantitative level. As the temperature is increased, the peaks' full widths at half maximum (FWHMs) are narrowed. For MgO(220), they decrease from 1.5 to 1.0, while the corresponding FWHM in bulk MgO(220) is just 0.2. The Scherrer equation allows us to compare the approximate sizes of the coherently scattering MgO domains, yielding values between 6.5 and 10 nm (Table 1). Thus, the drastic mesopore broadening between 800 and 900 C cannot arise from the rapid growth of MgO nanoparticles, since their sizes increase only by several nanometers. Rather, the mesopore broadening and the disappearance of small mesopores, arise from MgO agglomeration at higher temperatures. Agglomeration decreases the number of MgO nanoparticles available for templating small mesopores, and the resultant agglomerates serve as templates for large mesopores and macropores.
In addition to porosity, other structural parameters affect the electrocatalytic behavior of a carbon material. These include conductivity and dopant concentration. The electronic conductivity is linked with the degree of graphitization and the percolation of graphitic domains in the carbon.
Raman spectroscopy affords more quantitative measures of the former, describing the degree of disorder and graphitization in the material by various descriptors. To study the degree of disorder in carbons C600-C1000, we measured their rst-order Raman spectra (Fig. 4 and S3 †). Two maxima occur near 1345 and 1595 cm À1 for all samples. These were assigned to the D and G bands of graphite, respectively. The G band appears in all sp 2 carbon Raman spectra, arising from E 2g in-plane bondstretching motions of pairs of sp 2 carbons. The D band is a breathing mode of sp 2 carbons in rings; this A 1g vibration is forbidden in perfect graphite yet is activated by symmetry reduction near defects, crystal edges, or impurities. Thus, the D band is oen used as an indicator of disorder. [63][64][65][66]74 Fitting the spectra with just two Lorentzian functions proved impossible, revealing another peak between the two major bands, as well as a shoulder in the low wavenumber side of D band. The former is assigned to the D 00 band, typically associated with turbostratic defects (graphene layers slipping out of alignment). [63][64][65] The latter shoulder is assigned to the I band, 63-65 arising from impurity-induced disorder; it has been observed only in disordered carbons. [62][63][64]   The mixed graphitic/disordered nature of the carbons is thus revealed by the presence of the D, D 00 and I Raman bands, as well as the relatively high I D /I G ratios (1.1-1.4, Fig. 4b). This mixed nature is typical for many N-doped carbons, 15,16,[64][65][66] in which the nitrogen doping induces structural defects and contributes to local symmetry breaking.
To study how the disorder in the carbon changes with pyrolysis temperature, we followed the I D /I G ratio. Fig. 4b shows that this ratio generally decreases with pyrolysis temperature. Thus, the carbons become more ordered when heated above 600 C. This change reects the in-plane growth of graphitic crystallites, whose lengths (L a ) can be calculated from the I D /I G ratios. The crystallite lengths range from 13.8 nm for C600 up to 17.4 nm for C900 (Fig. 4c). The slight decrease in L a between C900 and C1000 (16.2 nm) may reect shrinking and curving of the graphene layers. 75 Such shrinking was suggested also by the N 2 adsorption porosimetry (Fig. 2c). Interestingly, the I D /I G ratio drops sharply from 1.36-1.37 (C600, C700) to 1.09-1.18 (C800, C900, C1000). This step is not correlated with nitrogen loss, which would have explained an increase in order. [64][65][66] Rather, the increasing order shows that the 700-800 C temperature range is critical for graphitization catalysis using this particular carbon feedstock (graphitization occurs at different temperatures with different carbon feedstocks, even when using similar MgO catalysts [76][77][78] ).
Finally, the concentration and distribution of nitrogen dopants in the carbon matrix plays an important role in its electrocatalytic activity. The bulk concentration of nitrogen was determined by elemental analysis to be 4.0-5.7 wt% (Table 1). All carbons contained 0.21-0.35 wt% of residual magnesium, and 1.60-1.85 wt% of hydrogen (Table S1 †). We then used XPS to further study the surface and near-surface composition of the carbons, as most relevant for catalysis (Table 1 and Fig. 5). All the carbons contain some surface oxygen (typically 2-3 at%), with the O 1s peak constant at 532.1 AE 0.1 eV (see Fig. S4, ESI †). The nitrogen concentration is close to 6 at% and relatively constant between 600 and 800 C. At higher temperatures it decreases gradually, dropping to 4 at% at 1000 C (Fig. 5b). This decrease corresponds to temperature-driven denitrogenation. 79,80 Nonetheless, the N content values are high for single-precursor carbons, without resorting to external nitrogen sources. Fig. 5b also shows the distribution of nitrogen functionalities, which is important to oxygen reduction activity. [14][15][16]18,24 Most of the nitrogen is in graphitic form, with pyridinic nitrogens coming close behind. There is an ongoing debate in the literature as to their relative merits in ORR, [14][15][16]18,24 so an abundance of both is expected to be benecial for catalysis. Interestingly, the graphiticto-pyridinic nitrogen ratio remains almost constant at 1.5 AE 0.1 throughout the temperature range, even decreasing slightly at higher temperatures. This supports our hypothesis that the micropores form via the interstice cleaning route. Were the micropores formed by etching, pyridinic nitrogens would have been etched away faster than graphitic ones. 30 We also used high resolution transmission electron microscopy to obtain a qualitative picture of the material (Fig. 6).
Pyrolysis at 900 C, shows a composite of MgO nanoparticles in a carbon matrix (Fig. 6a-c). The particles themselves are either dispersed or agglomerated, and range between 5 and 10 nm in size. The nal carbons show overlapping mesopores and macropores lined with graphitic shells (Fig. 6d-f). Moreover, a wormlike structure is seen in the high resolution micrographs (Fig. 6f). The black holes are about 3-6Å in size, and are typically assigned to micropores. 81 Scanning electron microscopy (SEM) studies of the carbon series shows that the macroscopic carbon particles become more fractured at higher pyrolysis temperatures (Fig. S5 †). Mapping the elemental distribution in a small region using energy dispersive X-ray spectroscopy (EDS) reveals a homogeneous distribution of carbon and nitrogen (Fig. S5 †). While these results (as in many SEM and TEM studies) are qualitative in nature, they complement the surface area, diffraction and spectroscopy measurements, conrming the hierarchical porosity and graphitic network in the carbon.

Oxygen reduction electrocatalysis
To study how the evolving microstructure and composition affect electrocatalytic activity, we tested the carbons as ORR electrocatalysts under basic conditions. Cyclic voltammetry (CV, Fig. 7a) in an O 2 -saturated solution reveals that the activity improves with higher pyrolysis temperature (the onset and halfwave potentials for ORR shi positively). This nding is supported by potentiostatic EIS. The semicircle widths in the EIS-derived Nyquist plot (Fig. 7b) correspond to the chargetransfer resistance, and thus represent kinetic barriers during electrocatalysis. 21,82 These values decrease steadily as pyrolysis temperature is raised. Both the CV and EIS data reveal a signicant jump in activity between 600 C and 700 C, and  Fig. 7c and S6 †). The closer this value is to 2, the more H 2 O 2 is produced and released without being reduced to OH À nor decomposed. This is useful when H 2 O 2 production is pursued, 83 and unwanted when complete (4e À ) ORR is desired, e.g. in fuel cell or battery cathodes. [14][15][16]18,24 As Fig. 7c reveals, C600 catalyzes only the 2e À reduction. Thus, despite containing over 6 at% nitrogen, its electrocatalytic activity is similar to that of an undoped carbon derived from magnesium citrate (the latter is similar enough to magnesium nitrilotriacetate so that one would expect the formation of similar carbon microstructures 15,23 ). This shows that a high nitrogen content is by itself insufficient for ORR activity. Rather, the nitrogen sites must also be sufficiently exposed, which requires a high surface area.
Deriving reliable structure-activity links is a challenge in the eld of materials science in general, and electrocatalysis in particular. This is especially true in the case of N-doped carbons, because raising the pyrolysis temperature changes several properties of the material simultaneously: porosity, surface area, graphitization, nitrogen concentration and distribution. Nonetheless, we can identify some structureactivity trends: (1) The ORR activity improves with the graphitization temperature, in line with the observations of Liang, 26 Müllen, 84 and others. [15][16][17] However, this improvement does not follow the concentration of nitrogen, which is depleted at higher pyrolysis temperatures. Thus, microstructural considerations play the deciding role over the entire 600-1000 C temperature range.
(2) The dramatic increase in ORR activity at lower temperatures (600-700 C) correlates with the increase in surface area. Although the chemical nature of active sites is determined by the bulk and surface composition of the doped carbons, 25-27 the number of exposed active sites is correlated with the surface area. Heating from 600 C to 700 C increases the surface area, and may expose many active sites, thus boosting electrocatalysis. Even at higher temperatures (up to 900 C), the surface area may be behind the ORR activity rise.
(3) Several studies have shown a positive correlation between ORR activity and density of graphitic crystallite edges. 32 This correlation was explained either in terms of exposing more (supposedly more active) pyridinic nitrogens, and/or by the  intrinsic activity of graphene edges. 32,85,86 In carbons C600-C1000 we see the opposite trend: the degree of disorder decreases with pyrolysis temperature, yet electrocatalysis improves. This suggests that the benets of graphitization (e.g. conductivity) may outweigh the loss of catalytic sites.
(4) The similar ORR activity of C700 and C800 suggests that the mesopore transition (700-800 C) plays a smaller role in ORR electrocatalysis than the micropore transition (600-700 C). However, it is possible that this "mesopore transition" is arbitrary, as it is dened by the ability of Hg intrusion to detect smaller pores. In this case, the benecial effect of mesopores may be gradual, spreading over the entire temperature range.
(5) The second heat-treatment step at 1000 C may play a separate role in determining the carbon properties. However, we expect the temperature of the rst pyrolysis to determine most carbon properties, 26 since the MgO particles are then still present in the particles to act as graphitization catalysts and pore templates. Moreover, as all the carbons were annealed at the same temperature, most of the differences in their properties should arise from the rst step.

Conclusions
The evolution of hierarchical porosity, as well as other microstructural and compositional properties of MgNTA-derived carbons, have been studied in the 600-1000 C temperature range by a variety of experimental methods. As summarized in Fig. 8 and Table 1, the porosity may be divided in two main classes, evolving in parallel. The microporosity, on one hand, is derived mostly from the evacuation of tarry matter from interstices between aromatic sheets. The transition to microporosity occurs between 600 C and 700 C, and is accompanied by an increase in surface area, and a dramatic jump in ORR activity. Mesoporosity and macroporosity, on the other hand, are templated by spontaneously forming MgO nanoparticles. Discrete MgO particles give rise to small mesoporosity (>800 C), whereas MgO agglomerates act as macropore templates (>900 C). At a higher temperature (1000 C), some pores collapse, decreasing surface area. The degree of order increases with pyrolysis temperature, suggesting an improved conductivity in the higher-temperature carbons. A signicant graphitization step occurs between 700 and 800 C, suggesting enhanced graphitization catalysis by MgO at this temperature.
Electrocatalytic ORR activity increases with pyrolysis temperature. It is not dictated by nitrogen content nor by edge plane density, both of which decrease along the series. In fact, ORR activity correlates best with microporosity (surface area and micropore volume), emphasizing the importance of active site exposure. Overall, understanding the evolution of microstructure in pyrolytic self-templating carbons can help in developing this important class of materials.