texpdf, indent values, use formula (to replace table)
authorRalph Amissah <ralph@amissah.com>
Tue, 16 Jul 2019 15:36:47 +0000 (11:36 -0400)
committerRalph Amissah <ralph@amissah.com>
Thu, 18 Jul 2019 16:14:57 +0000 (12:14 -0400)
- values changed to work better with portrait a4 & letter

data/doc/sisu/CHANGELOG_v7
lib/sisu/texpdf_format.rb

index 0eb18e7f07f650fc9386f88d1dbf3816c423a5ca..47c647d955b09b884279f71f924ceb07c4c284a4 100644 (file)
@@ -25,6 +25,9 @@ Reverse Chronological:
 * sisu_7.1.12.orig.tar.xz (Open commit window: 2019-07-16; Pre-Release)
   http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_7.1.12
 
+  - texpdf, indent values, use formula (to replace table)
+    values changed to work better with portrait a4 & letter
+
 * sisu_7.1.11.orig.tar.xz (2017-07-14:28/5)
   http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_7.1.11
 
index 5549a24534b813dc9cd7864c250192a94b29f8e5..5c9d2c9d3f65d3962da838f929d0866c2c0cc597 100644 (file)
@@ -318,138 +318,9 @@ module SiSU_TeX_Pdf
       heading_sublevels(@dob)
     end
     def hang
