aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-08-27 23:38:37 -0400
committerRalph Amissah <ralph@amissah.com>2008-08-27 23:38:37 -0400
commit602a7b497284baa85bac466ba5c4e28ec9e7c554 (patch)
tree862b8adcce67e82ab7a456396ae496dba5b66bec /lib
parenttexpdf: (diff)
texpdf: landscape tables in two column text fixed; footnote margin increased
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v0/texpdf_format.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index 58dca26e..b193a345 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -124,7 +124,6 @@ module SiSU_TeX_Pdf
@@tableheader[@ps][:l]=1 if @txt =~/#{Mx[:gr_o]}Th/
w=cols_width.split(/;\s*/)
@@number_of_cols=no_of_cols ||=@@number_of_cols
- #@@number_of_cols=0 unless @@number_of_cols.to_i > 0
@colW=[]
@colW << '{'
w.each do |x|
@@ -137,7 +136,7 @@ module SiSU_TeX_Pdf
@colW=@colW.join
@start_table="#{Mx[:id_o]}~#{ocn}#{Mx[:id_c]}\n\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" +
"\\begin{tiny}\n\\begin{longtable}#@colW\n"
- @txt.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:tc_p]}\\~\d+;\w\d+;\w\d+#{Mx[:gr_c]}/u,@start_table)
+ @txt.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:tc_p]}\\~\d+;\w\d+;\w\d+#{Mx[:gr_c]}/u,"#@start_table")
end
if @txt =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/
@txt.gsub!(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/," #@end_table\n\\end{tiny}")
@@ -151,11 +150,10 @@ module SiSU_TeX_Pdf
@txt.gsub!(/&\s*$/," #@row_break \\hline\\endhead #@row_break")
@txt="#@txt \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot
@@tableheader[@ps][:l]=0
- #@@tableheader[@ps][:l],@@number_of_cols=0,0
end
else
if @txt =~/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|#{Mx[:tc_c]})/u
- @txt.gsub!(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u,'\1&')
+ @txt.gsub!(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|#{Mx[:tc_c]})/u,'\1&')
@txt.gsub!(/&\s*$/," #@row_break")
end
end
@@ -184,8 +182,7 @@ module SiSU_TeX_Pdf
@colW << '{'
w.each do |x|
x.strip!
- x=(x.to_i * textwidth)/100
- #x=(x.to_i/100.0 * 160)
+ x=(x.to_i * textwidth)/100 #x=(x.to_i/100.0 * 160)
col_w=x.to_s # x.gsub(/.+/,'l\|') #unless x.nil?
@colW << "p{#{col_w}mm}" if col_w
end
@@ -193,21 +190,20 @@ module SiSU_TeX_Pdf
@colW=@colW.join
@start_table="#{Mx[:id_o]}~#{ocn}#{Mx[:id_c]}\n\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" +
"\\begin{tiny}\n\\begin{longtable}#@colW\n"
- @txt.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:tc_p]}\\~\d+;\w\d+;\w\d+#{Mx[:gr_c]}/u,"#@start_table")
+ @txt.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:tc_p]}\\~\d+;\w\d+;\w\d+#{Mx[:gr_c]}/u,@start_table)
end
if @txt =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/
@txt.gsub!(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/," #@end_table\n\\end{tiny}")
end
@txt.gsub!(/#{Mx[:tc_o]}#{Mx[:tc_p]}/u,'')
if @@tableheader[@ps][:p] == 1
- if @txt =~/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u
+ if @txt =~/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|#{Mx[:tc_p]})/u
tablefoot=@txt[/\<!f(.+?)!\>/,1]
@txt.gsub!(/\<!f(.+?)!\>/,'')
@txt.gsub!(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|#{Mx[:tc_c]})/u,'\bfseries \1&')
@txt.gsub!(/&\s*$/," #@row_break \\hline\\endhead #@row_break")
@txt="#@txt \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot
@@tableheader[@ps][:p]=0
- #@@tableheader[@ps][:p],@@number_of_cols=0,0
end
else
if @txt =~/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|#{Mx[:tc_c]})/u
@@ -904,7 +900,7 @@ WOK
\\makeatletter
#{endnotes}
\\usepackage[multiple,marginal]{footmisc}
-% \\setlength\\footnotemargin{40pt}
+\\setlength\\footnotemargin{-20pt}
\\usepackage[para]{manyfoot}
\\DeclareNewFootnote{A}
%\\DeclareNewFootnote[para]{A}