In an example of a method, a halogenide-hydrocarbon, an aprotic hydrocarbon solvent, and a reductant are combined to initiate a reaction that forms intermediate particles having a microporous framework. The intermediate particles are subjected to a heat treatment at a heat treatment temperature ranging from about 300° C. to less than 1500° C. for a heat treatment time period ranging from about 20 minutes to about 10 hours to form a precursor to microporous carbon.