[LON-CAPA-users] Evaluation of variable in tex mode

Lars Jensen lon-capa-users@mail.lon-capa.org
Wed, 01 Oct 2003 08:46:36 -0700


Hi Hon-Kie,

<m>$x$</m> should work (and do does <em>x</em> )

Lars

H. K. Ng wrote:

> When printing the script below, the symbol $x$ is replaced with the 
> value of $x. So if $x = 4, it displays the following:
>
> ...along the 4$-axis from 0 to 4.
>
> whereas it should be
>
> ...along the x-axis from 0 to 4.
>
> (with the letter x slanted).
> Question: How can I use the same "name" in the display and as a variable?
> Thanks,
> -hk
>
> ====================================
> <script type="loncapa/perl">
> $x=&random(3,10,0.5);
> </script>
>
> <startouttext />
> A particle moves along the <display>&tex('$x$','x')</display>-axis 
> from 0 to $x.
> <endouttext />
>
>
>  
>
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>
>