# TeXForm producing weird outputs

When executing

TeXForm[ElementData[8, "ElectronConfigurationString"]]


the resulting TeX markup appears to include some internal box markup

\text{[He]}2\text{Superscript}[\text{s},2]2\text{Superscript}[\text{p},4]


$\text{[He]}2\text{Superscript}[\text{s},2]2\text{Superscript}[\text{p},4]$

From that piece of code, I would expect something like $\text{[He]} 2s^{2} 2p^{4}$ to be produced.

I realize that something may be going on with Mathematica's internal box-magic system, and I have tried converting it to other forms before passing it into TeXForm. This does not seem to do anything. What am I doing wrong here?

BoxForm$UseTemplateSlotSequenceForRow = False; ElementData[8, "ElectronConfigurationString"] /. Superscript -> Power // TeXForm  to get \text{[He]}2\text{s}^22\text{p}^4 `$\text{[He]}2\text{s}^22\text{p}^4\$