Measurements of jet substructure describing the composition of quark- and gluon-initiated jets are presented. Proton-proton (pp) collision data at sqrt(s)=13 TeV collected with the CMS detector are used, corresponding to an integrated luminosity of 35.9/fb. Generalized angularities are measured that characterize the jet substructure and distinguish quark- and gluon-initiated jets. These observables are sensitive to the distributions of transverse momenta and angular distances within a jet. The analysis is performed using a data sample of dijet events enriched in gluon-initiated jets, and, for the first time, a Z+jet event sample enriched in quark-initiated jets. The observables are measured in bins of jet transverse momentum, and as a function of the jet radius parameter. Each measurement is repeated applying a "soft drop" grooming procedure that removes soft and large angle radiation from the jet.For easier navigation, figures are named with a code with each letter/number representing in the following order: ungroomed/groomed, AK4/AK8, charged, multiplicity/pTD2/thrust/width/LHA, [central dijet/forward dijet/Z+jet, PT].