aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-05-12 21:38:34 -0400
committerRalph Amissah <ralph@amissah.com>2014-05-12 21:38:34 -0400
commit1716ccd079dc399190804ede2b2b08bf19c0a3b3 (patch)
treecb3d85b7e24737aef64a84599afc6c5754d370ba
parentv6: param, metadata rights, line-breaks instead of semicolons separating rights (diff)
v6: texpdf, (internal coding) use symbols to identify page orientation
-rw-r--r--data/doc/sisu/CHANGELOG_v62
-rw-r--r--lib/sisu/v6/texpdf.rb16
-rw-r--r--lib/sisu/v6/texpdf_format.rb21
3 files changed, 21 insertions, 18 deletions
diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6
index 26f2bcef..0643255a 100644
--- a/data/doc/sisu/CHANGELOG_v6
+++ b/data/doc/sisu/CHANGELOG_v6
@@ -51,6 +51,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz
* rcconf.yml ['defsault']['digest'] = sha512
(Closes: #744402)
+* texpdf, (internal coding) use symbols to identify page orientation
+
* added sisu.org emacs:evil:org mode notes related to sisu development
%% 6.0.4.orig.tar.xz (2014-02-14:06/5)
diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb
index 97961701..b3636154 100644
--- a/lib/sisu/v6/texpdf.rb
+++ b/lib/sisu/v6/texpdf.rb
@@ -746,12 +746,12 @@ module SiSU_TeX
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|
if @md.opt.act[:pdf_p][:set]==:on
- 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::FormatHead.new(@md,txt_obj)
@@tex_head[ps][:p]=orient_portrait.document_head_with_orientation(@codeblock_box)
end
if @md.opt.act[:pdf_l][:set]==:on
- 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::FormatHead.new(@md,txt_obj)
@@tex_head[ps][:l]=orient_landscape.document_head_with_orientation(@codeblock_box)
end
@@ -843,30 +843,30 @@ module SiSU_TeX
\\renewcommand{\\contentsname}{#{@translate.contents}}
\\tableofcontents
WOK
- toc_pb={ l: @tex_ml.newpage('landscape'), p: @tex_ml.newpage('portrait') }
+ toc_pb={ l: @tex_ml.newpage(:landscape), p: @tex_ml.newpage(:portrait) }
else
toc=''
toc_pb={ l: '', p: '' }
end
if @md.opt.act[:pdf_l][:set]==:on
x[:l] =<<-WOK
-#{@tex_ml.newpage('landscape')}
+#{@tex_ml.newpage(:landscape)}
\\pagestyle{fancy}
#{toc}#{toc_pb[:l]}
\\pagenumbering{arabic}
#{@tex_ml.paraskip_normal}
-#{@tex_ml.newpage('landscape')}
+#{@tex_ml.newpage(:landscape)}
WOK
end
if @md.opt.act[:pdf_p][:set]==:on
x[:p] =<<-WOK
-#{@tex_ml.newpage('portrait')}
+#{@tex_ml.newpage(:portrait)}
\\pagestyle{fancy}
#{toc}#{toc_pb[:p]}
-#{@tex_ml.newpage('portrait')}
+#{@tex_ml.newpage(:portrait)}
\\pagenumbering{arabic}
#{@tex_ml.paraskip_normal}
-#{@tex_ml.newpage('portrait')}
+#{@tex_ml.newpage(:portrait)}
WOK
end
@tex_file << x
diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb
index c1bd0f1c..ea5f383f 100644
--- a/lib/sisu/v6/texpdf_format.rb
+++ b/lib/sisu/v6/texpdf_format.rb
@@ -920,7 +920,7 @@ module SiSU_TeX_Pdf
def tex_head_paper_dimensions
d={}
case @layout
- when /portrait/
+ when :portrait
d[:papertype],d[:fontsize]='a4paper','11pt'
d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='0mm','0mm','-12pt'
d[:headheight],d[:headsep],d[:columnsep]='12pt','35pt',''
@@ -950,7 +950,7 @@ module SiSU_TeX_Pdf
d[:papertype],d[:fontsize]='a4paper','12pt'
d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w
end
- when /landscape/
+ when :landscape
d[:papertype],d[:fontsize]='a4paper','11pt'
d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='6mm','6mm','-12mm'
d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt'
@@ -980,22 +980,22 @@ module SiSU_TeX_Pdf
end
def tex_head_paper
case @layout
- when /portrait/
+ when :portrait
tex_head_paper_portrait(tex_head_paper_dimensions)
- when /landscape/
+ when :landscape
tex_head_paper_landscape(tex_head_paper_dimensions)
end
end
def tex_head_pdftex_dvi
color=case @layout
- when /portrait/
+ when :portrait
<<-WOK
colorlinks=true,
urlcolor=myblack,
filecolor=myblack,
linkcolor=myblack,
WOK
- when /landscape/
+ when :landscape
<<-WOK
colorlinks=true,
urlcolor=myblue, % \\href{...}{...} external url
@@ -1003,8 +1003,9 @@ module SiSU_TeX_Pdf
linkcolor=myred, % \\href{...} and \\pageref{...}
WOK
end
- if @layout =~/portrait|landscape/
- <<-WOK
+ if @layout == :portrait \
+ or @layout == :landscape
+ <<-WOK
\\usepackage{alltt}
\\usepackage{thumbpdf}
\\usepackage[#{@tex2pdf},
@@ -1484,11 +1485,11 @@ module SiSU_TeX_Pdf
#BOOK standard dimensions - 229x156
def newpage(orientation)
case orientation
- when /landscape/ # using longtable latex package
+ when :landscape # using longtable latex package
<<-WOK
\\clearpage
WOK
- when /portrait/
+ when :portrait
<<-WOK
\\newpage
WOK