Controlling pore size and pore functionality in sp 2 conjugated microporous materials by precursor chemistry and salt templating † Royal Society of Chemistry 2020 Journal

The synthesis of sp 2 -conjugated, heteroatom-rich, “ carbonaceous ” materials from economically feasible raw materials and salt templates is reported. Low cost citrazinic acid (2,6-dihydroxy-4-pyridinecarboxylic acid) and melamine are used as components to form a microporous, amorphous framework, where edges of the covalent frameworks are tightly terminated with nitrogen and oxygen moieties. ZnCl 2 as the porogen stabilizes structural microporosity as well as nitrogen and oxygen heteroatoms up to comparably high condensation temperatures of 750 and 950 (cid:1) C. The speci ﬁ c surface area up to 1265 m 2 g (cid:3) 1 is mainly caused by micropores and typical of heteroatom-rich carbon materials with such structural porosity. The unusually high heteroatom content reveals that the edges and pores of the covalent structures are tightly lined with heteroatoms, while C – C or C – H bonds are expected to have a minor contribution as compared to typical carbon materials without or with minor content of heteroatoms. Adsorption of water vapor and carbon dioxide are exemplarily chosen to illustrate the impact of this heteroatom functionalization under salt-templating conditions on the adsorption properties of the materials. 27.10 mmol g (cid:3) 1 of H 2 O uptake (at p / p 0 ¼ 0.9) can be achieved, which also proves the very hydrophilic character of the pore walls, while the maximum CO 2 uptake (at 273 K) is 5.3 mmol g (cid:3) 1 . At the same time the CO 2 /N 2 adsorption selectivity at 273 K can reach values of up to 60. All these values are beyond those of ordinary high surface area carbons, also di ﬀ er from those of N-doped carbons, and are much closer to those of organized framework species, such as C 2 N.


