diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v0/texpdf.rb | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb index facd3008..1e5375af 100644 --- a/lib/sisu/v0/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -58,12 +58,12 @@ =end module SiSU_TeX require 'pstore' - require "#{SiSU_lib}/defaults" - include SiSU_Viz - require "#{SiSU_lib}/particulars" - include SiSU_Particulars - require "#{SiSU_lib}/texpdf_format" - include SiSU_TeX_Pdf + require "#{SiSU_lib}/defaults" # defaults.rb + include SiSU_Viz + require "#{SiSU_lib}/particulars" # particulars.rb + include SiSU_Particulars + require "#{SiSU_lib}/texpdf_format" # texpdf_format.rb + include SiSU_TeX_Pdf @tex_file=@@tex_footnote_array=@@tex_col_w=[] @@tex_backslash ||="\\\\" @@tilde='\\\\\\~' #?? debug crazy @@ -71,16 +71,15 @@ module SiSU_TeX @@column_instruct=@@squigle_close=@@tex_line_mode=@@tex_word_mode=@@line_mode='' @@tex_debug_counter=@@table_pagebreak_counter=@@tex_footnote_call_counter=@@tex_table_flag=@@tex_counter=@@tex_column=@@tex_columns=@@tex_columns=@@counting=0 @@tex_pattern_margin_number=/\\\\begin\\\{tiny\\\}\\\\hspace\\\{0mm\\\}\\\\end\\\{tiny\\\}\\\{\\\\marginpar.+?\s+/ - #@@tex_pattern_margin_number="\\\\marginpar.+?\s+" @@n=@@tableheader=@@rights=nil @@date ||=SiSU_Env::Info_date.new class Source #Songsheet #<SiSU_Param::MyFiles require 'pstore' - require "#{SiSU_lib}/sysenv" - include SiSU_Env + require "#{SiSU_lib}/sysenv" # sysenv.rb + include SiSU_Env include SiSU_Viz - require "#{SiSU_lib}/dal" - include SiSU_DAL + require "#{SiSU_lib}/dal" # dal.rb + include SiSU_DAL include SiSU_TeX def initialize(opt) @opt=opt @@ -109,10 +108,12 @@ module SiSU_TeX tell=SiSU_Screen::Ansi.new(@opt.cmd,'LaTeX/PDF') tell.green_title_hi unless @opt.cmd =~/q/ path=@env.url.output_tell - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{path}/#{@md.fnb}/#{@md.fn[:pdf_l]}") - tell.flow if @opt.cmd =~/[MVv]/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{path}/#{@md.fnb}/#{@md.fn[:pdf_p]}") - tell.flow if @opt.cmd =~/[MVv]/ + if @opt.cmd =~/[MVv]/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{path}/#{@md.fnb}/#{@md.fn[:pdf_l]}") + tell.flow + tell=SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@env.program.pdf_viewer} #{path}/#{@md.fnb}/#{@md.fn[:pdf_p]}") + tell.flow + end @md=@particulars.md SiSU_Env::Create_file.new(@opt.cmd,@opt.fns) $flag=@md.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format @@ -198,7 +199,7 @@ module SiSU_TeX if FileTest.file?(landscape_pdf) cp(landscape_pdf,"#@dir_sisu/#{@md.fnb}/#{pdf_l}") rm(landscape_pdf) - else p "here #{__FILE__} #{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.cmd.inspect =~/M/ + else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.cmd.inspect =~/M/ end tell=SiSU_Screen::Ansi.new(@md.cmd,@@n_lpdf,'processed (SiSU LaTeX to pdf - using pdfetex aka. pdftex or pdflatex)') tell.generic_number unless @md.cmd =~/q/ @@ -365,7 +366,6 @@ module SiSU_TeX @tex_file=[] data.each do |para| # EMBEDDED FOOTNOTES / ENDNOTES should be straightforward but not quite a synch. - footnote=[] if para =~/#{Mx[:en_a_o]}[\d*+]+\s|#{Mx[:en_b_o]}([*+]\d+)\s/ # note escape not necessary in front of ~ has implications for many other matches #debug note para.gsub!(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:id_o]}#@dp#{Mx[:id_c]}#{Mx[:en_a_c]}/m,"\\footnote[\\1]{%\n \\2} ") #removed space before \\footnote 2004w21, watch para.gsub!(/#{Mx[:en_b_o]}([*+]\d+)\s+(.+?)#{Mx[:id_o]}#@dp#{Mx[:id_c]}#{Mx[:en_b_c]}/m,"\\FootnoteA{\\1}{%\n \\2} ") #work on asterisk footnotes @@ -450,7 +450,6 @@ module SiSU_TeX else '' end para.gsub!(regx,'') - #@group_collect.each{ |x| x.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ') } group_collect=[] group_collect << '\begin{footnotesize} ' unless @@flag_code @group_collect.each do |x| @@ -461,7 +460,6 @@ module SiSU_TeX group_collect << ' \end{footnotesize} ' unless @@flag_code @group_collect=group_collect.flatten @lineone.gsub!(/(<:\S+>|#{Mx[:fa_o]}.*?#{Mx[:fa_c]}|#{Mx[:gr_o]}.*?#{Mx[:gr_c]}|<!.*?!>|<!>)/,' ') - #@group_collect.each{ |x| x.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ') } insert=[] insert=if para =~/#{Mx[:gr_o]}code-end#{Mx[:gr_c]}/m insert << y + @lineone << @group_collect << ' \end{scriptsize}' << " #{@tex.paraskip_normal}" @@ -470,14 +468,10 @@ module SiSU_TeX para.gsub!(/(<:\S+>|#{Mx[:fa_o]}.*?#{Mx[:fa_c]}|#{Mx[:gr_o]}.*?#{Mx[:gr_c]}|<!.*?!>|<!>)/,' ') @@flag_alt,@@flag_group,@@flag_code=false,false,false @group_collect=[] - #@tex_file << insert.flatten tex_f=insert.flatten end para=tex_f else - #if para =~ /\}(?:https?|file|ftp)/ - # para=mono.http #(@orientation) - #end case para when /^#{Mx[:lv_o_1]}/; mono.level1 when /^#{Mx[:lv_o_2]}/; mono.level2 @@ -551,9 +545,6 @@ WOK sisu_rc_footnote=if @md.sc_info; @tex.doc_sc_info_footnote_full else @tex.doc_sc_info_footnote_brief end - #@copymark=if @md.author_copymark; '^\copyright' - #else '' - #end @copymark='' #check and remove as now is superflous x={} txt_obj={:title =>@md.title,:subtitle =>@md.subtitle} |