How to deactivate the block merge automatically when the same head is repeating on the top of the page?

HI,

I am using block merge macro <tm;?> to render one of the heads that I have captured in the text register on the top of each page but I do not want to generate when the same type of heads comes on the top of the page.

For example, <h1>Head 1</h1> is the head which I want to render on each of the page but I do not want to render auto generated head that is generating through block merge macro when <h1>Head 1</h1> comes on the top of any page.

Can anybody help me to achieve this without putting <tm;0> manually on the bottom of previous page.

I want to achieve it through programmatically.

Thanks!     

Shahnawaz