Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Sub indices in a text file

  1. May 2, 2017 #1
    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.
     
  2. jcsd
  3. May 2, 2017 #2

    jedishrfu

    Staff: Mentor

    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.
     
  4. May 2, 2017 #3
    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted