A review is given of the theory of the compression wave generated when a high-speed train enters a tunnel. The train is modeled by a distribution of monopole sources whose interactions with the tunnel portal determine the detailed characteristics of the wave. The waveform can be calculated exactly at subsonic train Mach numbers for a tunnel consisting of an unflanged cylinder of semi-circular cross-section, which has been the subject of extensive experimental study. An analysis of this case reveals how an approximate theory can be developed for arbitrary tunnel portals and train Mach numbers as large as 0.4. Details are given for flanged portals of both semi-circular and rectangular cross-sections. Nonlinear steepening in a very long tunnel is responsible for an intense, environmentally harmful, micro-pressure wave, which propagates as a pulse from the distant tunnel exit when the compression wave arrives, with amplitude proportional to the maximum gradient in the compression wavefront. The analytical theory permits the design of tunnel portals that greatly increase the initial wave thickness (thereby tending to inhibit wave steepening), either by flaring the portal, or by installing a tunnel entrance hood, which allows high pressure air produced by the train to be vented to the environment through windows in the side walls. A formula is given for the ‘optimum’ flared portal, which produces a pressure gradient across the wavefront that is constant and an overall minimum, so that the pressure in the wavefront increases linearly and provides the maximal protection against shock formation. The operation of tunnel entrance hoods is discussed in terms of a continuum model in which an axial section of the tunnel extending inwards from the entrance is perforated with a distribution of small apertures.