function retstr=web_Lie_gen(instruct, outfile) 

retstr = char(''); 
clear A;

for j=1:6;
   eval(['if(~length(instruct.H',num2str(j),')) break; end;']);
   A{j}=eval(['str2num(instruct.H',num2str(j),');']);
end    

[r,D]=Lie_gen(A{:});
outstruct.r=r;

%for j=1:r;
%  eval(['outstruct.C',num2str(j),'=D{j};']);
%end
 
str='';  
for j=1:r;
  str=sprintf('%s\n\nC%s%s%s',str,num2str(j-1),': ',mat2str(D{j}));
end

outstruct.str=str;    
  
  
templatefile = which('web_Lie_gen2.html');
if (nargin == 1)
   retstr = htmlrep(outstruct, templatefile);
elseif (nargin == 2)
   retstr = htmlrep(outstruct, templatefile, outfile);
end  
