That's TeX. Every time Donald Knuth gets distracted from writing The Art of Computer Programming, he makes another piece of load-bearing infrastructure. (TeX came about because the second edition of Volume 1 didn't look as nice as the first edition.)
Looks like LaTeX syntax.
LaTeX would be \(H_{2}O\) – or, more likely, \ce{H2O} or \ch{H2O}.