We consider the theory and application of a solution method for the inverse problem in collisionless equilibria, namely that of calculating a Vlasov–Maxwell equilibrium for a given macroscopic (fluid) equilibrium. Using Jeans’ theorem, the equilibrium distribution functions are expressed as functions of the constants of motion, in the form of a Maxwellian multiplied by an unknown function of the canonical momenta. In this case it is possible to reduce the inverse problem to inverting Weierstrass transforms, which we achieve by using expansions over Hermite polynomials. A sufficient condition on the pressure tensor is found which guarantees the convergence and the boundedness of the candidate solution, when satisfied. This condition is obtained by elementary means, and it is clear how to put it into practice. We also argue that for a given pressure tensor for which our method applies, there always exists a positive distribution function solution for a sufficiently magnetised plasma. Illustrative examples of the use of this method with both force-free and non-force-free macroscopic equilibria are presented, including the full verification of a recently derived distribution function for the force-free Harris sheet (Allanson et al., Phys. Plasmas, vol. 22 (10), 2015, 102116). In the effort to model equilibria with lower values of the plasma ${\it\beta}$, solutions for the same macroscopic equilibrium in a new gauge are calculated, with numerical results presented for ${\it\beta}_{pl}=0.05$.