Scilab Function
eng - fr


generate_scilib_tex_file - create main tex file of scilab macro library

Library

Calling Sequence

txt = generate_scilib_tex_file(LibName,flag,lang)

Parameters

File content


function txt=generate_scilib_tex_file(LibName,flag,lang)

  //verify the 'lang' right parameter
  [lsh,rsh]=argn(0)
  if rsh<3 then
    if ~exists('lang') then
     lang='eng'
    elseif lang<>'eng' & lang<>'fr' then
     lang='eng'
    end
  end

 //Generate auxiliary tex files
 LibName=generate_aux_tex_file(LibName,'scilib',flag,lang);

 //define title of paragraph
 tt_title=[
           ''                //tt1  : header du fichier tex
           'Package'         //tt2  : Package
           'Description'     //tt3  : Description (_long)
           'Scilab function' //tt4  : Scilab functions
           'See Also'        //tt5  : See Also (_see_also)
           'Authors'         //tt6  : Authors (_authors)
           ''                //tt7  : End of tex file
           ]

 //change language of title
 if lang=='fr' then
  tt_title=change_lang_title(lang,tt_title);
 end 

 //define level of paragraph
 if flag=='html' then
  tex_title='\subsection{'+tt_title+'}'
 else
  tex_title='\subsection{'+tt_title+'}'
 end
  //tt1 : header
  //tt2 : package
  //tt3 : description
  //tt4 : scilab functions
  //tt5 : see also
  //tt6 : Authors
  //tt7 : end of tex file

 for i=1:size(LibName,1)
   for j=1:7 execstr('tt'+string(j)+'=[]'),end //for each paragraph

      if fileinfo(LibName(i,1)+'_scilib/'+LibName(i,1)+'_long.tex')<>[] then  
        tt3=[tex_title(3) //Description
             ''
             '\input{'+LibName(i,1)+'_long}']
      end

      if fileinfo(LibName(i,1)+'_scilib/'+LibName(i,1)+'_see_also.tex')<>[] then
         tt5=[tex_title(5) //see also
             '\input{'+LibName(i,1)+'_see_also}']
      end


      if flag=='guide' then
         tt1=['\chapter{'+latexsubst(LibName(i,2))+'}\label{'+LibName(i,1)+'}'] 

      elseif flag=='html' then

         if lang=='fr' then //Header of tex file
           tt1=['\documentclass[11pt,frenchb]{article}']
         else
           tt1=['\documentclass[11pt]{article}']
         end
         tt1=[tt1;
              '\usepackage{makeidx,graphics,fullpage}'
              '\usepackage{verbatim,times,amsmath,amssymb,epsfig,color}'
              '\usepackage{html}'
              '\begin{document}']
         if lang=='fr' then
           tt1=[tt1;'\begin{center}Librairie Scilab\\']
         else
           tt1=[tt1;'\begin{center}Scilab Library\\']
         end
         tt1=[tt1
             '\htmladdnormallink{eng}{../eng/'+LibName(i,1)+'.htm}\hspace{2mm}-'+...
             '\hspace{2mm}\htmladdnormallink{fr}{../fr/'+LibName(i,1)+'.htm}}'
             '\end{center}'];

         tt1=[tt1;'\section{'+latexsubst(LibName(i,2))+'}\label{'+LibName(i,1)+'}']

         tt2=[tex_title(2)
              '\begin{itemize}'
              '\item{\htmladdnormallink{Mod\_Num}{whatis.htm}}'
              '\end{itemize}']


         //Cherche la liste des fichiers sci du rep LibName dans tt_ml
         if LibName(i,1)==mod_num_sci_lib then
           name=modnum_sci_func;
         elseif LibName(i,1)==mod_num_rout_lib then
           lisf_rout=return_ext_file_in_dir(tt_ml,low_rout_path,".c")
           name=basename(lisf_rout);
         else
           sci_files=return_ext_file_in_dir(tt_ml,mac_path+'/'+LibName(i,1),'sci');
           name=basename(sci_files);
         end
         //pause
         if name<>[] then
            tt4=[tex_title(4);'\begin{itemize}']
            for j=1:size(name,1)
              txt2=return_xml_sdesc(xml_path+lang+'/'+name(j)+'.xml');
              txt2=latexsubst(txt2);
              tt4=[tt4;'\item{\htmladdnormallink{'+latexsubst(name(j))+' - '+txt2+'}{'+name(j)+'.htm}}']
            end
            tt4=[tt4;'\end{itemize}'];
         end

    if fileinfo(LibName(i,1)+'_scilib/'+LibName(i,1)+'_authors.tex')<>[] then
      tt6=[tex_title(6)
           '\input{'+LibName(i,1)+'_authors}']
    end

    tt7=['\htmlinfo*';'\end{document}']
  end
  txt=[];
  for j=1:7 txt=[txt;evstr('tt'+string(j))], end;
  mputl(txt,LibName(i,1)+'_scilib/'+LibName(i,1)+'.tex')
 end

endfunction

Authors

IRCOM Group Alan Layec