Introduction
Porous carbons are crucial in many applications of modern science and industry such as water and air purication, catalysis, gas separation, and energy storage/conversion due to their high chemical and thermal stability, and in particular due to the possible combination of electronic conductivity with high specic surface area. [1][2][3][4][5][6] All of these applications are related to adsorption processes, and precise control over the origin and strength of interaction between carbon and the surrounding phase mixtures is needed. This is of particular importance when high selectivity between a target molecule and the medium is desired. 7,8 Different templating methods towards such materials have been developed to achieve a certain control over the pore architecture and pore surface chemistry, and by that over the strength of adsorption of a given uid. 9,10 In salt-templating, a temperature-stable ionic compound is present during carbonization. This templating approach is one strategy for the introduction of porosity. [11][12][13] It is particularly attractive as it only demands abundant and potentially reusable, simple inorganic salts as pore-forming agents. No amphiphilic molecules or nanostructured inorganic materials are required and the salts can be removed by simply washing with water or by evaporation during carbonization. 14 In addition, ZnCl 2 can also catalyze reactions between molecular carbon precursors, which can decrease the necessary temperature to induce condensation. 15,16 Carbon materials with well-dened porosity can be produced by this method and the pore structure can be controlled by changing the amount, type, and mixture of salt template used, using mixtures of salts, varying the salt content, or by changing the carbon precursor. 17,18 Control over pore structure is meanwhile rather elaborated, while the second key property of carbon materials in adsorption processes, chemical surface functionality, is still difficult to access. This is mostly due to the involved high temperature processes and/or consecutive etching steps ("activation") to increase porosity which however removes functionality. The only effective tool le is the doping of carbon materials with heteroatoms such as nitrogen and oxygen by appropriate choice of precursors. Such doping can signicantly change the polarizability and can even lead to adsorption properties which are rather typical of inorganic materials such as metal-organic frameworks or zeolites. [19][20][21][22][23][24][25] Increased polarizability, but also more specic interactions such as acid-base character or hydrogen-bridge donor/acceptor sites increase the binding energy between pore walls and a given adsorbate. In consequence, high isosteric heats of adsorption of more than 50 kJ mol À1 are oen observed in carbon dioxide or water adsorption on such heteroatom-doped carbons. 19,[26][27][28][29] Physical adsorption, i.e. van der Waals binding between adsorbents and adsorbates, is proportional to the increase of polarizability of the two partners, i.e. stronger binding of all molecules can be expected when moving to a more polar carbon, but not higher selectivity. For that reason, optimization of physisorption is restricted, as optimization of polarizability does not sufficiently increase the interactions to handle the exciting binding and separation problemsespecially when the entropy contributions to the free energy of adsorption are considered which are becoming more inuential at higher temperatures. Values of 50 kJ mol À1 or more imply that there is indeed a signicant contribution of chemical interaction (i.e., chemisorption) in the process, and this part is different for different target molecules. To maximize this difference for a given problem, a dened atomic construction of the pore surface is needed. 28 From this it can be concluded that the potential of heteroatom-doped carbon materials can only be fully utilized in a given application when the surface chemistry and the pore structure can both be adjusted. The former can be achieved by using molecular precursors for carbon synthesis which already contain heteroatoms in a desired specic bonding motive and can undergo controlled condensation towards an extended structure with dened atomic construction. 30 Considering the possible scalability of this approach, precursor molecules should be abundantly available and free of complicated chemical synthesis procedures. Regarding introduction of functionality on top of porosity in such heteroatom-doped carbons, salttemplating is an attractive method as well. Interaction with the salt phase locates interactive and the later pore surface, and the interaction energy with the salt phase (mostly the chosen metal ions) stabilizes them against thermal decomposition. This is why indeed salt-templated materials show a systematically higher heteroatom content than similar products made with classical templates. [31][32][33] Choosing precursors in a rational fashion, pore size and pore functionality can be controlled by "edge termination", i.e. we not only provide a meaningful, directed condensation chemistry, but at the same time oxygen and nitrogen functionalities terminating the growth at the edge of the as formed 1d-or 2d structures can be provided. 34 Most of the edges will show up as pore surface in the nal covalent material, while only a minority fraction is buried within the covalent walls of the porous system. The efficiency of this process is again controlled by the interaction with the salt phase.
In this contribution, we illustrate the feasibility of these concepts by the synthesis of supermicroporous covalent, sp 2conjugated materials with high heteroatom content from a mixture of citrazinic acid and melamine in which heteroatoms are already bonded in specic motives. ZnCl 2 is used as a potentially reusable salt template. By controlling the removal procedure of the salt-template and the condensation temperature, the role of salts in the formation of porosity and as coordination sites for the stabilization of heteroatoms is proven. A high amount of nitrogen of up to 20 wt%, oxygen contents of up to 19 wt%, and a high CO 2 /N 2 selectivity with maximum CO 2 uptake at 273 K of 5.31 mmol g À1 is achieved. The presented materials represent by the applied synthesis tools a new class of heteroatom-lined carbons with extended performance, while of course heteroatom contents of the order of the carbon content forbid the notation "doping" and indicate the presence of a new type of heterogeneous sorption material.

Experimental section
2.1 Synthesis of materials 2.1.1 Pre-condensation of citrazinic acid. 4 g of citrazinic acid (2,6-dihydroxy-4-pyridinecarboxylic acid) was placed on a crucible porcelain plate and annealed in air for 1 h at 350 C. A yellowish solid was formed by the evaporated condensation products during the heat treatment with the typical appearance of carbon nitrides and a dark-brown or black oligomer was obtained in a yield of about 30%. This resulting powder was well ground in a mortar.
2.1.2 Synthesis of nitrogen-and oxygen-lined carbons (NOC-X). ZnCl 2 was employed as the salt template for the synthesis of NOC-Xs. In a typical procedure, 12.44 g ZnCl 2 and 0.315 g melamine were physically well mixed with 1.24 g of the citrazine condensate to form a dark grey colored powder. The mixture was then treated in a quartz ask with an electric heating mantle at 350 C or 550 C for 3 h. Resulting samples are named as NOC-350 and NOC-550, respectively. A portion of NOC-550 was further condensed at higher temperatures ("X" ¼ 750 C and 950 C), for 3 h under N 2 gas ow with 5 C min À1 heating rate in a horizontal tubular furnace. Resulting materials are named as NOC-750 and NOC-950, respectively. Possible remaining ZnCl 2 was removed with 1 M HCl aqueous solution overnight under vigorous stirring followed by ltration and washing with a large amount of deionized water. Aer the HClwashing and ltering process has been carried out for two times, the resulting black powder was dried at 80 C overnight in air. For the preparation of reference samples without precondensation, the same method was applied but 3.27 g of citrazinic acid was directly used as the precursor.
2.1.3 Synthesis of nitrogen-and oxygen-lined carbons without salt as the pore stabilizer (NOC-X-Y). NOC-X-Y materials as a reference group have been prepared by the same method as NOC-Xs with the only difference that an additional heat treatment process was applied aer washing. That is, aer the rst heat treatment at a rather low temperature (X ¼ 350 C or 550 C), the salt was removed using the same washing process as described above for NOC-X. The additional heat treatment was performed under the same conditions as for NOC-X at a maximum temperature (Y ¼ 550 C, 750 C, or 950 C).

