  This paper begins a new approach to the $r$-trace formula, without removing
the nontempered contribution to the spectral side. We first establish an
invariant trace formula whose discrete spectral terms are weighted by
automorphic $L$-functions. This involves extending the results of Finis, Lapid,
and M\"uller on the continuity of the coarse expansion of Arthur's noninvariant
trace formula to the refined expansion, and then to the invariant trace
formula, while incorporating the use of basic functions at unramified places.
