  We develop Green's function formalism to describe continuous multi-layered
quasi-one-dimensional setups described by piece-wise constant single-particle
Hamiltonians. The Hamiltonians of the individual layers are assumed to be
quadratic polynomials in the momentum operator with matrix-valued
(multichannel) coefficients. This, in particular, allows one to study transport
in heterostructures consisting of multichannel conducting, superconducting, or
insulating components with band structures of arbitrary complexity. We find a
general expression for the single-particle Green's function of the combined
setup in terms of the bulk (translationally invariant) Green's functions of its
constituents. Furthermore, we provide the expression for the global density of
states of the combined system and establish the bound state equation in terms
of bulk Green's functions. We apply our formalism to investigate the spectrum
and current-phase relations in ordinary and topological Josephson junctions,
additionally showing how to account for the effects of static disorder and
local Coulomb interaction.
