Templated self-assembly of block copolymer thin films can generate periodic arrays of microdomains within a sparse template, or complex patterns using 1: 1 templates(1-16). However, arbitrary pattern generation directed by sparse templates remains elusive. Here, we show that an array of carefully spaced and shaped posts, prepared by electron-beam patterning of an inorganic resist, can be used to template complex patterns in a cylindrical-morphology block copolymer. We use two distinct methods: making the post spacing commensurate with the equilibrium periodicity of the polymer, which controls the orientation of the linear features, and making local changes to the shape or distribution of the posts, which direct the formation of bends, junctions and other aperiodic features in specific locations. The first of these methods permits linear patterns to be directed by a sparse template that occupies only a few percent of the area of the final self-assembled pattern, while the second method can be used to selectively and locally template complex linear patterns.