Considering the density wave of scalar and pseudoscalar condensates, we study the response of quark matter to a weak external magnetic field. In an external magnetic field, the energy spectrum of the lowest Landau level becomes asymmetric about zero, which is closely related to chiral anomaly. This spectral asymmetry gives rise to spontaneous magnetization. This mechanism may be one of candidates for the origin of the strong magnetic field in magnetars. Furthermore, using the generalized Ginzburg-Landau(gGL) expansion, we show that magnetic susceptibility exhibits a peculiar feature