cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
] />

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
SDF1
Super User

Help with subscripting and superscripting in JSL

Hello JSL'ers,

  JMP seems to have lost (or got rid of) some of their text modification options, like using the copy/paste feature from Word to move text that includes normal and super(sub)-scripted text into JSL.

  Previously, I could easily take something like g/cm3 from Word and copy/paste it into a JSL editor and the formatting would move with it so that I could display some text just like in Word. Now, when I do, I just get g/cm3. There's also no easy way to modify the text to get it correct. I know JMP will accept Unicode, but that's just royally obnoxious, and doesn't work for all characters.

  In addition, I can't get JSL to display subscripted text either. I'd like to do something like: sampleBKG , but JSL won't accept that as valid text.

  It's hard to believe that in 2026 JMP still doesn't appear to have this capability. I've seen other posts on the Wishlist and in the Discussion forum that request this same option. Having full control over all characters 0-9, A-Z, a-z, and all Greek (upper and lower), for super(sub)-scripts would greatly improve communicating information to recipients in JMP. I put in a Wishlist item for this, but I've noticed it's also been in the Wishlist for several years now.

  If anyone has found a workaround that can force text in Text Box("....") to display it with super(sub)-scripts like in my examples, please let me know.

Thanks!,

DS

5 REPLIES 5
jthi
Super User

Re: Help with subscripting and superscripting in JSL

Use unicode characters  Scripting Guide > Types of Data > Numbers and Strings > Unicode Characters 

Names Default To Here(1);

nw = New Window("", Text Box("m/s\!U00B2"));
-Jarmo
MathStatChem
Level VII

Re: Help with subscripting and superscripting in JSL

This is the right way.  It also prevents cross platform (Windows/MacOS) issues.  

SDF1
Super User

Re: Help with subscripting and superscripting in JSL

Hi @jthi and @MathStatChem ,

  Yes, I am familiar with this way -- it's just tedious and slow. It would be nice if JMP supported LaTex or extended HTML formatting to accommodate a more efficient way to write out different or more complicated super- and sub- scripted text. Even doing it the Unicode way in JSL doesn't actually get what I want -- but it's closer than not doing it.

For example, 

"\!U0394\!U1D00\!U0299\!U1D04"

 

will produce this:

SDF1_0-1777561662316.png

which is close, but technically not the same as: ΔABC -- the "ABC" is just small, not truly subscripted in JSL. And, having to search for each letter manually is cumbersome. You can do something like this: hinitial in JSL, the JSL code for it would be 

"h\!U1D62\!U2099\!U1D62\!U209C\!U2090\!U2097"

which gives: 

 

SDF1_2-1777562552647.png

which works for lower case subscripted Latin letters, but it doesn't work to have capital letters as true subscripts.

  Anyway, the process is tedious and does not allow for efficient or compact JSL scripting. It would be great and helpful if JSL expanded their markup capabilities with HTML since they already have things set up for bold, italic, and underline.

  So in answer to my previous query about any kind of workaround to have capital letters as true subscripts, the answer so far is no in JSL.  Unicode also doesn't have any values to represent a true subscripted capital letter, so using a Unicode value is not possible.

SDF1_3-1777562999688.png

  It would be nice to have this capability in JMP/JSL, that's all I'm saying....

Thanks!,

DS

Re: Help with subscripting and superscripting in JSL

For the time being, the approach using Unicode characters works. I completely understand all the pitfalls and frustrations, though.

For my own JSL development, I keep a script file pinned in the Home window with Unicode characters as a poor scripter's cheat sheet. I add characters as I encounter new ones that I haven't used before. I have the character string with the Unicode escape sequence on one line. I evaluate it and then copy the resulting character from the JMP Log back to the second line in my script. This way my scripts have the Unicode character in the strings, not the escape sequence. It is much easier to use and read this way.

I also use a Unicode app on my phone. It contains easily searched libraries to look up new characters.

SDF1
Super User

Re: Help with subscripting and superscripting in JSL

Hi @Mark_Bailey ,

  Thank you very much for the tip on keeping a JSL script at the ready to evaluate the Unicode character sequence and then copy/paste the result into one's JSL code.

  This absolutely helps with making the code more readable and makes it much easier to manage trying to find the few of more than 150,000 different Unicode characters. (Supposedly, there can be over 1.1 million possible Unicode characters, at least according to a quick search.)

  I'm starting this right now!

  I'm just flabbergasted at the decisions of the governing body for the Unicode characters as to why they didn't go ahead and include all possible Latin characters -- for example, there is no Unicode character for a subscript "b". Why? They included several other Latin characters and special phonetic characters, but not a subscript "b". I just think that's so strange.

Thanks!,

DS

Recommended Articles