aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-07-26 20:11:52 -0400
committerRalph Amissah <ralph@amissah.com>2011-07-26 20:11:54 -0400
commit427c8b2969fef30a403a55adfc32b449d78d7fe9 (patch)
tree8f8c3ca597e45631d434e5798bbdbd1c68aa7a8b /lib
parentv3: xmls (sax, dom, xhtml) use of tidy, correct output location (diff)
v3: texpdf, XeTeX language settings (setmainlanguage setotherlanguage)
* get from directory or filename if header @make: :language: not set
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/texpdf.rb2
-rw-r--r--lib/sisu/v3/texpdf_format.rb16
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb
index 522480fd..22269fc2 100644
--- a/lib/sisu/v3/texpdf.rb
+++ b/lib/sisu/v3/texpdf.rb
@@ -183,7 +183,7 @@ module SiSU_TeX
when /legal/; pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal
else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4
end
- Dir.mkdir(@md.file.output_path.pdf.dir) unless FileTest.directory?(@md.file.output_path.pdf.dir)
+ mkdir_p(@md.file.output_path.pdf.dir) unless FileTest.directory?(@md.file.output_path.pdf.dir)
if FileTest.file?(portrait_pdf)
cp(portrait_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_p}")
rm(portrait_pdf)
diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb
index d7942121..cd63cd4e 100644
--- a/lib/sisu/v3/texpdf_format.rb
+++ b/lib/sisu/v3/texpdf_format.rb
@@ -636,10 +636,20 @@ module SiSU_TeX_Pdf
end
def tex_head_lang #babel 18n
lang_char_arr=@md.i18n
- mainlang_char=lang_char_arr.slice(0)
+ mainlang_char=if @md.i18n == Array \
+ and @md.i18n.length > 0
+ lang_char_arr.slice(0)
+ else @md.opt.lng
+ end
mainlang=@lang.list[mainlang_char][:xlp]
- otherlang=[]
- lang_char_arr.slice(1..9).each { |ch| otherlang << @lang.list[ch][:xlp] }
+ otherlang=if mainlang != 'english'
+ [ @lang.list['en'][:xlp] ]
+ else []
+ end
+ if lang_char_arr.length > 0
+ lang_char_arr.slice(1..9).each { |ch| otherlang << @lang.list[ch][:xlp] }
+ otherlang.uniq!
+ end
otherlang=otherlang.join(',')
{ mainlang: mainlang, otherlang: otherlang }
end