summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2019-07-16 15:36:47 +0000
committerRalph Amissah <ralph@amissah.com>2019-07-18 16:14:57 +0000
commit7ef0238f4ffd4eb5a669ecd4bf83735a93f80db5 (patch)
treea13467f1a2358d303b559f6cf941514a49fee627 /lib
parentchangelogs cosmetic substitution (org-mode) (diff)
downloadsisu-7ef0238f4ffd4eb5a669ecd4bf83735a93f80db5.zip
sisu-7ef0238f4ffd4eb5a669ecd4bf83735a93f80db5.tar.xz
texpdf, indent values, use formula (to replace table)
- values changed to work better with portrait a4 & letter
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/texpdf_format.rb135
1 files changed, 3 insertions, 132 deletions
diff --git a/lib/sisu/texpdf_format.rb b/lib/sisu/texpdf_format.rb
index 5549a24..5c9d2c9 100644
--- a/lib/sisu/texpdf_format.rb
+++ b/lib/sisu/texpdf_format.rb
@@ -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