Text this: Analytical mechanics for relativity and quantum mechanics