A theory is derived for the class of long two-dimensional waves, comprising solitary and periodic cnoidal waves, that can propagate with unchanging form in heterogeneous fluids. The treatment is generalized to the extent that the waves are supposed to arise on a horizontal stream of incompressible fluid whose density and velocity are arbitrary functions of height, and the upper surface of the fluid is allowed either to be free or to be fixed in a horizontal plane. Explicit formulae for the wave properties and a general interpretation of the physical conditions for the occurrence of the waves are achieved without need to specify particular physical models; but in a later part of the paper, §4, the results are applied to three examples that have been worked out by other means and so provide checks on the present theory. These general results are also shown to accord nicely with the principle of ‘conjugate-flow pairs’ which was explained by Benjamin (1962b) with reference to swirling flows along cylindrical ducts, but which is known to apply equally well to flow systems of the kind in question here.The theory reveals certain physical peculiarities of a type of flow model often used in theoretical studies of internal-wave phenomena, being specified so as to make the equation for the stream-function linear. In an appendix, some observations are also made regarding the ‘Boussinesq approximation’, which too is often used as a simplifying assumption in this field. It is shown, adding to a recent discussion by Long (1965), that finite internal waves may depend crucially on small effects neglected in this approximation.