Fonction Scilab
eng - fr


generate_diagr_tex_file - crée le fichier tex principal des diagrammes Scicos

Librairie

Séquence d'appel

generate_diagr_tex_file(lisf,flag,lang)

Paramètres

Description

Add here a paragraph of the function description. Other paragraph can be added

Add here a paragraph of the function description

Exemple

Add here scilab instructions and comments

Contenu du fichier


//generate_diagr
//Fonction qui génère le fichier tex principal
//d'une page de documentation d'un diagramme
//scicos.

function generate_diagr_tex_file(lisf,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
 lisf=generate_aux_tex_file(lisf,'diagr',flag,lang);

 //define title of paragraph
 tt_title=[
           ''                //tt1  : header du fichier tex
           ''                //tt2  : Diagram (_diagr)
           'Description'     //tt3  : Description (_long)
           'Context'         //tt4  : context (_context)        
           'Scope Results'   //tt5  : Scope results (_scop)
           ''                //tt6  : scilab script file (not programmed)
           'Mod\_num blocks' //tt7  : Mod num blocks (_block)
           'See Also'        //tt8  : See Also (_see_also)
           'Authors'         //tt9  : Authors (_authors)
           'Bibliography'    //tt10 : Bibliography (_bib)
           ''                //tt11 : End of tex file
          ]

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

 for i=1:size(lisf,1)
    for j=1:11 execstr('tt'+string(j)+'=[]'),end
     //define level of paragraph
    //if flag=='html' then
      tex_title='\subsection{'+tt_title+'}';
    //else
      //if grep(lisf(i,1),diagr_elec)<>[] then
        tex_title='\subsection{'+tt_title+'}';
      //else
       // tex_title='\subsection{'+tt_title+'}';
      //end
    //end

    if fileinfo(lisf(i,1)+'_cos'+'/'+lisf(i,1)+'_diagr.tex')<>[] then //figure
      tt2=['\input{'+lisf(i,1)+'_diagr}']
    end

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

    if fileinfo(lisf(i,1)+'_cos'+'/'+lisf(i,1)+'_context.tex')<>[] then //context
      tt4=[tex_title(4)
          '{\tiny'
          '\verbatiminput{'+lisf(i,1)+'_context}'
         '}'] 
    end
 
    if fileinfo(lisf(i,1)+'_cos'+'/'+lisf(i,1)+'_scop.tex')<>[] then //scop
      tt5=[tex_title(5)
           '\input{'+lisf(i,1)+'_scop}']
    end

    if fileinfo(lisf(i,1)+'_cos'+'/'+lisf(i,1)+'_block.tex')<>[] then //mod_num block
      tt7=[tex_title(7)
           '\input{'+lisf(i,1)+'_block}']
    end

    if fileinfo(lisf(i,1)+'_cos/'+lisf(i,1)+'_see_also.tex')<>[] then //see also
      tt8=[tex_title(8)
           '\input{'+lisf(i,1)+'_see_also}']
    end

    if fileinfo(lisf(i,1)+'_cos/'+lisf(i,1)+'_bib.tex')<>[] then //bibliography
     tt10=['\input{'+lisf(i,1)+'_bib.tex}']
    end

    if flag=='guide' then
         tt1=['\section{'+latexsubst(lisf(i,2))+'}\label{'+lisf(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}Diagramme Scicos\\'];
    else
      tt1=[tt1;'\begin{center}Scicos Diagram\\'];
    end
    tt1=[tt1
         '\htmladdnormallink{eng}{../eng/'+lisf(i,1)+'.htm}\hspace{2mm}-'+...
         '\hspace{2mm}\htmladdnormallink{fr}{../fr/'+lisf(i,1)+'.htm}}'
         '\end{center}'];
    tt1=[tt1;'\section{'+latexsubst(lisf(i,2))+'}\label{'+lisf(i,1)+'}'];

    if fileinfo(lisf(i,1)+'_cos/'+lisf(i,1)+'_authors.tex')<>[] then //authors
      tt9=[tex_title(9)
            '\input{'+lisf(i,1)+'_authors}']
    end

    tt11=['\htmlinfo*';'\end{document}']
    end

    //Generate the main tex file of block
    txt=[]
    for j=1:11 txt=[txt;evstr('tt'+string(j))], end
    mputl(txt,lisf(i,1)+'_cos/'+lisf(i,1)+'.tex')
 end
 
endfunction

Fonction(s) utilisée(s)

Add here the used function name and references

Auteurs

enter here the author name Add here the author references