  The dynamics of an initially excited two-level atom in a lossy cavity is
studied by using the quantum trajectory method. Unwanted losses are included,
such as photon absorption and scattering by the cavity mirrors and spontaneous
emission of the atom. Based on the obtained analytical solutions, it is shown
that the shape of the extracted spatiotemporal radiation mode sensitively
depends on the atom-field interaction. In the case of a short-term atom-field
interaction we show how different pulse shapes for the field extracted from the
cavity can be controlled by the interaction time.
