  Let (X,D) be a projective log pair over the ring of integers of a number
field such that the log canonical line bundle K_(X,D) or its dual -K_(X,D) is
relatively ample. We introduce a canonical height of K_(X,D) (and -K(X,D))
which is finite precisely when the complexifications of K_(X,D) (and -K(X,D))
are K-semistable. When the complexifications are K-polystable, the canonical
height is the height of K_(X,D) (and -K(X,D)) wrt any volume-normalized
K\"ahler-Einstein metric on the complexifications of K_(X,D) (and -K(X,D)) The
canonical height is shown to have a number of useful variational properties.
Moreover, it may be expressed as a limit of periods on the N-fold products of
the complexifications of X, as N tends to infinity. In particular, using this
limit formula, the canonical height for the arithmetic log surfaces (P_1,D)
over the integers, where D has at most three components, is computed explicitly
in terms of the Hurwitz zeta function and its derivative at s=-1. Combining
this explicit formula with previous height formulas for quaternionic Shimura
curves yields a procedure for extracting information about the canonical
integral models of some Shimura curves, such as wild ramification. Furthermore,
explicit formulas for the canonical height of twisted Fermat curves are
obtained, implying explicit Parshin type bounds for the Arakelov metric.