-      case @dob.indent
-      when /0/
-        case @dob.hang
-        when /0/ then indent,hang='0mm', '0mm'
-        when /1/ then indent,hang='0mm','10mm'
-        when /2/ then indent,hang='0mm','20mm'
-        when /3/ then indent,hang='0mm','30mm'
-        when /4/ then indent,hang='0mm','40mm'
-        when /5/ then indent,hang='0mm','50mm'
-        when /6/ then indent,hang='0mm','60mm'
-        when /7/ then indent,hang='0mm','70mm'
-        when /8/ then indent,hang='0mm','80mm'
-        when /9/ then indent,hang='0mm','90mm'
-        end
-      when /1/
-        case @dob.hang
-        when /0/ then indent,hang='10mm','-10mm'
-        when /1/ then indent,hang='10mm',  '0mm'
-        when /2/ then indent,hang='10mm', '10mm'
-        when /3/ then indent,hang='10mm', '20mm'
-        when /4/ then indent,hang='10mm', '30mm'
-        when /5/ then indent,hang='10mm', '40mm'
-        when /6/ then indent,hang='10mm', '50mm'
-        when /7/ then indent,hang='10mm', '60mm'
-        when /8/ then indent,hang='10mm', '70mm'
-        when /9/ then indent,hang='10mm', '80mm'
-        end
-      when /2/
-        case @dob.hang
-        when /0/ then indent,hang='20mm','-20mm'
-        when /1/ then indent,hang='20mm','-10mm'
-        when /2/ then indent,hang='20mm',  '0mm'
-        when /3/ then indent,hang='20mm', '10mm'
-        when /4/ then indent,hang='20mm', '20mm'
-        when /5/ then indent,hang='20mm', '30mm'
-        when /6/ then indent,hang='20mm', '40mm'
-        when /7/ then indent,hang='20mm', '50mm'
-        when /8/ then indent,hang='20mm', '60mm'
-        when /9/ then indent,hang='20mm', '70mm'
-        end
-      when /3/
-        case @dob.hang
-        when /0/ then indent,hang='30mm','-30mm'
-        when /1/ then indent,hang='30mm','-20mm'
-        when /2/ then indent,hang='30mm','-10mm'
-        when /3/ then indent,hang='30mm',  '0mm'
-        when /4/ then indent,hang='30mm', '10mm'
-        when /5/ then indent,hang='30mm', '20mm'
-        when /6/ then indent,hang='30mm', '30mm'
-        when /7/ then indent,hang='30mm', '40mm'
-        when /8/ then indent,hang='30mm', '50mm'
-        when /9/ then indent,hang='30mm', '60mm'
-        end
-      when /4/
-        case @dob.hang
-        when /0/ then indent,hang='40mm','-40mm'
-        when /1/ then indent,hang='40mm','-30mm'
-        when /2/ then indent,hang='40mm','-20mm'
-        when /3/ then indent,hang='40mm','-10mm'
-        when /4/ then indent,hang='40mm',  '0mm'
-        when /5/ then indent,hang='40mm', '10mm'
-        when /6/ then indent,hang='40mm', '20mm'
-        when /7/ then indent,hang='40mm', '30mm'
-        when /8/ then indent,hang='40mm', '40mm'
-        when /9/ then indent,hang='40mm', '50mm'
-        end
-      when /5/
-        case @dob.hang
-        when /0/ then indent,hang='50mm','-50mm'
-        when /1/ then indent,hang='50mm','-40mm'
-        when /2/ then indent,hang='50mm','-30mm'
-        when /3/ then indent,hang='50mm','-20mm'
-        when /4/ then indent,hang='50mm','-10mm'
-        when /5/ then indent,hang='50mm',  '0mm'
-        when /6/ then indent,hang='50mm', '10mm'
-        when /7/ then indent,hang='50mm', '20mm'
-        when /8/ then indent,hang='50mm', '30mm'
-        when /9/ then indent,hang='50mm', '40mm'
-        end
-      when /6/
-        case @dob.hang
-        when /0/ then indent,hang='60mm','-60mm'
-        when /1/ then indent,hang='60mm','-50mm'
-        when /2/ then indent,hang='60mm','-40mm'
-        when /3/ then indent,hang='60mm','-30mm'
-        when /4/ then indent,hang='60mm','-20mm'
-        when /5/ then indent,hang='60mm','-10mm'
-        when /6/ then indent,hang='60mm',  '0mm'
-        when /7/ then indent,hang='60mm', '10mm'
-        when /8/ then indent,hang='60mm', '20mm'
-        when /9/ then indent,hang='60mm', '30mm'
-        end
-      when /7/
-        case @dob.hang
-        when /0/ then indent,hang='70mm','-70mm'
-        when /1/ then indent,hang='70mm','-60mm'
-        when /2/ then indent,hang='70mm','-50mm'
-        when /3/ then indent,hang='70mm','-40mm'
-        when /4/ then indent,hang='70mm','-30mm'
-        when /5/ then indent,hang='70mm','-20mm'
-        when /6/ then indent,hang='70mm','-10mm'
-        when /7/ then indent,hang='70mm',  '0mm'
-        when /8/ then indent,hang='70mm', '10mm'
-        when /9/ then indent,hang='70mm', '20mm'
-        end
-      when /8/
-        case @dob.hang
-        when /0/ then indent,hang='80mm','-80mm'
-        when /1/ then indent,hang='80mm','-70mm'
-        when /2/ then indent,hang='80mm','-60mm'
-        when /3/ then indent,hang='80mm','-50mm'
-        when /4/ then indent,hang='80mm','-40mm'
-        when /5/ then indent,hang='80mm','-30mm'
-        when /6/ then indent,hang='80mm','-20mm'
-        when /7/ then indent,hang='80mm','-10mm'
-        when /8/ then indent,hang='80mm',  '0mm'
-        when /9/ then indent,hang='80mm', '10mm'
-        end
-      when /9/
-        case @dob.hang
-        when /0/ then indent,hang='90mm','-90mm'
-        when /1/ then indent,hang='90mm','-80mm'
-        when /2/ then indent,hang='90mm','-70mm'
-        when /3/ then indent,hang='90mm','-60mm'
-        when /4/ then indent,hang='90mm','-50mm'
-        when /5/ then indent,hang='90mm','-40mm'
-        when /6/ then indent,hang='90mm','-30mm'
-        when /7/ then indent,hang='90mm','-20mm'
-        when /8/ then indent,hang='90mm','-10mm'
-        when /9/ then indent,hang='90mm',  '0mm'
-        end
-      end
+      _idt=10
+      indent = "#{_idt*(@dob.indent.to_i-1)}mm"
+      hang =  "#{_idt*(@dob.hang.to_i - @dob.indent.to_i)}mm"
       "\\begin{ParagraphHang}{#{indent}}{#{hang}}#{@dob.tmp} \\end{ParagraphHang}}"
     end
     def indent