APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

subscripts and superscripts post and replies

Return to the subscripts and superscripts thread
Login to post to this thread

Subscripts and superscripts
Mariusz Krasinski
17 Posts

Is there any simple method to write superscipts (like F_max but as subscript) in static text placed in graphic area.
In below 5 version F_max worked but in 5.0 perhaps not. I tried different operations from JavaScript help page but nothing works.
Is any possibility to place two texts with different sizes as graphic elements?

Replies to Subscripts and superscripts

Re: Subscripts and superscripts -
Francisco Esquembre
228 Posts


The Java version of the drawing and plotting panels has not changed. So, it will support the same format, including subscript.

The Javascript version doe snot support this feature, alas.


Re: Subscripts and superscripts -
146 Posts

Although drawing elements, such as axis labels in plotting panels, do not support subscripts, you can use subscript superscript css properties in text labels and other interface elements.  For example, you can write

"A label subscript"

for the text property in a text label.

Re: Re: Subscripts and superscripts -
Mariusz Krasinski
17 Posts

Thank you. It really works also for Greek letters.
However it is pity that Javascript gives less elegant (in sense of interface) simulations than Java.
I am transforming old EJS simulations to EJSS style due to problems many students have with starting Java applets (despite of my instructions). Javascript version works without such problems but I do prefere Java version output.

Re: Re: Re: Subscripts and superscripts -
lookang Avatar
222 Posts

i have managed to created super and sub scripts in ejss.

jut go to wiklipedia and copy the code and paste in the ejss model label.


Post edited November 1, 2014 at 12:27 PM EST.

Attached File: 2014-11-02_0024.png

OSP@SG blog
OSP@SG Digital Library

Re: Re: Re: Re: Subscripts and superscripts -
Mariusz Krasinski
17 Posts

The method described above by Wolfgang works well in situations like in the example presented by You, i.e. labels in "normal"panels
The problem is superscript or subscript in DrawingPanel. Alas the method does not work in such cases. Of course one can make separately main text and subscript text and place inside graphic panel but it is time consuming and not as flexible as method in available in EJS.

OSP Projects:
Open Source Physics - EJS Modeling
Physlet Physics
Physlet Quantum Physics
STP Book