Title: A variational proof of the Gauss-Bonnet formula