  We reconsider the density functional theory of nonuniform classical fluids
from the point of view of convex analysis. From the observation that the
logarithm of the grand-partition function $\log \Xi [\phi]$ is a convex
functional of the external potential $\phi$ it is shown that the Kohn-Sham free
energy ${\cal A}[\rho]$ is a convex functional of the density $\rho$. $\log \Xi
[\phi]$ and ${\cal A}[\rho]$ constitute a pair of Legendre transforms and each
of these functionals can therefore be obtained as the solution of a variational
principle. The convexity ensures the unicity of the solution in both cases. The
variational principle which gives $\log \Xi [\phi]$ as the maximum of a
functional of $\rho$ is precisely that considered in the density functional
theory while the dual principle, which gives ${\cal A}[\rho]$ as the maximum of
a functional of $\phi$ seems to be a new result.
