How do I customize node.tpl to print an entity reference field in a specific format
I think your information architecture in inverted. It sounds more like Book is in Collection rather than Collection has Book. In other words Collection is an attribute of Book, not the other way around. It would be easier to put the reference field on the Book content type, and create a view of all Book s referencing a Collection to display on the Collection content type, using a Contextual filter to limit the list. No changes required to template files!

Then using the Prepopulate module, you can use the $_REQUEST variable to set your field_book value in the new node, and it is a simple matter to add  the Content:Nid to the view and rewrite the field to create the link.

First, install and activate the Prepopulate module. Then put your Entity Reference field on the Book content type and limit it to the Collection content type. Then add an Entity reference field to the Annotation content type and limit it to Book. In other words, you are identifying the Book the annotation belongs to.

Then create a view of Content (Book) with a display type of Block. In the views configuration, create a Contextual filter on Content: Collection (field_collection) and configure it to Provide default value and select Entity ID from URL.

Add the field Content:NID and configure the field. Select Rewrite results  and check Rewrite the output of this field. In the text box enter something like:

&lt;a href="/node/add/annotation?edit%5Bfield_collection%5D%5Bund%5D%5B0%5D%5Btarget_id%5D=[nid]"&gt;Annotate this book&lt;/a&gt;


(%5B = "[" and %5D = "]"). The actual link code may vary depending on how you have implemented the Entity reference field in your content type. The module has good documentation.

Save your view and under /admin/structure/block find the block created by the view and set it to display only on pages of type Collection.

The block will then display a list of book titles (linked to their content) and the custom link to add an Annotation page with field_book prepopulated, and limited to those books which reference the Collection being viewed.