From 1de01618246a25effb3c19c6d2597246a749479e Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph@amissah.com>
Date: Thu, 27 Feb 2020 10:35:19 -0500
Subject: texpdf setotherlanguage & add package geometry

- otherlanguage not always present
- landscape title page needs geometry package
---
 lib/sisu/se_programs.rb   |  2 +-
 lib/sisu/texpdf_format.rb | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

(limited to 'lib')

diff --git a/lib/sisu/se_programs.rb b/lib/sisu/se_programs.rb
index bcb8228a..efe89946 100644
--- a/lib/sisu/se_programs.rb
+++ b/lib/sisu/se_programs.rb
@@ -298,7 +298,7 @@ module SiSU_Sys_Call
       if @pdfetex_flag
         texpdf_cmd=case texpdf
         when /xetex/
-          %{#{texpdf} -interaction=#{mode} -fmt=xelatex -papersize="#{papersize}" #{@input} #{tell}\n}
+          %{#{texpdf} -interaction=#{mode} -fmt=xelatex #{@input} #{tell}\n}
         when /xelatex/
           %{#{texpdf} -interaction=#{mode} -papersize="#{papersize}" #{@input} #{tell}\n}
         when /pdftex/
diff --git a/lib/sisu/texpdf_format.rb b/lib/sisu/texpdf_format.rb
index 5c9d2c9d..634bb591 100644
--- a/lib/sisu/texpdf_format.rb
+++ b/lib/sisu/texpdf_format.rb
@@ -732,11 +732,23 @@ module SiSU_TeX_Pdf
 \\setmainfont{#{texpdf_fontface}}
 \\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
           WOK
+        elsif (tex_head_lang[:mainlang] == "english" \
+        && (tex_head_lang[:otherlang] == "english" \
+          || tex_head_lang[:otherlang] == "" \
+          || tex_head_lang[:otherlang].length == 0))
+          <<-WOK
+\\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode}
+\\setmainlanguage{#{tex_head_lang[:mainlang]}}
+\\setmainfont{#{texpdf_fontface}}
+\\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
+% \\setsansfont{#{texpdf_fontface_sans}}
+% \\setromanfont{#{texpdf_fontface_serif}}
+          WOK
         else
           <<-WOK
 \\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode}
 \\setmainlanguage{#{tex_head_lang[:mainlang]}}
-\\setotherlanguage{#{tex_head_lang[:otherlang]}}
+\\setotherlanguage{english}
 \\setmainfont{#{texpdf_fontface}}
 \\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
 % \\setsansfont{#{texpdf_fontface_sans}}
@@ -775,6 +787,7 @@ module SiSU_TeX_Pdf
       multicol=(@md.book_idx ? '\usepackage{multicol}' : '')
       <<-WOK
 #{tex_head_info}
+\\usepackage{geometry}
 \\documentclass[#{d[:fontsize]},#{d[:papertype]},titlepage]{scrartcl}        %with titlepage
 \\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm}
 \\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}
@@ -788,6 +801,7 @@ module SiSU_TeX_Pdf
     def tex_head_paper_landscape(d)
       <<-WOK
 #{tex_head_info}
+\\usepackage{geometry}
 \\documentclass[#{d[:fontsize]},#{d[:papertype]},landscape,titlepage,twocolumn]{scrartcl}        %with titlepage
 \\setlength{\\textheight}{#{d[:textheight]}mm} \\setlength{\\textwidth}{#{d[:textwidth]}mm}
 \\setlength{\\oddsidemargin}{#{d[:oddsidemargin]}} \\setlength{\\evensidemargin}{#{d[:evensidemargin]}}
-- 
cgit v1.2.3