diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v3/texpdf.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v3/texpdf_format.rb | 16 |
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 |