Characterization of materials and adsorption experiments
Prior to all physisorption measurements, the samples were outgassed under vacuum at 150 C overnight. Argon physisorption measurements were measured at 87 K by using 10-20 mg of each sample on a Quantachrome Autosorb IQ instrument. Nitrogen, carbon dioxide, and water vapor physisorption measurements were carried out with 40-50 mg of sample on the same instrument. The specic surface areas (SSAs) were calculated using the Brunauer-Emmett-Teller (BET) equation (p/p 0 ¼ 0.005-0.05) and the total pore volumes were determined at p/p 0 ¼ 0.95. The pore size distributions were calculated with the quenched solid density functional theory (QSDFT) for argon adsorbed on carbon with cylindrical/spherical pore shape (adsorption branch kernel) at 87 K implemented into the ASiQwin 3.0 analysis soware. For comparison, PSDs were calculated from the same raw data with the QSDFT method for argon adsorbed on carbon with a slit-like pore shape at 87 K (equilibrium model). Micropore volumes below 2 nm given in Table 1 were determined from the cumulative pore volume at 2 nm from argon physisorption. Water vapor physisorption was measured at 298 K.
The adsorption selectivity of CO 2 over N 2 was determined based on the adsorption isotherms measured at 273 K and 298 K according to the ideal adsorption solution theory (IAST) method 35 assuming a N 2 /CO 2 ratio of 90/10 with the following equation: where X and Y represent the molar ratio of the adsorbed phase in materials and the molar ratio of the gas, respectively. Thermal response measurements were carried out by using an optical calorimeter (InfraSORP Technology by Fraunhofer/ Rubotherm). For the adsorption and desorption cycling measurements for CO 2 physisorption at 298 K, the materials ($10 mg) were placed in the sample cell, followed by purging with N 2 gas (72 ml min À1 , 1 bar) until the temperature stabilized. Then, the sample was subjected to the CO 2 test gas (80 ml min À1 , 1 bar) for 200 s. Subsequently, the sample was subjected to a N 2 gas ow for a duration of 200 s, resulting in the decrease of temperature due to desorption of the test gas. The total uptake of samples was obtained from the integrated peak area (A) of the thermal response curve. This area was divided by the sample mass and total pore volume from Ar physisorption to compare the normalized uptake of the materials.
Powder X-ray diffraction (XRD) patterns were obtained by using a Bruker D8 Advance diffractometer equipped with a scintillation counter detector (Cu K a , l ¼ 0.15184 nm) applying a 2q step size of 0.04 and counting time of 1 s per step. Table 1 EA, Ar physisorption at 87 K (specific surface area, pore volume, micropore volume), and CO 2 /N 2 selectivity at 273 K data as well as yield of the NOC-X and NOC-X-Y materials Elemental analysis (EA) for C, H, and N was accomplished by combustion analysis using a Vario Micro device. Electron microscopy images were obtained on a JEOL ARM 200F at 80 kV for transmission electron microscopy (TEM) and a LEO 1550-Gemini SEM operating at 3.00 kV for scanning electron microscopy (SEM). Thermogravimetric analysis (TGA) measurements were carried out under synthetic air ow using a TG 209 F1 Libra (Netzsch, Germany) at a heating rate of 10 C min À1 from room temperature to 1000 C. Raman spectra were measured using a Witec (focus innovations) Raman microscope operating with an objective (10Â/ 0.25, N/-WD 6.1) and an excitation wavelength of 532 nm with a laser power of 3.5 mW. Fourier-transform infrared spectroscopy (FT-IR) was conducted using a Nicolet iS5 FT-IR spectrometer (ThermoFischer Scientic).
X-ray photoelectron spectroscopy (XPS) was performed on a Thermo Scientic K-Alpha spectrometer equipped with a monochromatic Al K a anode (hn ¼ 1486.6 eV) operating at 72 W. Elemental compositions were determined using a survey recorded with a step size of 1.0 eV and a pass energy of 200 eV. The background pressure of the ultra-high vacuum (UHV) chamber was <2 Â 10 À8 mbar. Quantitative characterization of the presence of carbon, nitrogen, and oxygen was accomplished with high-resolution regional XPS scans with a step size of 0.1 eV and a pass energy of 50 eV. Samples were handled in air without further precautions and mounted on conductive carbon tape. Binding energies are reported as measured without further calibration.

