Text this: A variational formulation of kinematic wave theory /