From 44464e284ee840ee0ef7eae2d3f8d589680b18ca Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 19 Apr 2011 21:37:52 -0400 Subject: v3: param, md remove md.cmd and md.mod shortcut methods, use use md.opt * affects many files that now use @md.opt.cmd & @md.opt.mod (instead of @md.cmd & @md.mod) --- lib/sisu/v3/texpdf.rb | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'lib/sisu/v3/texpdf.rb') diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 9497d51f..42c565b7 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -110,7 +110,7 @@ module SiSU_TeX SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{@md.file.output_path.pdf}/#{@md.file.base_filename.pdf_p}pdf").flow end @md=@particulars.md - $flag=@md.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format + $flag=@md.opt.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format directories #% needed needs to be reprogrammed !!! SiSU_Env::Info_skin.new(@md).select @@ -153,24 +153,24 @@ module SiSU_TeX def latex_do(texfilename,papersize) @texfilename=texfilename @@n_lpdf=@@n_lpdf+1 - SiSU_Screen::Ansi.new(@md.cmd,"#{papersize} portrait ->").dark_grey_title_hi if @md.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@md.opt.cmd,"#{papersize} portrait ->").dark_grey_title_hi if @md.opt.cmd =~/[MVv]/ tex_fn_base=@texfilename.gsub(/\.tex$/,'') - cmd=SiSU_Env::System_call.new("#{tex_fn_base}.tex",'',@md.cmd) - tell=SiSU_Screen::Ansi.new(@md.cmd) - tell.grey_open if @md.cmd =~/[MVv]/ + cmd=SiSU_Env::System_call.new("#{tex_fn_base}.tex",'',@md.opt.cmd) + tell=SiSU_Screen::Ansi.new(@md.opt.cmd) + tell.grey_open if @md.opt.cmd =~/[MVv]/ if "#{tex_fn_base}" =~/\w+/ \ and "#{papersize}" =~/\w+/ 2.times { |i| cmd.latex2pdf(@md,papersize) } #comment out to skip processing of latex portrait end - tell.p_off if @md.cmd =~/[MVv]/ - SiSU_Screen::Ansi.new(@md.cmd,"#{papersize} landscape ->").dark_grey_title_hi if @md.cmd =~/[MVv]/ - cmd=SiSU_Env::System_call.new("#{tex_fn_base}.landscape.tex",'',@md.cmd) - tell.grey_open if @md.cmd =~/[MVv]/ + tell.p_off if @md.opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@md.opt.cmd,"#{papersize} landscape ->").dark_grey_title_hi if @md.opt.cmd =~/[MVv]/ + cmd=SiSU_Env::System_call.new("#{tex_fn_base}.landscape.tex",'',@md.opt.cmd) + tell.grey_open if @md.opt.cmd =~/[MVv]/ if "#{tex_fn_base}" =~/\w+/ \ and "#{papersize}" =~/\w+/ 2.times { |i| cmd.latex2pdf(@md,papersize) } #comment out to skip processing of latex landscape end - tell.p_off if @md.cmd =~/[MVv]/ + tell.p_off if @md.opt.cmd =~/[MVv]/ pwd=Dir.pwd portrait_pdf="#{pwd}/#{tex_fn_base}.pdf" landscape_pdf="#{pwd}/#{tex_fn_base}.landscape.pdf" @@ -186,14 +186,14 @@ module SiSU_TeX if FileTest.file?(portrait_pdf) cp(portrait_pdf,"#{@md.file.output_path.pdf}/#{pdf_p}") rm(portrait_pdf) - else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.opt.cmd.inspect =~/M/ end if FileTest.file?(landscape_pdf) cp(landscape_pdf,"#{@md.file.output_path.pdf}/#{pdf_l}") rm(landscape_pdf) - else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.opt.cmd.inspect =~/M/ end - SiSU_Screen::Ansi.new(@md.cmd,@@n_lpdf,'processed (SiSU LaTeX to pdf - using pdfetex aka. pdftex or pdflatex)').generic_number if @md.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@md.opt.cmd,@@n_lpdf,'processed (SiSU LaTeX to pdf - using pdfetex aka. pdftex or pdflatex)').generic_number if @md.opt.cmd =~/[MVv]/ end def latexrun_selective begin @@ -213,7 +213,7 @@ module SiSU_TeX if File.exist?(texfile) \ and File.size(texfile) > 0 @tex_f_no+=1 - #p "#{__FILE__}:#{__LINE__} texpdf generation disabled" if @md.cmd.inspect =~/M/ #%% disable temporarily, re-enable + #p "#{__FILE__}:#{__LINE__} texpdf generation disabled" if @md.opt.cmd.inspect =~/M/ #%% disable temporarily, re-enable latex_do(texfile,ps) else puts "\tzero file size #{@env.processing_path.tex}/#{texfile}" @@ -255,11 +255,11 @@ module SiSU_TeX ") end else - SiSU_Screen::Ansi.new(@md.cmd,"FILE NOT FOUND: << #{@md.fns} >> - requested latex system processing skipped").warn + SiSU_Screen::Ansi.new(@md.opt.cmd,"FILE NOT FOUND: << #{@md.fns} >> - requested latex system processing skipped").warn end lst=Dir["*.{aux,log,out}"] lst.each {|file| File.unlink(file)} if lst - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error + rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error end end end @@ -295,7 +295,7 @@ module SiSU_TeX data=@data @@tex_footnote_array=[] @@rights=nil - SiSU_Screen::Ansi.new(@md.cmd,"pdfTex portrait & landscape").txt_grey if @md.cmd=~/[MVvz]/ + SiSU_Screen::Ansi.new(@md.opt.cmd,"pdfTex portrait & landscape").txt_grey if @md.opt.cmd=~/[MVvz]/ if defined? @md.rights.all \ and not @md.rights.all.empty? rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed @@ -319,7 +319,7 @@ module SiSU_TeX data=tables(data) #uncomment to start experimenting with tables end ocn=if @md.markup.inspect =~/no_ocn/ \ - or @md.mod.inspect =~/--no-ocn/ \ + or @md.opt.mod.inspect =~/--no-ocn/ \ or @skin_no_ocn false else true @@ -327,7 +327,7 @@ module SiSU_TeX data=number_paras(data) data=markup(data) output(data) - rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error + rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error ensure end end @@ -656,7 +656,7 @@ WOK p: markup_common(dob.tmp[ps][:p]), l: markup_common(dob.tmp[ps][:l]) } - else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/ end end end @@ -666,7 +666,7 @@ WOK p: markup_common(dob.tmp[:p]), l: markup_common(dob.tmp[:l]) } - else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/ end end @tex_file << dob @@ -690,7 +690,7 @@ WOK paranum=dob.ocn ? dob.ocn : '' paranum = '' if paranum.to_i==0 paranumber_display=if @md.markup.inspect =~/no_ocn/ \ - or @md.mod.inspect =~/--no-ocn/ \ + or @md.opt.mod.inspect =~/--no-ocn/ \ or not dob.ocn_ '' else @@ -725,7 +725,7 @@ WOK l: number_paras_numbering(dob.tmp[ps][:l]) } dob.tmp=para_hash - else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/ end end end @@ -734,7 +734,7 @@ WOK p: number_paras_numbering(dob.tmp[:p]), l: number_paras_numbering(dob.tmp[:l]) } - else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/ end else dob=if dob.of !~/comment|meta|layout/ @@ -770,7 +770,7 @@ WOK if h[:l] !~/\A\s*\Z/ fn[:landscape].puts h[:l],"\n" end - else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__}" if @md.opt.cmd.inspect =~/M/ end end def output(array) -- cgit v1.2.3