aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/texpdf.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
committerRalph Amissah <ralph@amissah.com>2011-03-01 20:41:28 -0500
commit05a3fd233ec1ac4475bd797449d1284f6824c005 (patch)
treefdd93c057196640ec4907f58f66cf5bc00dfbdf6 /lib/sisu/v3/texpdf.rb
parentv3: use rb1.9.2 "require_relative" syntax (diff)
v3: ruby 1.9 hash symbol syntax adopted
Diffstat (limited to 'lib/sisu/v3/texpdf.rb')
-rw-r--r--lib/sisu/v3/texpdf.rb72
1 files changed, 36 insertions, 36 deletions
diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb
index 0843f22f..31300f8f 100644
--- a/lib/sisu/v3/texpdf.rb
+++ b/lib/sisu/v3/texpdf.rb
@@ -265,12 +265,12 @@ module SiSU_TeX
end
class LaTeX_create
@@tex_head={
- 'a4'=> {:p => nil, :l => nil},
- 'a5'=> {:p => nil, :l => nil},
- 'b5'=> {:p => nil, :l => nil},
- 'letter'=>{:p => nil, :l => nil},
- 'legal'=> {:p => nil, :l => nil},
- 'book'=> {:p => nil, :l => nil}
+ 'a4'=> { p: nil, l: nil },
+ 'a5'=> { p: nil, l: nil },
+ 'b5'=> { p: nil, l: nil },
+ 'letter'=>{ p: nil, l: nil },
+ 'legal'=> { p: nil, l: nil },
+ 'book'=> { p: nil, l: nil }
}
@@prefix_b=nil
def initialize(particulars)
@@ -278,7 +278,7 @@ module SiSU_TeX
@md=@particulars.md
@env=SiSU_Env::Info_env.new(@md.fns) #@env=@particulars.env
@data=@particulars.dal_array # dal file drawn here
- @st={ :tex=>{} }
+ @st={ tex: {} }
@tex_ml=SiSU_TeX_Pdf::Use_TeX.new(@md)
@vz=SiSU_Env::Get_init.instance.skin
@dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
@@ -373,14 +373,14 @@ module SiSU_TeX
@block={}
@dob=dob
@md.papersize_array.each do |ps|
- @@tableheader={ ps => { :p => 0, :l => 0 }}
- dob.tmp={:tmp =>dob.tmp,:paper_size =>ps}
+ @@tableheader={ ps => { p: 0, l: 0 } }
+ dob.tmp={ tmp: dob.tmp, paper_size: ps }
format_l=SiSU_TeX_Pdf::Format_text_object.new(md,dob)
- dob.tmp={:tmp =>dob.tmp,:paper_size =>ps}
+ dob.tmp={ tmp: dob.tmp, paper_size: ps }
format_p=SiSU_TeX_Pdf::Format_text_object.new(md,dob)
@block[ps]={
- :l => format_l.longtable_landscape,
- :p => format_p.longtable_portrait
+ l: format_l.longtable_landscape,
+ p: format_p.longtable_portrait
}
end
@dob.tmp=@block
@@ -403,7 +403,7 @@ module SiSU_TeX
end
def markup_common(dob)
tex_f=nil
- txt_obj={:dal =>dob}
+ txt_obj={ dal: dob }
if dob.of=='block'
@lineone=case dob.is
when /block|group|alt|verse/
@@ -499,7 +499,7 @@ module SiSU_TeX
'\begin{multicols}{2}' + br +
idx_str + br +
'\end{multicols}'
- dob.tmp={:l =>l,:p =>p}
+ dob.tmp={ l: l, p: p }
elsif dob.ln==2 \
and dob.obj=~/Metadata\b/
tst.heading_major
@@ -508,7 +508,7 @@ module SiSU_TeX
h=tst.level4
metadata=Metadata::TeX_metadata.new(@md).metadata_tex
dob.tmp=h.tmp + ' ' + '\begin{scriptsize}' + metadata.join(br) + '\end{scriptsize}'
- else dob.tmp='' # dob.tmp={:l =>'',:p =>''}
+ else dob.tmp='' # dob.tmp={ l: '', p: '' }
end
when 'para'
if dob.bullet_
@@ -557,9 +557,9 @@ module SiSU_TeX
home=@vz.txt_home.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex
title=@md.title.full.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex
@md.papersize_array.each do |ps|
- txt_obj={:txt =>"#{home}: - #{title}",:paper_size =>ps,:orientation =>'portrait'}
+ txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: 'portrait' }
orient_portrait=SiSU_TeX_Pdf::Format_head.new(@md,txt_obj)
- txt_obj={:txt =>"#{home}: - #{title}",:paper_size =>ps,:orientation =>'landscape'}
+ txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: 'landscape' }
orient_landscape=SiSU_TeX_Pdf::Format_head.new(@md,txt_obj)
@@tex_head[ps][:p]=orient_portrait.document_head_with_orientation
@@tex_head[ps][:l]=orient_landscape.document_head_with_orientation
@@ -587,7 +587,7 @@ WOK
end
@copymark='' #check and remove as now is superflous
x={}
- txt_obj={:title =>@md.title.full}
+ txt_obj={ title: @md.title.full }
x[:l]=SiSU_TeX_Pdf::Format_text_object.new(@md,txt_obj).title_landscape
x[:p]=SiSU_TeX_Pdf::Format_text_object.new(@md,txt_obj).title_portrait
@tex_file << x
@@ -653,8 +653,8 @@ WOK
if dob.tmp[ps]
if (dob.tmp[ps][:p] and dob.tmp[ps][:l])
dob.tmp[ps]={
- :p => markup_common(dob.tmp[ps][:p]),
- :l => markup_common(dob.tmp[ps][:l])
+ p: markup_common(dob.tmp[ps][:p]),
+ l: markup_common(dob.tmp[ps][:l])
}
else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
end
@@ -663,8 +663,8 @@ WOK
elsif dob.tmp.class==Hash \
and (dob.tmp[:p] and dob.tmp[:l])
dob = {
- :p => markup_common(dob.tmp[:p]),
- :l => markup_common(dob.tmp[:l])
+ p: markup_common(dob.tmp[:p]),
+ l: markup_common(dob.tmp[:l])
}
else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
end
@@ -721,8 +721,8 @@ WOK
if defined? dob.tmp and dob.tmp[ps]
if (dob.tmp[ps][:p] and dob.tmp[ps][:l])
para_hash[ps]={
- :p => number_paras_numbering(dob.tmp[ps][:p]),
- :l => number_paras_numbering(dob.tmp[ps][:l])
+ p: number_paras_numbering(dob.tmp[ps][:p]),
+ l: number_paras_numbering(dob.tmp[ps][:l])
}
dob.tmp=para_hash
else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
@@ -731,8 +731,8 @@ WOK
end
elsif (dob.tmp[:p] and dob.tmp[:l])
dob.tmp = {
- :p => number_paras_numbering(dob.tmp[:p]),
- :l => number_paras_numbering(dob.tmp[:l])
+ p: number_paras_numbering(dob.tmp[:p]),
+ l: number_paras_numbering(dob.tmp[:l])
}
else p "#{__FILE__}:#{__LINE__}" if @md.cmd.inspect =~/M/
end
@@ -780,8 +780,8 @@ WOK
fns_l=@md.fns.gsub(/~/,'-') #this is a sorry fix, but necessary as it appears latex programs like not ~
@md.papersize_array.each do |ps|
file={
- :landscape =>File.new("#{@env.path.processing_tex}/#{fns_l}.#{ps}.landscape.tex",'w+'),
- :portrait =>File.new("#{@env.path.processing_tex}/#{fns_l}.#{ps}.tex",'w+')
+ landscape: File.new("#{@env.path.processing_tex}/#{fns_l}.#{ps}.landscape.tex",'w+'),
+ portrait: File.new("#{@env.path.processing_tex}/#{fns_l}.#{ps}.tex",'w+')
}
file[:portrait] << @@tex_head[ps][:p]
file[:landscape] << @@tex_head[ps][:l]
@@ -805,10 +805,10 @@ WOK
file[:landscape].puts morph.tmp,"\n"
end
elsif morph.class==Hash #inserted headers and the like, only
- h={:ps =>ps,:h =>morph,:filename =>file}
+ h={ ps: ps, h: morph, filename: file }
output_morph_hash(h)
elsif morph.tmp.class==Hash #tables & images?
- h={:ps =>ps,:h =>morph.tmp,:filename =>file}
+ h={ ps: ps, h: morph.tmp, filename: file }
output_morph_hash(h)
end
end
@@ -817,12 +817,12 @@ WOK
file[:landscape].close
end
@@tex_head={
- 'a4'=> {:p => nil, :l => nil},
- 'a5'=> {:p => nil, :l => nil},
- 'b5'=> {:p => nil, :l => nil},
- 'letter'=>{:p => nil, :l => nil},
- 'legal'=> {:p => nil, :l => nil},
- 'book'=> {:p => nil, :l => nil}
+ 'a4'=> { p: nil, l: nil },
+ 'a5'=> { p: nil, l: nil },
+ 'b5'=> { p: nil, l: nil },
+ 'letter'=>{ p: nil, l: nil },
+ 'legal'=> { p: nil, l: nil },
+ 'book'=> { p: nil, l: nil }
}
array=[]
end