From 427c8b2969fef30a403a55adfc32b449d78d7fe9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 26 Jul 2011 20:11:52 -0400 Subject: v3: texpdf, XeTeX language settings (setmainlanguage setotherlanguage) * get from directory or filename if header @make: :language: not set --- lib/sisu/v3/texpdf.rb | 2 +- lib/sisu/v3/texpdf_format.rb | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3