Write n_10 in math-mode

math-mode

I'm writing some notes about numerical analise and I want to write a line as fallows:

351_10 = 101100000_2 = 540_8 = 160_16

This is the notation to describe when numbers are written in different bases as in 111_2 would mean the binary number 111 that is represent in base ten as 7_10.

enter image description here

mathpix is supposed to convert the raw: 351_2 into the same number but with the 2 being subscript. It works with single digit numbers as in 351_2 will show correctly with the 2 sub-scripted. But it does not work with double digit numbers, as in 351_79 will show 7 sub-scripted but not the 9.

enter image description here

I tried using several combinations of brackets and also tried to read the mathpix wiki syntax but I could not find the solution. I suspect it may have something to do with the aligh keyword.

This was the mathpix guide I used: https://mathpix.com/docs/mathpix-markdown/syntax-reference#align%2C-split%2C-gather-equation-environments

  • OS: Linux
  • text editor: Mark Text

Best Answer

In (La)TeX you want to use curly braces around sub- and superscripts that consist of several characters (tokens). I'm assuming this is going to be similar for the various tools out there that accept TeX-like input, but are not really TeX.

I recommend you always add the braces even if your sub- or superscript consists of only a single character (token).

351_{10} = 101100000_{2} = 540_{8} = 160_{16}
Related Question