The controlled patterning of nanomaterials presents a major challenge to the field of nanolithography because of differences in size, shape and solubility of these materials. Matrix-assisted dip-pen nanolithography and polymer pen lithography provide a solution to this problem by utilizing a polymeric matrix that encapsulates the nanomaterials and delivers them to surfaces with precise control of feature size.