<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">Hi Stuart,
<div><br>
</div>
<div>Thanks for the tip. I eventually did the following:</div>
<div>1. Create the picture with E's (& R's) in the right places.</div>
<div>2. The randomization is for the number, so it comes out as E_1 etc. Same for resistance.</div>
<div>Which brings the following question? Is there a way to specify the font type and size?</div>
<div><br>
</div>
<div>Regards,</div>
<div>-hk</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Jan 18, 2019 at 7:56 PM Raeburn, Stuart <<a href="mailto:raeburn@msu.edu">raeburn@msu.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Hi HK,<br>
<br>
As a work-around you could create an image file for each text label you wish to display, and include subscripts and superscripts when you create each image file.  You would then upload each file to your Authoring Space and publish.<br>
<br>
Within the labelgroup inside the randomlabel item in the problem you would set the type attribute to image, and use something similar to:<br>
<br>
<labelgroup name="EMF" TeXsize="\normalsize" type="image"><br>
<location x="124" y="21" /><br>
    <label description="E1">/res/fsu/hkng/path_to_images/e1label.png</label>  <br>
<location x="124" y="225" /><br>
    <label description="E2">/res/fsu/hkng/path_to_images/e2label.png</label><br>
</labelgroup><br>
<br>
where /res/fsu/hkng/path_to_images/e1label.png and /res/fsu/hkng/path_to_images/e2label.png would be the locations of the published label images.<br>
<br>
Notes:<br>
1. <a href="http://randomlylabel.pm" rel="noreferrer" target="_blank">randomlylabel.pm</a> uses the GD library to create the labeled image, and a call to image->stringFT() was added to the LON-CAPA code in
<a href="http://randomlylabel.pm" rel="noreferrer" target="_blank">randomlylabel.pm</a> rev. 1.19 (2004).  The comment logged with that commit is: "- added font support (I can't get ttf to work)"<br>
<br>
2. The call to $image->stringFT() to use a TrueType Font (ttf) for a text label available in
<a href="http://randomlylabel.pm" rel="noreferrer" target="_blank">randomlylabel.pm</a> is not currently used because
<a href="http://randomlabel.pm" rel="noreferrer" target="_blank">randomlabel.pm</a> currently only supports specification of the first three arguments (x, y, text) of the six arguments which the perldoc for
<a href="http://randomlylabel.pm" rel="noreferrer" target="_blank">randomlylabel.pm</a> indicates would be possible for the LABEL item. The other three (unsupported by
<a href="http://randomlabel.pm" rel="noreferrer" target="_blank">randomlabel.pm</a>) are: font, color, direction.<br>
<br>
3. The CPAN documentation for the GD library documents that the text label can contain UTF-8, as long as libgd has been compiled with TrueType support, and the appropriate TrueType font is installed on the system. In that case a superscript 1 could be included
 as &#185; and a superscript 2 could be included as &#178;<br>
<br>
<br>
Stuart Raeburn<br>
LON-CAPA Academic Consortium<br>
<br>
________________________________________<br>
From: LON-CAPA-users <<a href="mailto:lon-capa-users-bounces@mail.lon-capa.org" target="_blank">lon-capa-users-bounces@mail.lon-capa.org</a>> on behalf of
<a href="http://H.K.Ng" rel="noreferrer" target="_blank">H.K.Ng</a> <<a href="mailto:hkng@fsu.edu" target="_blank">hkng@fsu.edu</a>><br>
Sent: Friday, January 18, 2019 9:22 AM<br>
To: Discussion list for LON-CAPA users<br>
Subject: [LON-CAPA-users] subscript/superscript in randomlabel<br>
<br>
Hi,<br>
 Is there a way to display subscript/superscript in randomlabel? Tried a few things but none works. Thanks.<br>
<br>
<randomlabel width="306" height="269" TeXwidth="75" bgimg="Graphics/21_25.png"><br>
<labelgroup name="EMF" TeXsize="\normalsize" type="text"><br>
<location x="124" y="21" /><br>
    <label>E<sub>1</sub></label><br>
<location x="124" y="225" /><br>
    <label>E2</label><br>
</labelgroup><br>
</ramdomlabel><br>
<br>
Regards,<br>
-hk<br>
<br>
_______________________________________________<br>
LON-CAPA-users mailing list<br>
<a href="mailto:LON-CAPA-users@mail.lon-capa.org" target="_blank">LON-CAPA-users@mail.lon-capa.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__mail.lon-2Dcapa.org_mailman_listinfo_lon-2Dcapa-2Dusers&d=DwICAg&c=HPMtquzZjKY31rtkyGRFnQ&r=wTSZ5EgyXvEFGuAc4iHTrg&m=vKQOW2DjQJBkbpvdiivXEY2TJCoMqKj2wC87arzvQDc&s=y-WSGpNhtxSam9JCZu_uxbIlFMa6meyndyMqsi36_3w&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__mail.lon-2Dcapa.org_mailman_listinfo_lon-2Dcapa-2Dusers&d=DwICAg&c=HPMtquzZjKY31rtkyGRFnQ&r=wTSZ5EgyXvEFGuAc4iHTrg&m=vKQOW2DjQJBkbpvdiivXEY2TJCoMqKj2wC87arzvQDc&s=y-WSGpNhtxSam9JCZu_uxbIlFMa6meyndyMqsi36_3w&e=</a><br>
</blockquote>
</div>
</body>
</html>