  We suggest an efficient method for generating matter-wave gap solitons in a
repulsive Bose-Einstein condensate, when the gap soliton is formed from a
condensate cloud in a harmonic trap after turning on a one-dimensional optical
lattice. We demonstrate numerically that this approach does not require
preparing the initial atomic wave packet in a specific state corresponding to
the edge of the Brillouin zone of the spectrum, and losses that occur during
the soliton generation process can be suppressed by an appropriate adiabatic
switching of the optical lattice.
