We introduce a particular version of the Riemann-Roch formula in Arakelov geometry, valid for sheaves of cusp forms on suitable modular curves, equipped with their natural Petersson metrics. We show some consequences of the formula. For instance, combined with the Jacquet-Langlands correspondence, it leads to a comparison of arithmetic self-intersection numbers studied by Kudla-Rapoport-Yang and Maillot-Rossler (compact Shimura curve case) and Bost and Kuhn (modular curve case).