Text this: Variational principles of mechanics