Text this: A General Maximum Entropy Framework for Thermodynamic Variational Principles.