aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/texpdf_format.rb35
1 files changed, 16 insertions, 19 deletions
diff --git a/lib/sisu/texpdf_format.rb b/lib/sisu/texpdf_format.rb
index e5a323ad..80f2652c 100644
--- a/lib/sisu/texpdf_format.rb
+++ b/lib/sisu/texpdf_format.rb
@@ -719,18 +719,7 @@ module SiSU_TeX_Pdf
# fc-list :lang=ja
case @tex2pdf
when /xe/
- if @md.opt.lng =~/(?:zh|ja|ko)/
- <<-WOK
-\\usepackage{ucs, fontspec, xltxtra, xunicode, xeCJK}
-\\setmainCJKlanguage{#{tex_head_lang[:mainlang]}}
-\\setCJKmainfont{#{texpdf_fontface_cjk}}
-\\XeTeXlinebreaklocale "#{tex_head_lang[:mainlang]}"
-\\XeTeXlinebreakskip = 0pt plus 1pt
-\\setotherlanguage{#{tex_head_lang[:otherlang]}}
-\\setmainfont{#{texpdf_fontface}}
-\\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
- WOK
- elsif (tex_head_lang[:mainlang] == "english" \
+ if (tex_head_lang[:mainlang] == "english" \
&& (tex_head_lang[:otherlang] == "english" \
|| tex_head_lang[:otherlang] == "" \
|| tex_head_lang[:otherlang].length == 0))
@@ -998,16 +987,24 @@ module SiSU_TeX_Pdf
}
WOK
end
- def tex_head_paper_part_specific
+ def tex_head_paper_part_specific(orientation)
+ colorlinks = <<-WOK
+ colorlinks=true, % myblack
+ urlcolor=myblue, % \\href{...}{...} external url
+ filecolor=mygreen, % \\href{...} local file
+ linkcolor=myred, % \\href{...} and \\pageref{...}
+ WOK
+ colorlinks = (orientation == "landscape") ? colorlinks : ""
<<-WOK
-\\usepackage[english,english]{babel}
+\\usepackage[#{tex_head_lang[:mainlang]},#{tex_head_lang[:otherlang]}]{babel}
\\usepackage[autostyle, english = american]{csquotes}
% \\MakeOuterQuote{"} % not required, using '' as quote delimiter
-\\selectlanguage{english}
+\\selectlanguage{#{tex_head_lang[:mainlang]}}
\\hypersetup{
pdftitle={#{@md.title.short}},
pdfauthor={#{@md.creator.author}},
pdfsubject={},
+#{colorlinks}
}
\\usepackage{fancyhdr}
\\lhead[ ]{ }
@@ -1049,14 +1046,14 @@ module SiSU_TeX_Pdf
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
#{tex_head_paper_part}
#{tex_head_paper_newenv_newcmd}
-#{tex_head_paper_part_specific}
+#{tex_head_paper_part_specific("portrait")}
#{multicol}
WOK
end
def tex_head_paper_landscape(d)
<<-WOK
#{tex_head_info}
-\\documentclass[11pt,a4paper,titlepage,makeidx]{scrartcl}
+\\documentclass[11pt,a4paper,landscape,titlepage,twocolumn,makeidx]{scrartcl}
\\usepackage{geometry}
\\geometry{
a4paper,
@@ -1071,7 +1068,7 @@ module SiSU_TeX_Pdf
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
#{tex_head_paper_part}
#{tex_head_paper_newenv_newcmd}
-#{tex_head_paper_part_specific}
+#{tex_head_paper_part_specific("landscape")}
WOK
end
def tex_head_paper_portrait_dvi(d)
@@ -1243,7 +1240,7 @@ module SiSU_TeX_Pdf
#{tex_head_encode}
#{tex_head_pdftex}
#{tex_head_codeblock(codeblock_box_type)}
-\\selectlanguage{#{@lang.list[@md.i18n[0]][:xlp]}}
+\\selectlanguage{#{tex_head_lang[:mainlang]}}
WOK
end
def a4generic