Bottom-up processes involving the coupling of molecular precursors enable synthesizing atomically precise, functionalized graphene nanoribbons (GNRs) , with tailored electronic and chemical properties . Despite the variety of studies in the direction of tuning the intrinsic GNR properties, less effort has been devoted on the control of their size and ensemble patterning. Here we show that the combination of chemical functionalization and surface templating can be exploited to obtain different types of self-assembled structures with different GNR length. By growing chevron-type GNRs with different functional groups on Au(111), we tune the balance between the interaction with the surface and the neighbouring GNRs. This leads to either a template-guided periodic assembly of individual GNRs, where the herringbone reconstruction imposes their size and position, or a close-packed 2D domains of long GNRs, when stronger intermolecular interactions drive the assembly (see Fig. 1). The chemical and structural integrity at each step of the on-surface synthesis, namely debromination and cyclodehydrogenation, are tracked by combined X-ray photoelectron spectroscopy (XPS) and scanning tunnelling spectroscopy (STM) measurements. Local scale characterization of the electronic structure, carried out by combining tunnelling spectroscopy and ab-initio calculations, helps to correlate the different interactions with internal charge distributions.
 Grill, L. et al. Nature Nanotechnol. 2, 687 (2007); Cai, J. et al., Nature 466, 470 (2010).
 Chen, Y. et al. ACS Nano 7, 6123 (2013); Son, Y. et al. Nature 444, 347 (2006); Yang, L. et al. Phys. Rev. Lett. 99, 186801 (2007); Ruffieux, P. et al. ACS Nano 6, 6930 (2012).