The generation of attosecond pulses by superposition of high harmonics relies on their synchronization in the emission. Our experiments in the low-order, plateau, and cutoff regions of the spectrum reveal different regimes in the electron dynamics determining the synchronization quality. The shortest pulses are obtained by combining a spectral filtering of harmonics from the end of the plateau and the cutoff, and a far-field spatial filtering that selects a single electron quantum path contribution to the emission. This method applies to isolated pulses as well as pulse trains. DOI: 10.1103/PhysRevLett.93.163901 PACS numbers: 42.65.Ky, 32.80.Wr, 42.65.Re The strongly nonlinear interaction taking place when an intense infrared (IR) laser pulse is focused into a rare gas jet results in the coherent emission of extreme ultraviolet (XUV) light [1] with a characteristic spectrum showing a plateau and a sharp cutoff at high energy [2]. This process offers the unique opportunity of generating attosecond pulses, as recently demonstrated by two techniques. First, starting from a few-cycle laser pulse, the highest energy photons are only emitted at the maximum of the laser envelope. The cutoff is then continuous and by spectrally selecting it, one can obtain a single pulse of 250 as duration [3,4]. Second, using a multicycle IR pulse provides a discrete spectrum containing only odd harmonics of the laser frequency. Selecting many harmonics in the plateau results in emission of XUV bursts every half laser period, forming an attosecond pulse train (APT) whose wagons can be as short as 130 as [5,6]. In both cases, the condition for the production of short pulses is a near-linear spectral phase of the XUV radiation. For a discrete spectrum, this means that harmonics must be phase-locked, i.e., synchronized. The phaselocking of harmonics is closely related to the electronic dynamics in the generation process. In the semiclassical ''three-step'' model [7,8], part of the electron wave packet first tunnels out of the atomic potential lowered by the laser field; it is then driven by the strong IR field in the continuum; finally, it can recombine with the parent ion, emitting a XUV photon whose energy is given by the electron return kinetic energy. The recombination times of the different electron trajectories determine the emission times of the different XUV frequencies, and thus their synchronization.Recent studies have stressed two main sources of asynchronism that raise important questions for the reliable generation of shorter pulses. First, each harmonic is associated to mainly two (''short'' and ''long'') electron trajectories that have the same return energy but very different return times. The single-atom response thus consists of at least two bursts per half laser cycle, which blurs the attosecond structure. Fortunately, the short trajectory contribution can be macroscopically selected by adjusting carefully the phase matching conditions [9]: when the generating laser is focused slightly before the gas jet, the macros...