generate_mod_num_guide(flag,lang)
Add here a paragraph of the function description. Other paragraph can be added
Add here a paragraph of the function description
Add here scilab instructions and comments
//generate mod_num_guide //fonction qui crée la documentation papier //de la boîte à outils // //Entrée : flag : un drapeau pour signaler quel type de doc: // 'user' pour le guide utilisateur // 'ref' pour le guide de référence // 'internal' pour le guide interne // lang : pour choisr le type de language // 'eng' pour de l'anglais // 'fr' pour du français function generate_mod_num_guide(flag,lang) [lsh,rsh]=argn(0) if rsh<2 then if ~exists('lang') then lang='eng' elseif lang<>'eng' & lang<>'fr' then lang='eng' end end //Preambule of each LaTex Guide if lang=='fr' then tt_head=['\documentclass[11pt,a4paper,frenchb]{report}']; else tt_head=['\documentclass[11pt,a4paper]{report}']; end tt_head=[tt_head '\usepackage{graphics}' '\usepackage{subfigure}' '\renewcommand{\thesubfigure}{}' '\usepackage{html}' '\usepackage[T1]{fontenc}' '\usepackage[latin1]{inputenc}' '\usepackage{verbatim,times,amsmath,amssymb,epsfig,color}' '\usepackage{geometry}'] if lang=='fr' then tt_head=[tt_head '\usepackage{babel}']; end tt_head=[tt_head '\geometry{verbose,a4paper,tmargin=2cm,bmargin=2.5cm,lmargin=1.7cm,rmargin=1.7cm,headheight=1cm,footskip=2cm}' '' '\pagestyle{headings}' '\setcounter{tocdepth}{1}']; //title of each LaTex Guide tt_title=['\author{IRCOM Group \\ Alan Layec}' '' '\begin{document}' ' \maketitle' ' \newpage' '' ' \thispagestyle{empty}' ' \null' ' \newpage' ''] if lang=='fr' then tt_title=[tt_title ' \chapter*{Préface}'] else tt_title=[tt_title ' \chapter*{Preface}']; end tt_title=[tt_title ' \thispagestyle{empty}']; //contents of each LaTex Guide tt_contents=[' \newpage' '' ' \thispagestyle{empty}' ' \null' ' \newpage' '' ' \setcounter{page}{1}' ' \addtocontents{toc}{\protect\thispagestyle{headings}}' ' \tableofcontents' ' \thispagestyle{headings}' '']; if flag=='ref' then /////////////// //Reference guide ////////////// //////////Create LaTeX files////// //preface tt_i=[]; //scicos blocks and palette tt_sb=[]; TEXINPUTS='$TEXINPUTS:.'; PalRep=return_dir_in_dir(tt_ml,pal_path) for j=1:size(PalRep,1) PalName=basename(part(PalRep(j),1:length(PalRep(j))-1)); tt_sb=[tt_sb;'\input{'+PalName+'_cosf/'+PalName+'}';'\pagebreak']; TEXINPUTS=TEXINPUTS+':./'+PalName+'_cosf/'; generate_pals_tex_file(PalName,'guide',lang); //scicos blocks lisf_blocks=return_ext_file_in_dir(tt_ml,PalRep(j),'.sci'); for i=1:size(lisf_blocks,1) name= part(lisf_blocks(i,1),1:length(lisf_blocks(i,1))-4); generate_blocks_tex_file(name,'guide',lang) tt_sb=[tt_sb;'\input{'+name+'/'+name+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+name+'/' end end //scilab macros tt_sim=[]; Librep=return_dir_in_dir(tt_ml,mac_path) for j=1:size(Librep,1) LibName=basename(part(Librep(j),1:length(Librep(j))-1)); if grep(LibName,ex_lib_name)==[] then tt_sim=[tt_sim;'\input{'+LibName+'_scilib/'+LibName+'}';]; TEXINPUTS=TEXINPUTS+':./'+LibName+'_scilib/'; generate_scilib_tex_file(LibName,'guide',lang); //Scilab function lisf=return_ext_file_in_dir(tt_ml,Librep(j),'.sci'); for i=1:size(lisf,1) name=basename(lisf(i,1)); generate_scifun_tex_file(name,'guide',lang); tt_sim=[tt_sim;'\input{'+name+'_sci/'+name+'}']; TEXINPUTS=TEXINPUTS+':./'+name+'_sci/'; end end end //Mod_num_sci_lib tt_sim=[tt_sim;'\input{'+mod_num_sci_lib+'_scilib/'+mod_num_sci_lib+'}']; TEXINPUTS=TEXINPUTS+':./'+mod_num_sci_lib+'_scilib/'; generate_scilib_tex_file(mod_num_sci_lib,'guide',lang); for i=1:size(modnum_sci_func,1) generate_scifun_tex_file(modnum_sci_func(i),'guide',lang) tt_sim=[tt_sim;'\input{'+modnum_sci_func(i)+'_sci/'+modnum_sci_func(i)+'}']; TEXINPUTS=TEXINPUTS+':./'+modnum_sci_func(i)+'_sci/'; end //main tex file if lang=='fr' then txt=[tt_head;'\title{\Huge ""Modnum""\\' 'Boîte à outils Scilab\\' 'pour les systèmes de communication\\' 'Guide de r\''ef\''erence\\' '\small Ver. 1.0}']; else txt=[tt_head;'\title{\Huge ""Modnum""\\' 'Scilab toolbox\\' 'for the communication systems\\' 'Reference Guide\\' '\small Ver. 1.0}']; end txt=[txt tt_title tt_i tt_contents]; if lang=='fr' then txt=[txt ' %%Blocs Scicos' ' \part{Blocs Scicos}']; else txt=[txt ' %%Scicos blocks' ' \part{Scicos blocks}']; end txt=[txt ' \null' ' \newpage' '' " "+tt_sb '' ' \addtocontents{toc}{\protect\pagebreak}' ' \setcounter{chapter}{0}' '' ' \newpage' ' \null' ' \newpage' ''] if lang=='fr' then txt=[txt ' %%Fonctions Scilab' ' \part{Fonctions Scilab}']; else txt=[txt ' %%Silab functions' ' \part{Silab functions}']; end txt=[txt '\null' '\newpage' '' " "+tt_sim '\end{document}'] mputl(txt,'ref.tex') /////////Compile/////////// //mv report.cls to current directory unix_g(cp_cmd+man_path+'tex/'+'report.cls'+' .') //define cmd latex_cmd='latex -interaction=nonstopmode ref.tex '; export_cmd='export TEXINPUTS='+TEXINPUTS; divps_cmd='dvips -o ref.ps ref.dvi'; gv_cmd='gv ref.ps'; //latex+dvips+gv new_tt=export_cmd+' ; '+latex_cmd+' ; '+latex_cmd+' ; '+latex_cmd+' ; '+divps_cmd+' ; '+gv_cmd; mputl(new_tt,'compile.sh'); unix_g('chmod a+x compile.sh'); pause unix_g('./compile.sh'); //ps2pdf ps2pdf_cmd='ps2pdf14 ref.ps'; unix_g(ps2pdf_cmd); unix_g('cp ref.pdf modnum_ref.pdf') unix_g(mv_cmd+'./modnum_ref.pdf '+pdf_path+lang+'/'); ////////////Clean/////////// //Erase template LaTeX file unix_g('rm -f ref.*'); unix_g('rm -f compile.sh'); unix_g(rm_cmd+'report.cls'); //Erase template directories of scicos blocks and palettes PalRep=return_dir_in_dir(tt_ml,pal_path); for j=1:size(PalRep,1) PalName=basename(part(PalRep(j),1:length(PalRep(j))-1)); unix_g(rm_cmd+PalName+'_cosf') lisf_blocks=return_ext_file_in_dir(tt_ml,PalRep(j),'.sci'); for i=1:size(lisf_blocks,1) name=basename(lisf_blocks(i,1)) unix_g(rm_cmd+name); end end //Erase template directories of scilab macros and libraries Librep=return_dir_in_dir(tt_ml,mac_path) for j=1:size(Librep,1) LibName=basename(part(Librep(j),1:length(Librep(j))-1)); unix_g(rm_cmd+LibName+'_scilib'); //Scilab function lisf=return_ext_file_in_dir(tt_ml,Librep(j),'.sci'); for i=1:size(lisf,1) name=basename(lisf(i,1)); unix_g(rm_cmd+name+'_sci'); end end //Mod_num_sci_lib unix_g(rm_cmd+'mod_num_sci_lib_scilib'); for i=1:size(modnum_sci_func,1) unix_g(rm_cmd+modnum_sci_func(i)+'_sci'); end elseif flag=='user' then ///////////////// //User's guide ///////////////// //introduction tt_i=[]; tt_cs=[]//continous system TEXINPUTS='$TEXINPUTS:.'; for j=1:size(diagr_cs,1) tt_cs=[tt_cs;'\input{'+diagr_cs(j,2)+'_cos/'+diagr_cs(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_cs(j,2)+'_cos/' generate_diagr_tex_file(diagr_cs(j,2),'guide',lang); end tt_ds=[]//discrete system for j=1:size(diagr_ds,1) tt_ds=[tt_ds;'\input{'+diagr_ds(j,2)+'_cos/'+diagr_ds(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_ds(j,2)+'_cos/' generate_diagr_tex_file(diagr_ds(j,2),'guide',lang); end tt_os=[];//Open loop models of oscillator for j=1:size(diagr_os,1) tt_os=[tt_os;'\input{'+diagr_os(j,2)+'_cos/'+diagr_os(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_os(j,2)+'_cos/' generate_diagr_tex_file(diagr_os(j,2),'guide',lang); end tt_is=[]//integer synthesizer for j=1:size(diagr_is,1) tt_is=[tt_is;'\input{'+diagr_is(j,2)+'_cos/'+diagr_is(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_is(j,2)+'_cos/' generate_diagr_tex_file(diagr_is(j,2),'guide',lang); end tt_fs=[]//fractional synthesizer for j=1:size(diagr_fs,1) tt_fs=[tt_fs;'\input{'+diagr_fs(j,2)+'_cos/'+diagr_fs(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_fs(j,2)+'_cos/' generate_diagr_tex_file(diagr_fs(j,2),'guide',lang); end tt_PSK=[]//PSK Transmission for j=1:size(diagr_PSK,1) tt_PSK=[tt_PSK;'\input{'+diagr_PSK(j,2)+'_cos/'+diagr_PSK(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_PSK(j,2)+'_cos/' generate_diagr_tex_file(diagr_PSK(j,2),'guide',lang); end tt_SD=[]//Sigma Delta Transmisson for j=1:size(diagr_SD,1) tt_SD=[tt_SD;'\input{'+diagr_SD(j,2)+'_cos/'+diagr_SD(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_SD(j,2)+'_cos/' generate_diagr_tex_file(diagr_SD(j,2),'guide',lang); end tt_FSK=[]//FSK Transmission tt_FSK_chaos=[]//FSK Chaos Transmission for j=1:size(diagr_FSK_chaos,1) tt_FSK_chaos=[tt_FSK_chaos;'\input{'+diagr_FSK_chaos(j,2)+'_cos/'+diagr_FSK_chaos(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_FSK_chaos(j,2)+'_cos/' generate_diagr_tex_file(diagr_FSK_chaos(j,2),'guide',lang); end tt_elec=[] //Electrical circuit for j=1:size(diagr_elec,1) tt_elec=[tt_elec;'\input{'+diagr_elec(j,2)+'_cos/'+diagr_elec(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+diagr_elec(j,2)+'_cos/' generate_diagr_tex_file(diagr_elec(j,2),'guide',lang); end tt_sim_chaos=[] //Simulations of chaotic systems for j=1:size(sim_chaos,1) tt_sim_chaos=[tt_sim_chaos;'\input{'+sim_chaos(j,2)+'/'+sim_chaos(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+sim_chaos(j,2)+'/' generate_sim_tex_file(sim_chaos(j,2),'guide',lang); end tt_sim_synthe=[] //Simulations of oscillators & Phase Locked Loop for j=1:size(sim_synthe,1) tt_sim_synthe=[tt_sim_synthe;'\input{'+sim_synthe(j,2)+'/'+sim_synthe(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+sim_synthe(j,2)+'/' generate_sim_tex_file(sim_synthe(j,2),'guide',lang); end tt_sim_PSK=[] //Simulations of communication systems for j=1:size(sim_PSK,1) tt_sim_PSK=[tt_sim_PSK;'\input{'+sim_PSK(j,2)+'/'+sim_PSK(j,2)+'}';'\pagebreak'] TEXINPUTS=TEXINPUTS+':./'+sim_PSK(j,2)+'/' generate_sim_tex_file(sim_PSK(j,2),'guide',lang); end tt_c=[]//general conclusion //main tex file if lang=='fr' then txt=[tt_head;'\title{\Huge Mod\_num\\Guide de l''utilisateur}']; else txt=[tt_head;'\title{\Huge Mod\_num\\User''s Guide}']; end txt=[txt tt_title tt_i tt_contents]; //%%%%%%%%%%%%%% //Scicos Diagram //%%%%%%%%%%%%%% if lang=='fr' then txt=[txt ' %%Diagrammes Scicos' ' \part{Diagrammes Scicos}']; else txt=[txt ' %%Scicos Diagrams' ' \part{Scicos Diagrams}']; end txt=[txt ' \null' ' \newpage' '']; //%%%%%%%%%%%%%% //Chaotic system if lang=='fr' then txt=[txt;' \chapter{Systèmes dynamiques chaotiques}']; else txt=[txt;' \chapter{Chaotic dynamical systems}']; end //Continous time systems if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Systèmes à temps continu}']; else txt=[txt;' \addcontentsline{toc}{chapter}{Continous time systems}']; end txt=[txt;" "+tt_cs]; //Discrete time systems if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Systèmes à temps discret}']; else txt=[txt;' \addcontentsline{toc}{chapter}{Discrete time systems}']; end txt=[txt;" "+tt_ds]; //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //Oscillators and Phase Locked Loop systems if lang=='fr' then txt=[txt;' \chapter{Oscillateurs et boucles à verrouillage de phase}']; else txt=[txt;' \chapter{Oscillators and Phase Locked Loop systems}']; end //Open loop models of oscillators if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Modèles boucle ouverte d''oscillateurs}']; else txt=[txt;' \addcontentsline{toc}{chapter}{Open loop models of oscillators}']; end txt=[txt;" "+tt_os]; //Integer N Frequency synthesizers if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Synthétiseurs de fréquence à rapport de division N entier}']; else txt=[txt;' \addcontentsline{toc}{chapter}{Integer N Frequency synthesizers}']; end txt=[txt;" "+tt_is]; //Fractional N/N+1 Frequency synthesizers if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Synthétiseurs de fréquence à rapport de division fractionnaire}']; else txt=[txt;' \addcontentsline{toc}{chapter}{Fractional N/N+1 Frequency synthesizers}']; end txt=[txt " "+tt_fs ' \addtocontents{toc}{\protect\pagebreak}']; //%%%%%%%%%%%%%%%%%%%%% //Communication systems if lang=='fr' then txt=[txt;' \chapter{Systèmes de communication}']; else txt=[txt;' \chapter{Communication systems}']; end //PSK/QAM Transmission if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Transmission PSK/QAM}']; else txt=[txt;' \addcontentsline{toc}{chapter}{PSK/QAM Transmission}']; end txt=[txt;" "+tt_PSK]; //Delta-Sigma Transmission if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Transmission Sigma-Delta}']; else txt=[txt;' \addcontentsline{toc}{chapter}{Delta-Sigma Transmission}']; end txt=[txt;" "+tt_SD]; //chaotic FSK Transmission if lang=='fr' then txt=[txt;' \addcontentsline{toc}{chapter}{Transmission chaotique FSK}']; else txt=[txt;' \addcontentsline{toc}{chapter}{FSK chaotic transmission}']; end txt=[txt;" "+tt_FSK_chaos]; //%%%%%%%%%%%%%%%%%%%%% //Electrical circuits if lang=='fr' then txt=[txt;' \chapter{Circuits électriques}']; else txt=[txt;' \chapter{Electrical circuits}']; end txt=[txt " "+tt_elec '' ' \setcounter{chapter}{0}']; //%%%%%%%%%%%%%%%%%%%%%%%%% //Simulation Scilab scripts //%%%%%%%%%%%%%%%%%%%%%%%%% if lang=='fr' then txt=[txt ' %%Scripts Scilab de simulations' ' \part{Scripts Scilab de simulations}']; else txt=[txt ' %%Simulation Scilab scripts' ' \part{Simulation Scilab scripts}']; end txt=[txt ' \null' ' \newpage' ''] // if lang=='fr' then txt=[txt;' \chapter{Simulations de systèmes chaotiques}']; else txt=[txt;' \chapter{Simulations of chaotic systems}']; end txt=[txt;" "+tt_sim_chaos]; // if lang=='fr' then txt=[txt;' \chapter{Simulations d''oscillateurs et de boucles à verrouillage de phase}']; else txt=[txt;' \chapter{Simulations of oscillators and Phase Locked Loops }']; end txt=[txt;" "+tt_sim_synthe]; // if lang=='fr' then txt=[txt;' \chapter{Simulations de systèmes de communication}']; else txt=[txt;' \chapter{Simulations of communication systems }']; end txt=[txt;" "+tt_sim_PSK;'\end{document}'] //Write final LaTeX File mputl(txt,'user.tex') /////////Compile/////////// //mv report.cls to current directory unix_g(cp_cmd+man_path+'tex/'+'report.cls'+' .') //define cmd latex_cmd='latex -interaction=nonstopmode user.tex '; export_cmd='export TEXINPUTS='+TEXINPUTS; divps_cmd='dvips -o user.ps user.dvi'; gv_cmd='gv user.ps'; //latex+dvips+gv new_tt=export_cmd+' ; '+latex_cmd+' ; '+latex_cmd+' ; '+latex_cmd+' ; '+divps_cmd+' ; '+gv_cmd; mputl(new_tt,'compile.sh'); unix_g('chmod a+x compile.sh'); pause unix_g('./compile.sh'); //ps2pdf ps2pdf_cmd='ps2pdf14 user.ps'; unix_g(ps2pdf_cmd); unix_g('cp user.pdf modnum_user.pdf') unix_g(mv_cmd+'./modnum_user.pdf '+pdf_path+lang+'/'); ////////////Clean/////////// //Erase template LaTeX file unix_g('rm -f user.*'); unix_g('rm -f compile.sh'); unix_g(rm_cmd+'report.cls'); //Erase diagram directories for j=1:size(diagr_cs,1) //continous system unix_g(rm_cmd+diagr_cs(j,2)+'_cos'); end for j=1:size(diagr_ds,1) //discrete system unix_g(rm_cmd+diagr_ds(j,2)+'_cos'); end for j=1:size(diagr_os,1) //Open loop models of oscillator unix_g(rm_cmd+diagr_os(j,2)+'_cos'); end for j=1:size(diagr_is,1) //integer synthesizer unix_g(rm_cmd+diagr_is(j,2)+'_cos'); end for j=1:size(diagr_fs,1) //fractional synthesizer unix_g(rm_cmd+diagr_fs(j,2)+'_cos'); end for j=1:size(diagr_PSK,1) //PSK Transmission unix_g(rm_cmd+diagr_PSK(j,2)+'_cos'); end for j=1:size(diagr_SD,1) //Sigma Delta Transmisson unix_g(rm_cmd+diagr_SD(j,2)+'_cos'); end for j=1:size(diagr_elec,1) //Electrical circuit unix_g(rm_cmd+diagr_elec(j,2)+'_cos'); end //Erase simulation script directories for j=1:size(sim_chaos,1) //Simulations of chaotic systems unix_g(rm_cmd+sim_chaos(j,2)); end for j=1:size(sim_synthe,1) //Simulations of oscillators & Phase Locked Loop unix_g(rm_cmd+sim_synthe(j,2)); end for j=1:size(sim_PSK,1) //Simulations of communication systems unix_g(rm_cmd+sim_PSK(j,2)); end elseif flag=='internal' then ///////////////// //Internal guide ///////////////// tt_i=[];//introduction tt_sce=[] //utilities scripts TEXINPUTS='$TEXINPUTS:.'; if sce_all<>[] then for j=1:size(sce_all,1) tt_sce=[tt_sce;'\input{'+sce_all(j,2)+'_sce/'+sce_all(j,2)+'}'] TEXINPUTS=TEXINPUTS+':./'+sce_all(j,2)+'_sce/'; generate_sce_tex_file(sce_all(j,2),'guide',lang); end end tt_util_sci=[]; //scilab utilities macros Librep=return_dir_in_dir(tt_ml,mac_path) for j=1:size(Librep,1) LibName=basename(part(Librep(j),1:length(Librep(j))-1)); if grep(LibName,lib_build)<>[] then tt_util_sci=[tt_util_sci;'\input{'+LibName+'_scilib/'+LibName+'}';]; TEXINPUTS=TEXINPUTS+':./'+LibName+'_scilib/'; generate_scilib_tex_file(LibName,'guide',lang); //Scilab function lisf=return_ext_file_in_dir(tt_ml,Librep(j),'.sci'); for i=1:size(lisf,1) name=basename(lisf(i,1)); generate_scifun_tex_file(name,'guide',lang); tt_util_sci=[tt_util_sci;'\input{'+name+'_sci/'+name+'}']; TEXINPUTS=TEXINPUTS+':./'+name+'_sci/'; end end end tt_doc_gen_sci=[]; //scilab documentation generator libraries Librep=return_dir_in_dir(tt_ml,mac_path) for j=1:size(Librep,1) LibName=basename(part(Librep(j),1:length(Librep(j))-1)); if grep(LibName,lib_gen_doc)<>[] then tt_doc_gen_sci=[tt_doc_gen_sci;'\input{'+LibName+'_scilib/'+LibName+'}';]; TEXINPUTS=TEXINPUTS+':./'+LibName+'_scilib/'; generate_scilib_tex_file(LibName,'guide',lang); //Scilab function lisf=return_ext_file_in_dir(tt_ml,Librep(j),'.sci'); for i=1:size(lisf,1) name=basename(lisf(i,1)); generate_scifun_tex_file(name,'guide',lang); tt_doc_gen_sci=[tt_doc_gen_sci;'\input{'+name+'_sci/'+name+'}']; TEXINPUTS=TEXINPUTS+':./'+name+'_sci/'; end end end tt_rout=[]; //low_level routine generate_scilib_tex_file(mod_num_rout_lib,'guide',lang); tt_rout=[tt_rout;'\input{'+mod_num_rout_lib+'_scilib/'+mod_num_rout_lib+'}';]; TEXINPUTS=TEXINPUTS+':./'+mod_num_rout_lib+'_scilib/'; lisf_rout=return_ext_file_in_dir(tt_ml,low_rout_path,".c") for i=1:size(lisf_rout,1) name=basename(lisf_rout(i,1)); generate_rout_tex_file(name,'guide',lang) tt_rout=[tt_rout;'\input{'+name+'_rout/'+name+'}']; TEXINPUTS=TEXINPUTS+':./'+name+'_rout/'; end tt_c=[]//conclusion //main tex file if lang=='fr' then txt=[tt_head;' \title{\Huge Mod\_num\\Guide interne}']; else txt=[tt_head;' \title{\Huge Mod\_num\\Internals Guide}']; end txt=[txt tt_title tt_i tt_contents]; if lang=='fr' then txt=[txt ' %%Scripts et macros Scilab utilitaires' ' \part{Scripts et macros Scilab utilitaires}']; else txt=[txt ' %%Utilities Scilab scripts and macros' ' \part{Utilities Scilab scripts and macros}';] end txt=[txt ' \null' ' \newpage' ''] if lang=='fr' then txt=[txt;' \chapter{Scripts Scilab utilitaires}']; else txt=[txt;' \chapter{Utilities Scilab scripts}']; end txt=[txt " "+tt_sce " "+tt_util_sci '' ' \setcounter{chapter}{0}']; if lang=='fr' then txt=[txt ' %%Librairies Scilab du générateur de documentation' ' \part{Librairies Scilab du générateur de documentation}']; else txt=[txt ' %%Documentation generator macro libraries' ' \part{Documentation generator macro libraries}']; end txt=[txt ' \null' ' \newpage' '' " "+tt_doc_gen_sci '' ' \newpage' ' \null' ' \newpage' ' \setcounter{chapter}{0}']; if lang=='fr' then txt=[txt ' %%Routines de calcul bas-niveau' ' \part{Routines de calcul bas-niveau}']; else txt=[txt ' %%Low level routines' ' \part{Low level routines}']; end txt=[txt ' \null' ' \newpage' ''] txt=[txt;" "+tt_rout;'\end{document}']; mputl(txt,'internals.tex') /////////Compile/////////// //mv report.cls to current directory unix_g(cp_cmd+man_path+'tex/'+'report.cls'+' .') //define cmd latex_cmd='latex -interaction=nonstopmode internals.tex '; export_cmd='export TEXINPUTS='+TEXINPUTS; divps_cmd='dvips -o internals.ps internals.dvi'; gv_cmd='gv internals.ps'; //latex+dvips+gv new_tt=export_cmd+' ; '+latex_cmd+' ; '+latex_cmd+' ; '+latex_cmd+' ; '+divps_cmd+' ; '+gv_cmd; mputl(new_tt,'compile.sh'); unix_g('chmod a+x compile.sh'); pause unix_g('./compile.sh'); //ps2pdf ps2pdf_cmd='ps2pdf14 internals.ps'; unix_g(ps2pdf_cmd); unix_g('cp internals.pdf modnum_internals.pdf') unix_g(mv_cmd+'./modnum_internals.pdf '+pdf_path+lang+'/'); ////////////Clean/////////// //Erase template LaTeX file unix_g('rm -f internals.*'); unix_g('rm -f compile.sh'); unix_g(rm_cmd+'report.cls'); //Erase scilab script tex file if sce_all<>[] then for j=1:size(sce_all,1) unix_g(rm_cmd+sce_all(j,2)+'_sce'); end end //Erase scilab macro tex files Librep=return_dir_in_dir(tt_ml,mac_path) for j=1:size(Librep,1) LibName=basename(part(Librep(j),1:length(Librep(j))-1)); if grep(LibName,lib_build)<>[] then unix_g(rm_cmd+LibName+'_scilib'); lisf=return_ext_file_in_dir(tt_ml,Librep(j),'.sci'); for i=1:size(lisf,1) name=basename(lisf(i,1)); unix_g(rm_cmd+name+'_sci'); end end end Librep=return_dir_in_dir(tt_ml,mac_path) //scilab documentation generator libraries for j=1:size(Librep,1) LibName=basename(part(Librep(j),1:length(Librep(j))-1)); if grep(LibName,lib_gen_doc)<>[] then unix_g(rm_cmd+LibName+'_scilib'); //Scilab function lisf=return_ext_file_in_dir(tt_ml,Librep(j),'.sci'); for i=1:size(lisf,1) name=basename(lisf(i,1)); unix_g(rm_cmd+name+'_sci'); end end end //Erase routine tex files unix_g(rm_cmd+mod_num_rout_lib+'_scilib'); for i=1:size(lisf_rout,1) name=basename(lisf_rout(i,1)); unix_g(rm_cmd+name+'_rout'); end end endfunction