aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2023-10-30 13:31:43 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2023-10-30 22:16:55 -0400
commitc93c52d5574c2b0f48bb005e5c972e66a5d5dba4 (patch)
tree18eb727e8239018b4060ed9a441400e0d90baff4 /lib
parenttexpdf, cjk issues not resolved (diff)
texpdf, cjk issues not resolved
- ctex preferable to xeCJK? (if/when it works) - note: the current round of texpdf changes relate to a bug report on the old live-manual for debian-live to wit: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052693 - apparently sisu-pdf does not produce latex suitable for the latest texlive (texlive-2023) - some of the latex output changes here are from sisu:spine, the dlang version of sisu
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/texpdf_format.rb70
1 files changed, 40 insertions, 30 deletions
diff --git a/lib/sisu/texpdf_format.rb b/lib/sisu/texpdf_format.rb
index 9b250944..7c238b71 100644
--- a/lib/sisu/texpdf_format.rb
+++ b/lib/sisu/texpdf_format.rb
@@ -722,7 +722,6 @@ module SiSU_TeX_Pdf
if @md.opt.lng =~/(?:zh|ja|ko)/
if @md.opt.lng =~/zh/
<<-WOK
-\\usepackage{xeCJK}
\\setCJKmainfont{Noto}
\\setCJKmainfont{Noto Sans CJK TC}
\\setCJKsansfont{Noto Sans CJK TC}
@@ -736,11 +735,12 @@ module SiSU_TeX_Pdf
WOK
elsif @md.opt.lng =~/ja/
<<-WOK
-\\usepackage{xeCJK}
-\\setCJKmainfont{Noto}
-\\setCJKmainfont{Noto Sans CJK JP}
-\\setCJKsansfont{Noto Sans CJK JP}
-\\setCJKmonofont{Noto Sans Mono CJK JP}
+\\setCJKmainfont{TakaoMincho}
+\\setCJKsansfont{TakaoMincho Sans}
+\\setCJKmonofont{TakaoMincho Sans Mono CJK JP}
+%\\setCJKmainfont{Noto Serif CJK JP}
+%\\setCJKsansfont{Noto Sans CJK JP}
+%\\setCJKmonofont{Noto Sans Mono CJK JP}
\\setmainlanguage{#{tex_head_lang[:mainlang]}}
\\setotherlanguage{english}
% \\setmainfont{#{texpdf_fontface_cjk}}
@@ -750,7 +750,6 @@ module SiSU_TeX_Pdf
WOK
elsif @md.opt.lng =~/ko/
<<-WOK
-\\usepackage{xeCJK}
\\setCJKmainfont{Noto}
\\setCJKmainfont{Noto Sans CJK KR}
\\setCJKsansfont{Noto Sans CJK KR}
@@ -782,18 +781,11 @@ module SiSU_TeX_Pdf
WOK
end
when /pdf/
- if @md.file_encoding =~ /iso-?8859/i #% iso8859
- <<-WOK
-% \\usepackage[latin1]{inputenc}
-\\usepackage{fontspec}
- WOK
- else #% utf-8 assumed
<<-WOK
-\\usepackage{babel}
+\\usepackage[#{tex_head_lang[:mainlang]},#{tex_head_lang[:otherlang]}]{babel}
\\usepackage{ucs}
-\\usepackage[utf8x]{inputenc}
- WOK
- end
+\\usepackage[utf8x]{inputenc} %
+ WOK
end
end
def tex_head_info
@@ -809,16 +801,31 @@ module SiSU_TeX_Pdf
%% SiSU https://git.sisudoc.org/
WOK
end
- def tex_head_paper_part
- <<-WOK
+ def tex_head_paper_characters
+ if @md.opt.lng =~/(?:zh|ja|ko)/
+ <<-WOK
+\\renewcommand*\\familydefault{\\sfdefault}
+\\usepackage[UTF8, fontset=TakaoMincho]{ctex}
+%\\usepackage[UTF8, fontset=Takao明朝]{ctex}
+%\\usepackage[UTF8, fontset=none]{ctex}
+\\usepackage{ctexhook}
+\\usepackage[T1]{fontenc}
+\\usepackage{newunicodechar}
+\\usepackage[utf8]{inputenc}
+ WOK
+ else
+ <<-WOK
% \\usepackage[scaled]{dejavu}
\\renewcommand*\\familydefault{\\sfdefault}
%\\usepackage{inconsolata}
\\usepackage[T1]{fontenc}
\\usepackage{newunicodechar}
\\usepackage[utf8]{inputenc}
-\\usepackage{xeCJK}
-\\usepackage{noto}
+ WOK
+ end
+ end
+ def tex_head_paper_shared
+ <<-WOK
\\usepackage{alltt}
\\usepackage[
unicode=true,
@@ -879,7 +886,7 @@ module SiSU_TeX_Pdf
\\definecolor{Light}{gray}{.92}
\\definecolor{listinggray}{gray}{0.9}
\\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
-\\lstset{
+\\lstset{%
backgroundcolor=\\color{lbcolor},
tabsize=4,
rulecolor=,
@@ -907,6 +914,7 @@ module SiSU_TeX_Pdf
\\DeclareTOCStyleEntry[numwidth+=3pt]{section}{subsection}
\\DeclareTOCStyleEntries[indent+=4pt]{section}{section,subsection,subsubsection}
\\DeclareTOCStyleEntries[numwidth+=3pt]{section}{paragraph,subparagraph}
+\\usepackage{ltxcmds}
WOK
end
def tex_head_paper_newenv_newcmd
@@ -1034,7 +1042,7 @@ module SiSU_TeX_Pdf
}
WOK
end
- def tex_head_paper_part_specific(orientation)
+ def tex_head_paper_orient(orientation)
colorlinks = <<-WOK
colorlinks=true, % myblack
urlcolor=myblue, % \\href{...}{...} external url
@@ -1079,9 +1087,9 @@ module SiSU_TeX_Pdf
#{tex_head_info}
\\documentclass[11pt,a4paper,titlepage,makeidx]{scrartcl}
\\usepackage{fontspec}
-\\usepackage{lmodern}
+% \\usepackage{lmodern} %%issue remove for now (consider later)
\\usepackage{geometry}
-\\geometry{
+\\geometry{%
#{d[:papertype]},
portrait,
left=#{d[:left]},
@@ -1093,9 +1101,10 @@ module SiSU_TeX_Pdf
\\usepackage{multicol}
\\setlength{\\marginparsep}{#{d[:marginparsep]}}
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
-#{tex_head_paper_part}
+#{tex_head_paper_characters}
+#{tex_head_paper_shared}
#{tex_head_paper_newenv_newcmd}
-#{tex_head_paper_part_specific("portrait")}
+#{tex_head_paper_orient("portrait")}
#{multicol}
WOK
end
@@ -1104,7 +1113,7 @@ module SiSU_TeX_Pdf
#{tex_head_info}
\\documentclass[11pt,a4paper,landscape,titlepage,twocolumn,makeidx]{scrartcl}
\\usepackage{geometry}
-\\geometry{
+\\geometry{%
#{d[:papertype]},
landscape,
left=#{d[:left]},
@@ -1115,9 +1124,10 @@ module SiSU_TeX_Pdf
\\usepackage{multicol}
\\setlength{\\marginparsep}{#{d[:marginparsep]}}
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
-#{tex_head_paper_part}
+#{tex_head_paper_characters}
+#{tex_head_paper_shared}
#{tex_head_paper_newenv_newcmd}
-#{tex_head_paper_part_specific("landscape")}
+#{tex_head_paper_orient("landscape")}
WOK
end
def tex_head_paper_portrait_dvi(d)