Hi @Anonymous ,
Could you please share a bit more about the data structure of your SP List?
Do you want to convert the chemical formula from your SP List Column into subscript form?
I have made a test on my side, I think the Html Text control could achieve your needs. I assume that you want to list your SP List in a Gallery and you connect the Gallery to your SP List already, please add a HTML Text control inside your Gallery to display the chemical info. Set the HtmlText property of the HTML Text control to following:
Subtitute(
ThisItem.ChemicalColumn,
First(MatchAll(ThisItem.ChemicalColumn, "(?<IndexNumber>\d+)")).FullMatch,
"<sub>" & First(MatchAll(ThisItem.ChemicalColumn, "(?<IndexNumber>\d+)")).FullMatch & "</sub>"
)

Please consider take a try with above solution, check if the issue is solved.
Best regards,