We consider electronic transport across one-dimensional heterostructures described by the Dirac equation. We discuss the cases where both the velocity and the mass are position dependent. We show how to generalize the Dirac Hamiltonian in order to obtain a Hermitian problem for spatial dependent velocity. We solve exactly the case where the position dependence of both velocity and mass is linear. In the case of velocity profiles, it is shown that there is no backscattering of Dirac electrons. In the case of the mass profile, backscattering exists. In this case, it is shown that the linear mass profile induces less backscattering than the abrupt step-like profile. Our results are a first step towards the study of similar problems in graphene.