You need to use html`- ${a}\n` or md`- ${a}\n` instead of `- ${a}\n`. It sometimes gets a bit tricky if you want the stuff inside to be parsed correctly by the outer markdown template. Generally safer to use raw html to define nested elements in sub-templates instead of using markdown syntax.
P.S. One other issue here is that you are re-using your array = [tex`A=1`, tex`A=2`] array which just has a single node for each of those tex templates; If you want to re-use that in multiple places you need to render new nodes each time.