Converting a dom element to virtual-dom in widgets

My use case is the following:

I am using the tag banners component and was editing it’s source. Basically, some of the tag descriptions on my website include latex. And I want to render them properly on the banner.

I wanted to add a script to the “Head” section in the customize theme, instead of editing the widget. But I couldn’t find a way of knowing whether the widget is loaded yet, so I get an empty element when I do document.getElementById in the “Head” section because the related html component that displays the tag description is not loaded yet.