Single-particle electroproduction and photoproduction at large transverse momentum