  It is well-known in the modified gravity scene that the calculation of
junction conditions in certain complicated theories leads to ambiguities and
conflicts between the various formulations. This paper introduces a general
framework to compute junction conditions in any reasonable classical field
theory and analyzes their properties. We prove that in any variational field
theory, it is possible to define unambiguous and mathematically well-defined
junction conditions either by interpreting the Euler-Lagrange differential
equation as a distribution or as the extremals of a variational functional and
these two coincide. We provide an example calculation which highlights why
ambiguities in the existing formalisms have arisen, essentially due to
incorrect usage of distributions. Relations between junction conditions, the
boundary value problem of variational principles and
Gibbons--Hawking--York-like surface terms are examined. The methods presented
herein relies on the use of coordinates adapted to represent the junction
surface as a leaf in a foliation and a technique for reducing the order of
Lagrangians to the lowest possible in the foliation parameter. We expect that
the reduction theorem can generate independent interest from the rest of the
topics considered in the paper.
