[LON-CAPA-users] Answer Box issue & Style File

Alison A Baski/FS/VCU lon-capa-users@mail.lon-capa.org
Mon, 26 Feb 2007 09:51:46 -0500


This is a multipart message in MIME format.
--=_alternative 0051A3C68525728E_=
Content-Type: text/plain; charset="US-ASCII"

Hi Guy,

Thanks for the pointers about the style file. I have created a style file 
(see below) that makes a box that I like when creating a PDF file (using 
Selected Problems from folder).

HOWEVER, when I create a  PDF file for a student (using Selected Problems 
from folder for Selected People), LaTeX does not successfully parse the 
text file.

The following error message is created:
Illegal unit of measure (pt inserted).
1.8\framebox[150]{\parbox{150}{ \vspace*{1cm}}}

Is there something I am doing wrong here? 

Thanks,
Alison



Style file:
<definetag name="textline">
<render>
<tex>\framebox[150]{\parbox{150}{ \vspace*{1cm}}}</tex>
</render>
</definetag>






Guy Albertelli II <guy@albertelli.com> 
Sent by: lon-capa-users-admin@mail.lon-capa.org
02/26/2007 02:44 AM
Please respond to
lon-capa-users@mail.lon-capa.org


To
lon-capa-users@mail.lon-capa.org
cc

Subject
Re: [LON-CAPA-users] Change size of "Answer" box appearing on PDF 
printout?






Hi Alison,

You can turn the <textline /> into arbitray LaTeX code for printing.

You'll need to create in CSTR a lon-capa style file

(in CSTR
Select action 'New Style File:' and give it a name.)

In the edit mode change the contents of the .sty file to

<definetag name="textline">
    <render>
       <tex>
            LaTeX you'd prefer to appear in replacment of the existing
            box. Examples of what you would want here are later in this 
email.
       </tex>
    </render>
</definetag>

Then publish this .sty file.

Enter your course and 
- Click Main Menu
- Click PARM
- Click 'Set Course Environment'
- Change the field 'Default XML Style File' to point to the file you
  just published. (You can use the 'Select Style File' link to get a
  window to navigate to it and pick it.)
- Click 'Set Course Environment' to make this take effect

Now if you navigate to the problem and print it should have the change
you wanted.

- this is a global change to your course, all problems that have a
  textline will print with the above change as long as the 'Default
  XML Style File' is set to this. By deleting this set value the
  printing will revert back to the way it worked before.
  (Ther are ways to work around this using the <block> tag inside of
  the <tex> tag in the .sty file, but I'll save that for a later email
  if still needed/wanted.)

- If you want to change the effects of the sty file, chanign the sty
  and re-publishing it will take effect immeadiately if the PARM is
  set fo the course.

Some examples of what to put between the <tex></tex>and their effects:

This will leave a 3cm gap where the box previously appeared:

  <tex>\vspace*{3cm}</tex>


This will create a box the width of the column of the sheet, and 3cm
tall:

  <tex>\framebox[\textwidth]{\parbox{\textwidth}{ \vspace*{3cm} }}</tex>


This will crate a box with 2 lines around it the width of a column of
the sheet, ad 3cm tall:

  <tex>\fbox{\framebox[\textwidth]{\parbox{\textwidth}{ 
\vspace*{3cm}}}}</tex>


Hopefully this will work better for you?


-- 
guy@albertelli.com   0-7-0-9-27,137
_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users


