4

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?

Sektor
  • 3,320
  • 7
  • 27
  • 36
Hans
  • 143
  • 2

1 Answers1

3

In Version 9 and 10 (Windows 8 - 64 bit), you can use

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$

Related Q/A: Incompatibility of Row and TeXForm

kglr
  • 394,356
  • 18
  • 477
  • 896