Dimension theory and multifractal analysis via thermodynamic formalism