## 1 Introduction  
Owing to the global energy crisis, the demand for higher energy and power storage equipment is increasing [1; 2; 3]. Supercapacitors, an electrochemical capacitor, have a long cycle life, high-power density, high charge/discharge rate and good safety [4]. These devices show great potential for efficient energy storage [5] and for use in electric vehicles, batteries, and wind power. According to the charge storage mechanism of the electrode, supercapacitors can be classified as either electric double-layer capacitors (EDLCs) or pseudocapacitors. EDLCs exhibit a non-faradic reaction as charges accumulate at the electrolyte interface and electrode, whereas pseudocapacitors show faradic redox reactions [6; 7]. The electrode is one of the most important parts of a supercapacitor, and it is important for an ideal electrode material to have a suitable porous structure and an ion-contactable specific surface area [8]. Furthermore, there is also a trend towards using renewable biomass for electrodes [9; 10]. In particular, recent findings have revealed that the engineering of carbon materials by doping nitrogen (N) is an efficient method of improving specific capacitance performance because the nitrogen-containing functional group can undergo a Faraday reaction and improve the wettability of the pore walls, and nitrogen doping could increase the conductivity of carbon material [11; 12; 13; 14]. There are two main methods for synthesizing nitrogen-doped carbon materials, in-situ doping and post-treatment. In-situ doping approaches include chemical vapor deposition, arc-discharge methods, and the treatment of porous carbon materials with nitrogenous compounds, for example, amines [15], ammonia [16], bone char [17], or polymelamine [18]. Post-treatments include carbonization with nitrogen-rich compounds [17; 19] and in a nitrogen-donor atmosphere [20]. However, the expensive and complex instruments and toxic precursors may limit their practical application. Thus, the selection of appropriate N sources, the development of environmentally friendly and simple methods to prepare nitrogen-doped carbon aerogels are highly desirable but challenging targets. Aerogels are solid materials obtained by replacing a liquid or gel phase with a gas while leaving the solid network of the gel intact [21; 22; 23; 24; 25]. As a family of 3D network porous materials, aerogels can be produced from biomass such as cotton [26; 27; 28], bagasse [29], bamboo [30], and bacterial cellulose [31]. Due to their large porosity, low density, high specific surface area, and wettability [32], aerogels have been extensively used in gas sensors [33], catalyst supports [34], and adsorbents [35]. Carbon aerogels, obtained by aerogel carbonization, exhibit both the high specific surface area and porosity of aerogels and the electrical conductivity and high chemical stability of the carbon materials, making them an ideal electrode material for supercapacitors [36; 37; 38; 39]. However, the electrochemical performance of unmodified carbon aerogels has been unsatisfactory to date [40]. Rhodamine B (RB), a toxic dye, is extensively used in daily life and industrial manufacture and represents a serious and difficult-to-remedy environmental threat. The chemical structure of RB organic dyes contains a large number of nitrogen atoms [41], making RB a suitable candidate precursor for preparing N-doped carbon materials. Furthermore, taking full advantage of N-rich waste based on RB organic dyes will enable effective resource recycling. In previous papers, cellulose-based aerogels have been shown to absorb a range of organic dyes because they have good wettability and many functional groups on their surface [42]. We removed RB using an alkaline peroxide mechanical pulp (APMP) fiber aerogel as the sorbent and used the aerogel saturated with RB dye to obtained N-doped carbon aerogels for supercapacitors.