  Diagrammatic summation is a common bottleneck in modern applications of
projected entangled-pair states, especially in computing low-energy excitations
of a two-dimensional quantum many-body system. To solve this problem, here we
extend the generating function approach for tensor network diagrammatic
summation, a scheme previously proposed in the context of matrix product
states. Taking the form of a one-particle excitation, we show that the excited
state can be computed efficiently in the generating function formalism, which
can further be used in evaluating the dynamical structure factor of the system.
Our benchmark results for the spin-$1/2$ transverse-field Ising model and
Heisenberg model on the square lattice provide a desirable accuracy, showing
good agreement with known results. We then study the spin-$1/2$ $J_1$-$J_2$
model on the same lattice and investigate the dynamical properties of the
putative gapless spin liquid phase. We conclude with a discussion on
generalizations to multi-particle excitations.