Results and discussion
Abundant and low cost citrazinic acid was at rst heated to 350 C for partial condensation. The color changed from yellow to black and elemental analysis showed that the condensate was composed of 16.0 wt% nitrogen, 55.7 wt% carbon, and 2.2 wt% hydrogen. The corresponding oxygen content of 26.0 wt% (calculated by assuming oxygen as the only element present in addition to C, N, and H) and the atomic C/N ratio of $4 are indeed lower than in citrazinic acid showing that larger condensate structures can be formed by this preheating. Aer reaction with melamine as the cross-linker and an additional nitrogen source in molten ZnCl 2 at 350 C or 550 C, the materials were heated to 550 C, 750 C, and 950 C (Scheme 1) to prepare the covalent, disordered frameworks with abundant oxygen-and nitrogen-lined edges by controlled condensation of these precursors. When citrazinic acid is used without the preheating step and without melamine, the nal products are still porous but have lower nitrogen content and a higher C/N ratio (Table S1 †). Addition of melamine to the uncondensed citrazinic acid leads to a product with even lower heteratom content and porosity (Table S1 †). FT-IR measurements further show apparent differences between citrazinic acid and the product of pre-condensation (Fig. S1 †). The main peaks of citrazinic acid 36 in the range of 1690-1640 cm À1 and 1290-1190 cm À1 almost disappeared aer pre-condensation.
Elemental analysis (EA) of the obtained samples (Table 1) is a rst simple, but very powerful tool to follow the condensation chemistry. Very importantly, EA of such heteroatom rich porous carbon materials always has to be analyzed considering the possibility of contribution to oxygen and nitrogen content from water adsorbed by the samples from air and possible contributions from other species present in such pore-conned water. In order to decouple the oxygen from physically adsorbed water, oxygen contents have to be discussed in relation to the thermogravimetric analysis (TGA) data of all samples (Fig. 1a). In all samples, but especially in the high surface area materials NOC-750 and NOC-950, a distinct mass loss occurs around 100 C. This indicates that a high amount of water and/or gases from air is physically adsorbed in the pores of the materials under ambient conditions which has to be subtracted from the oxygen content from EA to determine the amount of oxygen that is covalently bonded in the framework. In the case of NOC-750, nearly 30% of mass loss takes place due to this reversible evaporation of adsorbates, which is in good agreement with the water vapor physisorption data discussed later. As the 350 C sample is not porous, we consider it as a reference to monitor the condensation chemistry. The nitrogen content in the NOC-350 sample is higher and the oxygen content is slightly lower than in the preheated citrazinic acid, indicating the ongoing condensation with melamine. The NOC-550 sample is already structurally porous, so that we can understand this sample as the rst fully condensed species with heteroatom-lined pores to discuss. The nitrogen content of 18 wt% is still very high and 10 wt% of oxygen remains covalently bonded. Heating these samples further in the presence of a salt leads to a decrease of the nitrogen content in a way typical of C 3 N 4 (at 600 C) or C 2 N (at 800 C), the oxygen stays in the sample and thereby gets relatively enriched. The NOC-750 and NOC-950 samples then have a fully developed pore system with an SSA of about 1200 m 2 g À1 . Summing the heteroatom content of both species we come up with $23 wt% and $18 wt%, respectively. These are unusually high heteroatom contents well beyond the typical "doping" exercises.
To gure out the role of ZnCl 2 in generating and stabilizing the micropore functionality, salts were removed using HCl solution immediately aer rst heating at a rather lower temperature, and then the salt-free samples were heated again. The samples lose both surface area as well as the highheteroatom functionality and turn into "ordinary" heteroatom doped carbons. Obviously, the presence of Zn ions stabilizes the oxygen at the pore surfaces, while heating the former frameworks without ZnCl 2 results in pore collapse. The nal yield decreases independent of the presence or absence of the salt template at high temperature (Table 1).
TGA in synthetic air shows that all materials are remarkably stable against oxidation using articial air and decomposition, well above 500 C (Fig. 1a). This is the typical behavior of a "noble" organic compound and secures applicability, 28 say in catalysis or for swing sorption, even at elevated temperatures. The mass of all samples stabilizes at round 700 C without signicant change upon further heating. Minor residual masses of $10% ash content or below are measured for some samples indicating the nearly complete removal of ZnCl 2 . The presence of traces of inorganic residuals cannot be ruled out from these measurements and can be quantied by X-ray photoelectron spectroscopy (XPS) as discussed below.
XPS is a useful tool to investigate the bonding characteristics of the different elements present at the surface of the materials (Table S2, Fig. 2a and b, and S2-S4 †). 27,37 The residual Zn content is approximately 0.2 at%, and less than 1.5 at% of elements other than C, N, and O (mainly halogens) have been detected on the surface of the samples (Table S2 †). The peaks in the C 1s spectra at lower binding energy around 285.4 eV and at higher binding energy around 286.1 eV can be assigned to electron-rich and to electron-poor carbon atoms, respectively. 38,39 In agreement with the EA, the content of non-carbon elements decreases with temperature and it can be seen that the carbon materials condensed at low temperature such as NOC-350 or NOC-550 have a relatively higher content of electronpoor carbon arising from bonds with more electronegative nitrogen or oxygen (Fig. S2 †). In comparison, the materials treated at higher temperatures have a larger C 1s peak at lower binding energy. In the tted N 1s spectra, it can be seen that the nitrogen content decreases with increasing condensation temperature ( Fig. S3 and Table S2 †). With the exception of NOC-350 with apparently higher concentration of nitrogen on the external surface, the overall nitrogen content and C/N ratio are comparable to the EA results. Except NOC-550-950, all samples show a dominant peak for electron-rich nitrogen around 398.4 eV. Such electron-rich nitrogen atoms are typically bonded to carbon as amine groups or in pyrazinic/pyridinic structure motives. 24 Notably, although the nitrogen contents in NOC-550-950 and NOC-950 are comparable, it appears that the latter has a relatively higher content of electron-rich nitrogen. In contrast, the majority of nitrogen present in NOC-550-950 is bonded as electron-poor (quaternary graphitic) nitrogen, as is well known for nitrogen-doped carbon materials prepared at higher temperatures. 24 This supports our assumption that the Zn template can stabilize pyrazines and pyridinic  sites, i.e. edge nitrogen functionalities at higher temperatures. In contrast to elemental analysis, the oxygen contents in the materials can be more directly determined from the XPS spectra as only the oxygen and oxygen-containing compounds strongly bonded to the material surface (i.e., covalently bonded to the material or bonded with the most strongly attached water molecules) are present during the measurements (Fig. S4 †). The oxygen contents determined from XPS follow the same trends as those from EA but are in general slightly lower in absolute number. One possible reason could be that oxygen-containing species and functional groups are less concentrated on the external surface. However, especially the more signicantly lower oxygen content of the partially condensed NOC-350 could relate to the ongoing condensation of the materials under the Xray beam exposure and high vacuum XPS conditions. Similar to the case of nitrogen, the oxygen atoms become more electron decient at higher condensation temperature, i.e., the binding energies in average shi to higher values. For NOC-X-Ys, the oxygen content continuously decreases with increasing the condensation temperature. In contrast, the NOC-Xs maintain a constant oxygen content which even gets relatively enriched at high temperature.
X-ray diffraction (XRD) patterns show a broad peak with low intensity in the 2q range of 25-30 for all materials representing the (002) plane of graphitic carbon stacking as it is typical for highly porous carbon materials without signicant long-range ordering (Fig. 1b). The absence of other peaks in all samples indicates that no major crystalline inorganic residuals remained independent of the method of removal of ZnCl 2 , which is in line with the XPS and TGA results (Table S2 † and Fig. 1a). Raman spectroscopy measurements ( Fig. 1c and S5 †) of the NOC samples show the typical spectra of disordered carbon nanomaterials dominated by the disordered (D-band) peak at 1360 cm À1 and the graphite-like band (G-band) at 1600 cm À1 . The D-band arises from the breathing mode of sp 2 carbon atoms in aromatic rings at corners and edges while the G-band is caused by any sp 2 carbon atoms organized in chains or rings. Unlike as for pristine carbons, the degree of graphitization or disorder cannot be simply estimated by the ratio of I D /I G as heteroatoms bonded to carbon cause dissymmetry of vibrations between the bonds. 40,41 However, all of them show the appearance that is typical of disordered carbon-based materials. NOC-X materials have sharper and more separated D-and G-bands at higher temperatures, which do, in such a case, not necessarily originate from increased "carbon ordering" but rather from the dominance of carbon-carbon bonds at high temperature.
In accordance with Raman spectroscopy, high-resolution transmission electron microscopy (HRTEM) analysis of the NOC-X materials (Fig. 2c and d and S6 †) shows a random arrangement of carbon fringes as it is typical of porous carbon materials independent of the synthesis temperature. EDX elemental mapping, which has been exemplarily performed for NOC-350 and NOC-550, shows a homogeneous distribution of carbon, nitrogen and oxygen throughout both samples without any obvious zoning or gradients in the distribution of these elements (Fig. S7 †). SEM images show that all materials contain additional macropores and have a generally comparable morphology (Fig. S8 †). Neither the synthesis temperature nor the presence or absence of ZnCl 2 at high temperatures has a major inuence on the macrostructure of the materials, for which the large amount of ZnCl 2 that was used during the initial condensation seems to be the most important.
Ar (87 K) physisorption isotherms ( Fig. 3a and Table 1) of NOC-Xs and NOC-X-Ys exhibit the shape of type I a according to the IUPAC classication 42 with a high gas uptake at low relative pressure. For similar reasons to those of zeolites, Ar physisorption is more appropriate to analyze microporous carbons with high content of heteroatoms compared to N 2 physisorption (Fig. S9 †). 43 N 2 with slightly larger kinetic diameter and higher quadrupole moment can have limitations to access the smallest micropores in the materials, and specic interactions with the polar sites on the energetically heterogeneous surface can cause underestimation of pore sizes. Only samples NOC-350 and NOC-350-550 show no signicant porosity that is detectable with Ar physisorption. As condensation temperature increases, the porosity of NOC-X materials becomes more developed and thus the pore volume detectable with argon increases up to 0.60 cm 2 g À1 for NOC-950. Pore size distributions have been calculated with two different DFT models. The trends in pore sizes and pore volumes are similar for assumption of mixed spherical and cylindrical pores from the adsorption branch and when the equilibrium model for slit-shaped pores is used (Table 1, Fig. 3 and S10 †). The pore size increases from the mainly microporous NOC-550 to NOC-750 and NOC-950 wherein a signicant volume of porosity is present in the form of small mesopores (Fig. 3b and c). In contrast, the specic surface area and the View Article Online pore volume decrease from NOC-550 to NOC-550-750 and decrease even further to NOC-550-950. Materials with signicantly lower pore volume and smaller pores below 1.5 nm in size are obtained when ZnCl 2 is removed in advance. As expected, ZnCl 2 plays a major role in the stabilization of microporesespecially at high temperatures before it decomposes and evaporates. CO 2 (273 K) physisorption measurements (Fig. 4a) show that NOC-350 and NOC-350-550 have a total CO 2 uptake of 1.38 mmol g À1 and 2.72 mmol g À1 , respectively, although both samples have no porosity that is detectable with Ar physisorption. Apparently, the pores in both materials are large enough to adsorb CO 2 , but too small to be accessible for Ar. NOC-750 and NOC-950 with larger pores have a total CO 2 uptake of 5.3 mmol g À1 and 5.0 mmol g À1 , respectively, which is remarkably high and comparable to or higher than in many of the known nitrogen-doped carbons prepared from more sophisticated precursors. 24,27,29 NOC-550 and NOC-350-550 show a more convex shape of the CO 2 physisorption isotherms at low pressure (<0.1 bar) where the effect of heteroatom doping leading to specic interactions between carbon dioxide molecules and pore walls is more apparent (Fig. 4a and S11 †). Polarizable CO 2 molecules can specically interact with functional groups or heteroatoms and in combination with size exclusion of larger molecules, this can improve the adsorption selectivity of materials. 44,45 The higher uptake of NOC-550 and NOC-350-550 at low pressure is in line with their high nitrogen and oxygen content and low porosity in Ar physisorption (Table  1 and S2 †).
Thermal response measurements with CO 2 as the test gas were carried out with the InfraSORP technology which provides further information about pore structures as well as CO 2 adsorption capacities and kinetics (Fig. 4b). 46 It is obvious from the distinct temperature increase that all the samples have high affinity to CO 2 as signicant heat release takes place during adsorption. Areas and shapes of the thermal response peaks are nearly similar during adsorption and desorption. This conrms the full reversibility of CO 2 adsorption in all samples by simple pressure swing due to purging with nitrogen. When the peak areas of the thermal responses are normalized by the sample masses and the total pore volumes derived from Ar physisorption, NOC-550 and NOC-550-750 have signicantly higher areas compared to the materials condensed at the higher temperature, indicating higher heat of adsorption of CO 2 for these materials (Fig. 4c). In other words, NOC-550 and NOC-550-750 release higher amount of heat during the adsorption of CO 2 per pore volume due to the small micropores with high heteroatom content in which the heat of adsorption and desorption is dominated by adsorbent-adsorbate interactions instead of adsorbate-adsorbate interactions which are dominant in larger pores with less heteroatoms in the pore walls. 47 Analysis of the IAST CO 2 /N 2 selectivities of the NOC-X samples shows that NOC-550 has the highest selectivity (60.1) among all samples except NOC-350, which reaches a value of 130.1 due to the stronger contribution of molecular sieving, that is, size exclusion of N 2 with a slightly larger kinetic diameter than CO 2 by the small pores. The CO 2 selectivity of NOC-750 (30.3) and NOC-950 (31.5) is signicantly lower despite their high total uptake of CO 2 over 5.0 mmol g À1 at 1 bar. This supports the general observation that materials with high specic surface area usually do not achieve a high selectivity in CO 2 adsorption due to the signicant contribution of the nondiscriminative surface. 29,48 In contrast, the NOC-X-Y samples maintain a relatively high selectivity around 50, regardless of the condensation temperature. As the selectivity is determined by the pore size which has to be small enough to kinetically accept CO 2 molecules (3.30Å; kinetic diameter) but not N 2 molecules (3.64Å) and the content of nitrogen inside, 48 CO 2 can selectively be adsorbed in the samples with the highest ratio of micropore volume over total pore volume such as NOC-550, NOC-550-750, and NOC-550-950. Further analysis shows that there is a proportional relationship between the ratio of micropore volume and the CO 2 /N 2 selectivity (Table 1 and Fig. S12 †). From the combination of these geometrical considerations and the elemental compositions of the materials it can be seen that the presence or absence of the salt template can be used as a "regulation screw" to adjust these properties within a certain window and thus the properties of the materials in adsorption-related applications such as selective removal of CO 2 from N 2 or CO 2 storage. This is of particular importance in a practically relevant case such as the one discussed here, where a sustainable templating method is combined with abundantly available precursors the condensation of which yields highly heteroatom-rich carbon materials. CO 2 physisorption was Fig. 4 (a) Carbon dioxide physisorption isotherms at 273 K, (b) CO 2 thermal response adsorption and desorption measurements at 1 bar and 25 C, and (c) integrated adsorption and desorption (left bar and right bar, respectively) temperature peak area normalized by the mass and the total pore volume from Ar physisorption of NOC-Xs and NOC-X-Ys.
additionally measured for NOC-550 and NOC-750 at 298 K (Fig. S13 †). Just like at 273 K, NOC-550 has a higher CO 2 /N 2 selectivity of 81 in comparison to NOC-750 which has a selectivity of 35. Stronger binding of CO 2 is also expressed by the higher isosteric heat of adsorption at a CO 2 uptake of 1 mmol g À1 , which is $40 kJ mol À1 for NOC-550 but only $27 kJ mol À1 for NOC-750 with larger pores and lower heteroatom content.
H 2 O vapor physisorption isotherms (Fig. 5a) are of type I for all samples with small micropores. NOC-750 and NOC-950 have larger pores and a less polar surface allowing for phase transitions of water molecules during adsorption thus resulting in a hysteresis loop that is typical of microporous carbon materials. Most NOC-Xs and NOC-X-Ys show high water adsorption capability. For example, the high H 2 O uptake of NOC-750 at p/p 0 ¼ 0.9 (27.10 mmol g À1 ) corresponds to $32 wt%. These uptakes are in good agreement with the mass loss due to water desorption observed by TGA around 100 C (Fig. 1a). Taking the water loss in TGA at 100 C as a measure, the water adsorption capacities of NOC-750 and NOC-950 both correspond to a relative humidity of $35% that was exposed to the samples before they were subjected to TGA. Considering the pore volume of NOC-550 (0.2 cm 3 g À1 from Ar physisorption), the H 2 O uptake of 7.14 mmol g À1 at a relatively low relative humidity of 20% (corresponding to p/p 0 ¼ 0.2 or $6000 ppm water) is remarkable. Under these conditions, adsorption of water is dominated by adsorbent-adsorbate interactions and the uptake corresponds to a density of 22-23 water molecules per nm 3 . Such a dense packing of water molecules in carbon-based materials has previously been reported for materials from synthetic molecular precursors and/or with more difficult templating procedures. 49 The nitrogen-and oxygen-lined pore walls support the binding of water molecules at low pressure by the formation of hydrogen bonding networks whereas the micropores allow for high water uptakes close to 100% humidity.
To further investigate the affinity between water and pore walls of the carbons, the relationship between heteroatom content and the normalized uptake of water at p/p 0 ¼ 0.2 is plotted (Fig. 5b and c). The higher normalized uptake at p/p 0 ¼ 0.2 shows strong affinity toward H 2 O at low relative humidity. Both NOC-Xs and NOC-X-Ys series show a trend of increasing normalized uptake as the heteroatom content or the N content from EA (Fig. S14 †) increases, which also has been shown in previous studies. 27,50 NOC-Xs, which have larger pores in comparison to NOC-X-Y, however, have overall a lower water uptake than NOC-X-Y, indicating a higher affinity to water for materials with smaller pores due to similar reasons as discussed above for carbon dioxide. NOC-X samples with larger pores have a notable but less pronounced relationship between water adsorption capacity and heteroatom content.

