Can text files display sub or sup indices?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
mech-eng
Messages
826
Reaction score
13
Is there any way to show sub or sup indices in a text file such as this Ab? Text files are very easy to use. They are fast, can be opened fast and created easily.

Thank you.
 
Physics news on Phys.org
You'd have to code it as an html file with super or sub tags or you'd have to code it as latex and run it through a latex renderer or just use a word processor and annotate the super and subscripts.

The closest to a text file would be a markdown file but you'd have to render it to see the super/subscripts as super/subscripts.

https://beegit.com/markdown-cheat-sheet

There's no other way that I know where you can do that.
 
One of the benefit of text files is it is just text, usually ASCII.

There's no paragraph or indentation or carriage returns hidden in the text like there are in word documents which you don't see and will mess-up your inputs if you write them and copy them into shell scripts and the like.

Because of that there's no superscript or subscript because that doesn't exist in the ASCII table.

This is all you will find in a generic text editor:

http://www.asciitable.com

To perform an interesting test you can compare the file sizes bit-by-bit of a text document and a word editor.

Even though you may write the exact same thing there will be size differences because the word editor is using more "invisible" characters to denote things like spacing, indents, or superscripts/subscripts.