diff options
| -rw-r--r-- | CHANGELOG | 1 | ||||
| -rw-r--r-- | lib/sisu/v0/texpdf_format.rb | 16 | 
2 files changed, 7 insertions, 10 deletions
| @@ -27,6 +27,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.69.0.orig.tar.gz      * url and urlbreaks line breaking fix      * better representation of tilde      * removal of a maths package gives back typeface changes like bold +    * landscape output, tables fixed    * middle layer, url representation changed, downstream code affected 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} | 