--=_alternative 0051A3C68525728E_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Hi Guy,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for the pointers about the style
file. I have created a style file (see below) that makes a box that I like
when creating a PDF file (using Selected Problems from folder).</font>
<form action=http://loncapa.vcu.edu/adm/printout method=post>
<br></form>
<br><font size=2 face="sans-serif"><b><u>HOWEVER</u></b>, when I create
a &nbsp;PDF file for a student (using Selected Problems from folder for
Selected People), LaTeX does not successfully parse the text file.</font>
<br>
<br><font size=2 face="sans-serif">The following error message is created:</font>
<br><font size=2 face="sans-serif">Illegal unit of measure (pt inserted).</font>
<br><font size=2 face="sans-serif">1.8\framebox[150]{\parbox{150}{ \vspace*{1cm}}}</font>
<br>
<br><font size=2 face="sans-serif">Is there something I am doing wrong
here? </font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Alison</font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif"><u>Style file</u>:</font>
<br><font size=2 face="sans-serif">&lt;definetag name=&quot;textline&quot;&gt;</font>
<br><font size=2 face="sans-serif">&lt;render&gt;</font>
<br><font size=2 face="sans-serif">&lt;tex&gt;\framebox[150]{\parbox{150}{
\vspace*{1cm}}}&lt;/tex&gt;</font>
<br><font size=2 face="sans-serif">&lt;/render&gt;</font>
<br><font size=2 face="sans-serif">&lt;/definetag&gt;</font>
<br>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Guy Albertelli II &lt;guy@albertelli.com&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: lon-capa-users-admin@mail.lon-capa.org</font>
<p><font size=1 face="sans-serif">02/26/2007 02:44 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
lon-capa-users@mail.lon-capa.org</font></div></table>
<p>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">lon-capa-users@mail.lon-capa.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [LON-CAPA-users] Change size of
&quot;Answer&quot; box appearing on PDF printout?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hi Alison,<br>
<br>
You can turn the &lt;textline /&gt; into arbitray LaTeX code for printing.<br>
<br>
You'll need to create in CSTR a lon-capa style file<br>
<br>
(in CSTR<br>
Select action 'New Style File:' and give it a name.)<br>
<br>
In the edit mode change the contents of the .sty file to<br>
<br>
&lt;definetag name=&quot;textline&quot;&gt;<br>
 &nbsp; &nbsp;&lt;render&gt;<br>
 &nbsp; &nbsp; &nbsp; &lt;tex&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LaTeX you'd prefer to appear
in replacment of the existing<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;box. Examples of what you would
want here are later in this email.<br>
 &nbsp; &nbsp; &nbsp; &lt;/tex&gt;<br>
 &nbsp; &nbsp;&lt;/render&gt;<br>
&lt;/definetag&gt;<br>
<br>
Then publish this .sty file.<br>
<br>
Enter your course and <br>
- Click Main Menu<br>
- Click PARM<br>
- Click 'Set Course Environment'<br>
- Change the field 'Default XML Style File' to point to the file you<br>
 &nbsp;just published. (You can use the 'Select Style File' link to get
a<br>
 &nbsp;window to navigate to it and pick it.)<br>
- Click 'Set Course Environment' to make this take effect<br>
<br>
Now if you navigate to the problem and print it should have the change<br>
you wanted.<br>
<br>
- this is a global change to your course, all problems that have a<br>
 &nbsp;textline will print with the above change as long as the 'Default<br>
 &nbsp;XML Style File' is set to this. By deleting this set value the<br>
 &nbsp;printing will revert back to the way it worked before.<br>
 &nbsp;(Ther are ways to work around this using the &lt;block&gt; tag inside
of<br>
 &nbsp;the &lt;tex&gt; tag in the .sty file, but I'll save that for a later
email<br>
 &nbsp;if still needed/wanted.)<br>
<br>
- If you want to change the effects of the sty file, chanign the sty<br>
 &nbsp;and re-publishing it will take effect immeadiately if the PARM is<br>
 &nbsp;set fo the course.<br>
<br>
Some examples of what to put between the &lt;tex&gt;&lt;/tex&gt;and their
effects:<br>
<br>
This will leave a 3cm gap where the box previously appeared:<br>
<br>
 &nbsp;&lt;tex&gt;\vspace*{3cm}&lt;/tex&gt;<br>
<br>
<br>
This will create a box the width of the column of the sheet, and 3cm<br>
tall:<br>
<br>
 &nbsp;&lt;tex&gt;\framebox[\textwidth]{\parbox{\textwidth}{ \vspace*{3cm}
}}&lt;/tex&gt;<br>
<br>
<br>
This will crate a box with 2 lines around it the width of a column of<br>
the sheet, ad 3cm tall:<br>
<br>
 &nbsp;&lt;tex&gt;\fbox{\framebox[\textwidth]{\parbox{\textwidth}{ \vspace*{3cm}}}}&lt;/tex&gt;<br>
<br>
<br>
Hopefully this will work better for you?<br>
<br>
<br>
-- <br>
guy@albertelli.com &nbsp; 0-7-0-9-27,137<br>
_______________________________________________<br>
LON-CAPA-users mailing list<br>
LON-CAPA-users@mail.lon-capa.org<br>
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users<br>
</font></tt>
<br>
--=_alternative 0051A3C68525728E_=--