  We investigate the holographic superconductors immersed in an external
magnetic field by using the analytical approach. We obtain the spatially
dependent condensate solutions in the presence of the magnetism and find
analytically that the upper critical magnetic field satisfies the relation
given in the Ginzburg-Landau theory. We observe analytically the reminiscent of
the Meissner effect where the magnetic field expels the condensate. Extending
to the D-dimensional Gauss-Bonnet AdS black holes, we examine the influence
given by the Gauss-Bonnet coupling on the condensation. Different from the
positive coupling, we find that the negative Gauss-Bonnet coupling enhances the
condensation when the external magnetism is not strong enough.
