Graphitization of carbons synthesized in a confined geometry