  We study the fragmentation of (light) quarks and gluons to hadrons inside a
jet of cone size R. This allows for a more exclusive analysis of fragmentation
than is currently the case. The shape of semi-inclusive cross sections in the
hadron energy fraction z is described by fragmenting jet functions (FJFs),
which we calculate in terms of R and the jet energy E. We introduce a new joint
resummation to sum the double logarithms of R and 1-z in the FJFs, which may
similarly be applied to initial-state radiation at hadron colliders. Our
results at next-to-leading logarithmic order indicate that the resummation of
the threshold logarithms of 1-z is already important for z > 0.5 and improves
the convergence of perturbation theory. Our framework may be used to analyze
LHC and RHIC data and to test and tune Monte Carlo event generators.
