Hi,
I'm trying to read information from a file and use to label a line in a plot, i.e. If
stringfromfile="abcd"; (* then inside Plot ... *) Epilog->{Text[stringfromfile]}
This works fine for most case, but I don't know how to generate superscripts in this situation, i.e. Read in a string, such as:
stringfromfile="did you know that ^4^He is an interesting isotope" (*I used the "^" here as a arbitrary marker of the superscripted character*)
and parse it such that
Text[stringfromfile]
produces: "did you know that 4He is an interesting isotope". I tried a bunch of approaches, but the closest I got is the following:
tmp = StringSplit[stringfromfile, "^"];
Text[(tmp[[1]] <> ""^tmp[[2]] <> tmp[[3]])];
This produces: "did you know that 4He is an interesting isotope" Does anyone know a way to store / interpret this formatting information, short of generating the BoxData code:
"\<\"did you know that\\!\\(\\*SuperscriptBox[\\(\\\\ \\), \\(4\\)]\\)He is an interesting isotope\"\>"
Thanks