Summary and conclusions
A novel synthesis pathway towards heteroatom-rich nanoporous carbon materials with high specic surface area and pore volume by using economically practical citrazinic acid and melamine as precursors and ZnCl 2 as the salt template has been reported. It has been shown that the presence or absence of a salt template is a possible regulation screw to tailor the pore structure and atomic construction of the materials during heat treatment. Especially, the bonding type of nitrogen and the oxygen content are signicantly inuenced by the salt template due to coordinative stabilization. By measuring Ar, CO 2 , and H 2 O physisorption, it has been shown that the presence of Zn at high temperature stabilizes the micropores and heteroatoms in the carbon material, thus contributing to higher total uptake in the adsorption of gases. At the same time, however, the CO 2 /N 2 selectivity decreases due to the formation of larger micropores. With a very simple parameter, namely, removal of the salt template, the heteroatom content, pore volume, or pore sizes can be controlled. Citrazinic acid, melamine, and ZnCl 2 have been chosen as synthetic case examples here along with CO 2 and H 2 O vapor adsorption to show the relationships between the synthesis, structure and properties. The general principles, however, will likely also be applicable for other precursor molecules, other heteroatoms, other salt-templates, and other applications related to adsorption processes on carbon surfaces. For the system investigated in this work, more precise control and more detailed knowledge about the condensation product of citrazinic acid would be necessary to realize a more controlled condensation and possibly the synthesis of ordered porous networks. This will be part of our future work.