# Transforms vector-presented polynomial into html style.

poly=!trim $poly
n=!itemnum $poly
poly_html=
!for i from 1 to $n
  k=!item $i of $poly
  !if $k != 0
    !ifval $i>1 and $k>=0 
      poly_html=$poly_html+
    !endif
    !ifval $k=0
      poly_html=$poly_html(
    !endif
    p=!eval $n-$i
    !if $k = -1 and $p != 0
      poly_html=$poly_html-
    !else
      !if $k != 1 or $p=0
        poly_html=$poly_html$k
      !endif
    !endif
    !ifval $k=0
      poly_html=$poly_html)
    !endif
    !ifval $p>0
      poly_html=$(poly_html)X
      !ifval $p>1
        poly_html=$poly_html<sup>$p</sup>
      !endif
    !endif
  !endif
!next i
      
