aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/texpdf.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/texpdf.org')
-rw-r--r--org/texpdf.org694
1 files changed, 414 insertions, 280 deletions
diff --git a/org/texpdf.org b/org/texpdf.org
index dd1d2486..58f9130a 100644
--- a/org/texpdf.org
+++ b/org/texpdf.org
@@ -40,7 +40,7 @@ module SiSU_TeX
@@tabular="{tabular}"
@@column_instruct=@@squigle_close=@@tex_line_mode=@@tex_word_mode=@@line_mode=''
@@tex_debug_counter=@@table_pagebreak_counter=@@tex_footnote_call_counter=@@tex_table_flag=@@tex_counter=@@tex_column=@@tex_columns=@@tex_columns=@@counting=0
- @@tex_pattern_margin_number=/\\\\begin\\\{tiny\\\}\\\\hspace\\\{0mm\\\}\\\\end\\\{tiny\\\}\\\{\\\\marginpar.+?\s+/
+ @@tex_pattern_margin_number=/\\\\ocn\\\{[0-9]+\\\}/
@@n=@@tableheader=@@rights=nil
@@date ||=SiSU_Env::InfoDate.new
class Source
@@ -711,65 +711,6 @@ module SiSU_TeX
end
dob
end
- def tex_box_listings
- <<-WOK
-\\definecolor{listinggray}{gray}{0.9}
-\\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
-\\lstset{
- backgroundcolor=\\color{lbcolor},
- tabsize=4,
- rulecolor=,
- language=,
- basicstyle=\\scriptsize,
- upquote=true,
- aboveskip={1.5\\baselineskip},
- columns=fixed,
- showstringspaces=false,
- extendedchars=true,
- breaklines=true,
- prebreak = \\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookleftarrow}},
- frame=single,
- showtabs=false,
- showspaces=false,
- showstringspaces=false,
- identifierstyle=\\ttfamily,
- keywordstyle=\\color[rgb]{0,0,1},
- commentstyle=\\color[rgb]{0.133,0.545,0.133},
- stringstyle=\\color[rgb]{0.627,0.126,0.941},
-}
- WOK
- end
- def tex_box_boites
- <<-WOK
-\\def\\codeblockboitebox{%
- \\def\\bkvz@before@breakbox{\\ifhmode\\par\\fi\\vskip\\breakboxskip\\relax}%
- \\def\\bkvz@set@linewidth{\\advance\\linewidth -2\\fboxrule
- \\advance\\linewidth -2\\fboxsep} %
- \\def\\bk@line{\\hbox to \\linewidth{%
- \\ifbkcount\\smash{\\llap{\\the\\bk@lcnt\\ }}\\fi
- \\psframebox*[framesep=0pt,linewidth=0pt]{%
- \\vrule\\@width\\fboxrule \\hskip\\fboxsep
- \\box\\bk@bxa
- \\hskip\\fboxsep \\vrule\\@width\\fboxrule
- }%
- }}%
- %\\def\\bkvz@top{\\hrule\\@height\\fboxrule}
- \\def\\bkvz@top{\\hrule height .6pt}%
- \\def\\bkvz@bottom{\\hrule\\@height\\fboxrule}%
- \\breakbox}
-\\def\\endcodeblockboitebox{\\endbreakbox}
- WOK
- end
- def tex_codeblock
- codeblock_box=if @codeblock_box=='listings'
- tex_box_listings
- elsif @codeblock_box=='boites'
- tex_box_boites
- else
- tex_box_boites
- end
- codeblock_box
- end
def markup(data)
@tex_file=[]
home=the_text.txt_home.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex
@@ -788,31 +729,6 @@ module SiSU_TeX
end
@tex_file << <<-WOK
#{@tex_ml.header}#{@tex_ml.footer}
-\\tolerance=300
-\\clubpenalty=300
-\\widowpenalty=300
-\\makeatother
-\\makeatother
-\\chardef\\txtbullet="2022
-\\chardef\\tilde="7E
-%\\chardef\\asterisk="2A
-\\def\\asterisk{{\\rm \\char42} }
-\\definecolor{Light}{gray}{.92}
-\\newcommand{\\Codeblock}[1]{\\normaltext\\raggedright\\small\\ttfamily\\texbackslash#1}
-\\newcommand{\\monosp}[1]{\\normaltext\\ttfamily\\texbackslash#1}
-\\newcommand{\\parasep}{\\\\ \\begin{center}*\\hspace{2em}*\\hspace{2em}*\\end{center} \\\\}
-\\newcommand{\\hardspace}{{~}}
-%\\newcommand{\\hardspace}{\\hspace{.5em}}
-\\newcommand{\\caret}{{\\^{~}}}
-\\newcommand{\\pipe}{{\\textbar}}
-\\newcommand{\\curlyopen}{\{}
-\\newcommand{\\curlyclose}{\}}
-\\newcommand{\\lt}{{\UseTextSymbol{OML}{<}}}
-\\newcommand{\\gt}{{\UseTextSymbol{OML}{>}}}
-\\newcommand{\\slash}{{/}}
-\\newcommand{\\underscore}{\\_}
-\\newcommand{\\exclaim}{\\Verbatim{!}}
-#{tex_codeblock}
% (tilde hash amp affected by http)
% \\sloppy
\\begin{document}
@@ -870,8 +786,12 @@ module SiSU_TeX
x={}
if (@make.build.toc?)
toc=<<-WOK
+\\clearpage
+\\pagenumbering{roman}
+\\setcounter{page}{1}
\\renewcommand{\\contentsname}{#{@translate.contents}}
\\tableofcontents
+\\clearpage
WOK
toc_pb={ l: @tex_ml.newpage(:landscape), p: @tex_ml.newpage(:portrait) }
else
@@ -884,6 +804,9 @@ module SiSU_TeX
\\pagestyle{fancy}
#{toc}#{toc_pb[:l]}
\\pagenumbering{arabic}
+\\clearpage
+\\setcounter{page}{2}
+\\clearpage
#{@tex_ml.paraskip_normal}
#{@tex_ml.newpage(:landscape)}
WOK
@@ -895,6 +818,9 @@ module SiSU_TeX
#{toc}#{toc_pb[:p]}
#{@tex_ml.newpage(:portrait)}
\\pagenumbering{arabic}
+\\clearpage
+\\setcounter{page}{2}
+\\clearpage
#{@tex_ml.paraskip_normal}
#{@tex_ml.newpage(:portrait)}
WOK
@@ -960,7 +886,7 @@ module SiSU_TeX
# tags=tags +"\\hspace{0mm}\\hypertarget{#{t}}{\\hspace{0mm}}"
# end
#end
- "\\begin{tiny}\\hspace{0mm}\\end{tiny}{\\marginpar{\\begin{tiny}\\hspace{0mm}\\hypertarget{#{dob.ocn}}{#{dob.ocn}}#{tags}\\end{tiny}}}" #ocn object citation numbering
+ "\\ocn{#{dob.ocn}}" #ocn object citation numbering
else ''
end
dob.tmp = paranumber_display + dob.tmp
@@ -1348,7 +1274,7 @@ module SiSU_TeX_Pdf
include SiSU_Parts_TeXpdf
attr_accessor :string,:string1,:orientation,:url,:dir,:tex
@@sys=SiSU_Env::SystemCall.new
- @@tex_pattern_margin_number=/\\begin\{tiny\}\\hspace\{0mm\}\\end\{tiny\}\{\\marginpar.+?\}\}\}/
+ @@tex_pattern_margin_number=/\\ocn\{[0-9]+\}/
@@tableheader={
'a4' => { p: 0, l: 0 },
'a5' => { p: 0, l: 0 },
@@ -1374,7 +1300,7 @@ module SiSU_TeX_Pdf
show_ocn=(@make.build.ocn?) \
? dob.ocn
: ''
- "\\begin{tiny}\\hspace{0mm}\\end{tiny}{\\marginpar{\\begin{tiny}\\hspace{0mm}\\hypertarget{#{dob.ocn}}{#{show_ocn}}\\end{tiny}}}" #ocn object citation numbering
+ "\\ocn{#{dob.ocn}}" #ocn object citation numbering
end
def table_special_characters(r)
r=r.gsub(/#{Mx[:tc_p]}/mu,'&').
@@ -1546,7 +1472,7 @@ module SiSU_TeX_Pdf
dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2').
gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'')
cont_ln=dob.tmp.dup
- cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2').
+ cont_ln=cont_ln.gsub(/\\ocn\{[0-9]*\}/m,'').
gsub(@@tex_pattern_margin_number,'').
gsub(/#{Tex[:backslash]*2}/,"#{Tex[:backslash]*4}"). # added w42
gsub(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,''). #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22
@@ -1620,9 +1546,9 @@ module SiSU_TeX_Pdf
when /9/ then '8.0em'
else '-1.0em'
end
- "\\begin{Bullet}{#{indent}}$\\txtbullet$\\hspace{\\enspace}#{@dob.tmp}\\end{Bullet}"
+ "\\begin{Bullet}{#{indent}}#{@dob.tmp}\\end{Bullet}"
else
- "\\begin{Bullet}{-5mm}$\\txtbullet$\\hspace{\\enspace}#{@dob.tmp}\\end{Bullet}"
+ "\\begin{Bullet}{-5mm}#{@dob.tmp}\\end{Bullet}"
end
blt
end
@@ -1991,52 +1917,72 @@ module SiSU_TeX_Pdf
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
+ if @md.opt.lng =~/zh/
+ <<-WOK
+\\setCJKmainfont{Noto}
+\\setCJKmainfont{Noto Sans CJK TC}
+\\setCJKsansfont{Noto Sans CJK TC}
+\\setCJKmonofont{Noto Sans Mono CJK TC}
+\\setmainlanguage{#{tex_head_lang[:mainlang]}}
+\\setotherlanguage{english}
+% \\setmainfont{#{texpdf_fontface_cjk}}
+% \\setotherfont{#{texpdf_fontface}}
+\\setotherfont{Noto Sans}
+% \\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
+ WOK
+ elsif @md.opt.lng =~/ja/
+ <<-WOK
+\\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}}
+% \\setotherfont{#{texpdf_fontface}}
+\\setotherfont{Noto Sans}
+% \\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
+ WOK
+ elsif @md.opt.lng =~/ko/
+ <<-WOK
+\\setCJKmainfont{Noto}
+\\setCJKmainfont{Noto Sans CJK KR}
+\\setCJKsansfont{Noto Sans CJK KR}
+\\setCJKmonofont{Noto Sans Mono CJK KR}
+\\setmainlanguage{#{tex_head_lang[:mainlang]}}
+\\setotherlanguage{english}
+% \\setmainfont{#{texpdf_fontface_cjk}}
+% \\setotherfont{#{texpdf_fontface}}
+\\setotherfont{Noto Sans}
+% \\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
+ WOK
+ else puts "lang error"
+ end
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}}
+% \\setmainlanguage{#{tex_head_lang[:mainlang]}}
+% \\setmainfont{#{texpdf_fontface}}
+% \\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
WOK
else
<<-WOK
-\\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode}
-\\setmainlanguage{#{tex_head_lang[:mainlang]}}
-\\setotherlanguage{english}
-\\setmainfont{#{texpdf_fontface}}
-\\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
-% \\setsansfont{#{texpdf_fontface_sans}}
-% \\setromanfont{#{texpdf_fontface_serif}}
+% \\setmainlanguage{#{tex_head_lang[:mainlang]}}
+% \\setotherlanguage{english}
+% \\setmainfont{#{texpdf_fontface}}
+% \\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}}
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
@@ -2049,36 +1995,336 @@ module SiSU_TeX_Pdf
%% #{rubyv}
%% LaTeX output
%% #{lastdone}
-%% SiSU http://www.jus.uio.no/sisu
+%% SiSU https://git.sisudoc.org/
+ WOK
+ end
+ 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}
+ WOK
+ end
+ end
+ def tex_head_paper_shared
+ <<-WOK
+\\usepackage{alltt}
+\\usepackage[
+ unicode=true,
+ pdfusetitle,
+ pdfsubject={},
+ pdfkeywords={}, % keywords list {} {} {},
+ pdftoolbar=true,
+ pdfmenubar=true,
+ pdfwindowui=true,
+ pdffitwindow=false, % window fit to page when opened
+ pdfstartview={FitH}, % fits the width of the page to the window
+ pdfnewwindow=true, % links in new window
+ pdfborder={0 0 1},
+ plainpages=false, % was true
+ bookmarks=true,
+ bookmarksopen=false,
+ bookmarksnumbered=false,
+ backref=false,
+ breaklinks=false,
+ colorlinks=true,
+ urlcolor=black,
+ filecolor=black,
+ linkcolor=black,
+ citecolor=black, % links_mono_or_color_set
+]{hyperref}
+\\PassOptionsToPackage{hyphens}{url}\\usepackage{hyperref}
+\\usepackage[usenames]{color}
+\\definecolor{myblack}{rgb}{0,0,0}
+\\definecolor{myred}{rgb}{0.75,0,0}
+\\definecolor{mygreen}{rgb}{0,0.5,0}
+\\definecolor{myblue}{rgb}{0,0,0.5}
+\\definecolor{mywhite}{rgb}{1,1,1}
+\\usepackage{textcomp}
+\\usepackage[parfill]{parskip}
+\\usepackage[normalem]{ulem}
+\\usepackage{soul}
+\\usepackage{longtable}
+\\usepackage{graphicx}
+\\usepackage[tc]{titlepic}
+\\usepackage{amssymb}
+\\usepackage{amsmath}
+\\usepackage[cm]{sfmath}
+\\usepackage{underscore}
+\\usepackage{listings}
+\\setcounter{secnumdepth}{2}
+\\setcounter{tocdepth}{4}
+\\usepackage{bookmark}
+\\usepackage{microtype}
+\\makeatletter
+\\usepackage[multiple,ragged]{footmisc}
+\\setlength\\footnotemargin{12pt}
+\\usepackage[para]{manyfoot}
+\\DeclareNewFootnote{A}
+\\makeatother
+\\chardef\\txtbullet="2022
+\\chardef\\tilde="7E
+\\def\\asterisk{{\\rm \\char42} }
+\\definecolor{Light}{gray}{.92}
+\\definecolor{listinggray}{gray}{0.9}
+\\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
+\\lstset{%
+ backgroundcolor=\\color{lbcolor},
+ tabsize=4,
+ rulecolor=,
+ language=,
+ basicstyle={\\ttfamily\\scriptsize},
+ upquote=true,
+ columns=fixed,
+ showstringspaces=false,
+ extendedchars=true,
+ breaklines=true,
+ prebreak = \\raisebox{0ex}[0ex][0ex]{\\ensuremath{\\hookleftarrow}},
+ frame=single,
+ showtabs=false,
+ showspaces=false,
+ showstringspaces=false,
+ identifierstyle=\\ttfamily,
+ keywordstyle=\\color[rgb]{0,0,1},
+ commentstyle=\\color[rgb]{0.133,0.545,0.133},
+ stringstyle=\\color[rgb]{0.627,0.126,0.941},
+}
+\\DeclareTOCStyleEntry[numwidth+=8pt]{part}{part}
+\\DeclareTOCStyleEntry[numwidth+=4pt]{section}{section}
+\\DeclareTOCStyleEntry[numwidth+=3pt]{section}{paragraph}
+\\DeclareTOCStyleEntry[numwidth+=3pt]{section}{subparagraph}
+\\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
+ <<-WOK
+\\newenvironment{ParagraphIndent}[1]{%
+ \\begin{list}{}{%
+ \\setlength\\topsep{0pt}%
+ \\addtolength{\\leftmargin}{#1}
+ \\setlength\\parsep{0pt plus 1pt}%
+ }
+ \\item[]
+} {\\end{list}}
+\\newenvironment{ParagraphHang}[2]{%
+ \\begin{list}{}{%
+ \\setlength\\topsep{0pt}%
+ \\addtolength{\\leftmargin}{#1}
+ \\itemindent=#2
+ \\setlength\\parsep{0pt plus 1pt}%
+ }
+ \\item[]
+} {\\end{list}}
+\\newenvironment{Bullet}[1]{%
+ \\begin{list}{}{%
+ \\setlength\\topsep{0pt}%
+ \\addtolength{\\leftmargin}{#1}
+ \\itemindent=-1em
+ \\setlength\\parsep{0pt plus 1pt}%
+ }
+ \\item[]
+ $\\txtbullet$\\hspace{\\enspace}
+} {\\end{list}}
+\\newcommand{\\monosp}[1]{\\normaltext\\ttfamily\\texbackslash#1}
+\\newcommand{\\br}{\\hfill\\break}
+\\newcommand{\\brl}[1]{%
+ \\ifx&#1&%
+ \\hfill\\break
+ \\else
+ \\vspace{#1ex}
+ \\fi
+}
+\\newcommand{\\brln}{\\hspace*{\\fill}\\linebreak}
+\\newcommand{\\objBlockOpen}{%
+ \\setlength{\\parskip}{0.5ex plus0.2ex minus0.1ex}\\raggedright
+ \\begin{footnotesize}
+}
+\\newcommand{\\objBlockClose}{%
+ \\end{footnotesize}
+ \\setlength{\\parskip}{1ex plus0.5ex minus0.2ex}
+}
+\\newcommand{\\objGroupOpen}{%
+ \\setlength{\\parskip}{0.5ex plus0.2ex minus0.1ex}
+ \\begin{footnotesize}
+}
+\\newcommand{\\objGroupClose}{%
+ \\end{footnotesize}
+}
+\\newcommand{\\objPoemVerseOpen}{%
+ \\setlength{\\parskip}{0.1ex plus0.1ex minus0.1ex}
+ \\begin{footnotesize}
+
+}
+\\newcommand{\\objPoemVerseClose}{%
+
+ \\end{footnotesize}
+ \\setlength{\\parskip}{1ex plus0.5ex minus0.2ex}
+ \\linebreak
+}
+\\newcommand{\\parasep}{%
+ \\smallskip \\begin{center}*\\hspace{2em}*\\hspace{2em}*\\end{center} \\br
+}
+\\newcommand{\\spaces}[1]{{\\hspace*{#1ex}}}
+\\newcommand{\\s}{\\hspace*{1ex}}
+\\newcommand{\\hardspace}{\\hspace*{1ex}}
+\\newcommand{\\-}{\\hspace*{1ex}}
+\\newcommand{\\caret}{{\\^{~}}}
+\\newcommand{\\pipe}{{\\textbar}}
+\\newcommand{\\curlyOpen}{{}
+\\newcommand{\\curlyClose}{}}
+\\newcommand{\\lt}{{UseTextSymbol{OML}{<}}}
+\\newcommand{\\gt}{{UseTextSymbol{OML}{>}}}
+\\newcommand{\\slash}{{/}}
+\\newcommand{\\underscore}{\\_}
+\\newcommand{\\exclaim}{\\Verbatim{!}}
+\\newcommand{\\linktext}[2]{%
+ {\\href{#1}
+ {\\;\\ulcorner\\,\\textup{{#2}}\\,\\lrcorner}}
+}
+\\newcommand{\\linkurl}[2]{%
+ \\;{\\href{#1}
+ {\\;\\scriptsize\\ttfamily\\ulcorner\\,\\textup{{#2}}\\,\\lrcorner}}
+}
+\\newcommand{\\link}[2]{%
+ {\\begin{scriptsize}\\color{black}\\urlstyle{tt}\\href{#1}
+ {\\;\\ulcorner\\,{#2}\\,\\lrcorner}\\end{scriptsize}}
+}
+\\newcommand{\\objCodeBlock}[1]{\\normaltext\\raggedright\\small\\ttfamily\\texbackslash#1}
+\\newcommand{\\objCodeOpen}{%
+ \\normaltext\\raggedright\\small\\ttfamily\\texbackslash
+ \\begin{lstlisting}
+}
+\\newcommand{\\objCodeClose}{%
+ \\end{lstlisting}
+}
+\\newcommand{\\ocn}[1]{%
+ \\setlength{\\parindent}{0em}
+ \\ifx&#1&% #1 is empty
+ \\hspace{-0.5ex}{\\marginpar{\\begin{tiny}\\end{tiny}}}
+ \\else% #1 is nonempty
+ \\hspace{-0.5ex}{\\marginpar{\\begin{tiny}\\hspace{0em}\\hypertarget{#1}{#1}\\end{tiny}}}
+ \\fi
+}
+\\newcommand{\\ocnhold}[1]{%
+ \\begin{tiny}\\hspace{0mm}\\end{tiny}{\\marginpar{\\begin{tiny}\\hspace{0mm}\\hypertarget{#1}{#1}\\end{tiny}}}
+}
+\\newcommand{\\objCodeBlockHold}[1]{\\normaltext\\raggedright\\small\\ttfamily\\texbackslash#1}
+\\newcommand{\\objTableOpen}[1]{%
+ \\setlength{\\LTleft}{0pt}
+ \\setlength{\\LTright}{\\fill}
+ \\begin{tiny}
+ \\begin{longtable}{#1}
+}
+\\newcommand{\\objTableClose}{%
+ \\end{longtable}
+ \\end{tiny}
+}
+ WOK
+ end
+ def tex_head_paper_orient(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[#{tex_head_lang[:mainlang]},#{tex_head_lang[:otherlang]}]{babel}
+\\usepackage[autostyle, english = american]{csquotes}
+% \\MakeOuterQuote{"} % not required, using '' as quote delimiter
+\\selectlanguage{#{tex_head_lang[:mainlang]}}
+\\hypersetup{
+ pdftitle={#{@md.title.short}},
+ pdfauthor={#{@md.creator.author}},
+ pdfsubject={},
+#{colorlinks}
+}
+\\usepackage{fancyhdr}
+\\lhead[ ]{ }
+\\chead[ \\fancyplain{} \\bfseries \\footnotesize \\leftmark ]{ \\fancyplain{} \\bfseries \\footnotesize \\rightmark }
+\\rhead[ ]{ }
+\\lfoot[\\textrm{\\thepage}]{\\tiny \\href{https://sisudoc.org}{SiSU}}
+ \\cfoot{\\href{https://git.sisudoc.org}{git}}
+\\rfoot[\\tiny \\href{}{}]{\\textrm{\\thepage}}
+\\begin{document}
+\\thispagestyle{empty}
+\\title{#{@md.title.full}}
+\\author{ \\textnormal{#{@md.creator.author}}}
+\\date{\\begin{tiny}2015-08-23\\end{tiny}}
+\\maketitle
+\\addcontentsline{toc}{part}{#{@md.title.full}}
+\\newpage
+\\pagestyle{fancy}
+\\pagenumbering{alph}
+\\setcounter{page}{1}
WOK
end
def tex_head_paper_portrait(d)
multicol=(@md.book_idx ? '\usepackage{multicol}' : '')
<<-WOK
#{tex_head_info}
+\\documentclass[11pt,a4paper,titlepage,makeidx]{scrartcl}
+\\usepackage{fontspec}
+% \\usepackage{lmodern} %%issue remove for now (consider later)
\\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]}}
-\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}}
-\\setlength{\\headsep}{#{d[:headsep]}}
+\\geometry{%
+ #{d[:papertype]},
+ portrait,
+ left=#{d[:left]},
+ right=#{d[:right]},
+ top=#{d[:top]},
+ bottom=#{d[:bottom]},
+}
+% \\ProvidesPackage{./sty/spineShared}
+\\usepackage{multicol}
\\setlength{\\marginparsep}{#{d[:marginparsep]}}
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
+#{tex_head_paper_characters}
+#{tex_head_paper_shared}
+#{tex_head_paper_newenv_newcmd}
+#{tex_head_paper_orient("portrait")}
#{multicol}
WOK
end
def tex_head_paper_landscape(d)
<<-WOK
#{tex_head_info}
+\\documentclass[11pt,a4paper,landscape,titlepage,twocolumn,makeidx]{scrartcl}
\\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]}}
-\\setlength{\\topmargin}{#{d[:topmargin]}} \\setlength{\\headheight}{#{d[:headheight]}}
-\\setlength{\\headsep}{#{d[:headsep]}}
-\\setlength{\\columnsep}{#{d[:columnsep]}}
+\\geometry{%
+ #{d[:papertype]},
+ landscape,
+ left=#{d[:left]},
+ right=#{d[:right]},
+ top=#{d[:top]},
+ bottom=#{d[:bottom]},
+}
+\\usepackage{multicol}
\\setlength{\\marginparsep}{#{d[:marginparsep]}}
\\setlength{\\marginparwidth}{#{d[:marginparwidth]}}
+#{tex_head_paper_characters}
+#{tex_head_paper_shared}
+#{tex_head_paper_newenv_newcmd}
+#{tex_head_paper_orient("landscape")}
WOK
end
def tex_head_paper_portrait_dvi(d)
@@ -2104,6 +2350,8 @@ module SiSU_TeX_Pdf
when :portrait
fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
d[:papertype],d[:fontsize]='a4paper',fontsize
+ d[:left],d[:right]='30mm','20mm'
+ d[:top],d[:bottom]='30mm','30mm'
d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='0mm','0mm','-12pt'
d[:headheight],d[:headsep],d[:columnsep]='12pt','35pt',''
d[:marginparsep],d[:marginparwidth]='4mm','8mm'
@@ -2123,12 +2371,16 @@ module SiSU_TeX_Pdf
when /book|b5/i #book default - larger
fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
d[:papertype],d[:fontsize]='b5paper',fontsize
+ d[:left],d[:right]='20mm','20mm'
+ d[:top],d[:bottom]='20mm','20mm'
d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-4mm','-4mm','-36pt'
d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt',''
d[:textheight],d[:textwidth]=@tx.b5.portrait.h,@tx.b5.portrait.w
when /a5/i
fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
d[:papertype],d[:fontsize]='a5paper',fontsize
+ d[:left],d[:right]='20mm','20mm'
+ d[:top],d[:bottom]='20mm','20mm'
d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-4mm','-4mm','-36pt'
d[:headheight],d[:headsep],d[:columnsep]='11pt','12pt',''
d[:marginparsep],d[:marginparwidth]='4mm','6mm'
@@ -2141,6 +2393,8 @@ module SiSU_TeX_Pdf
when :landscape
fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
d[:papertype],d[:fontsize]='a4paper',fontsize
+ d[:left],d[:right]='30mm','20mm'
+ d[:top],d[:bottom]='30mm','30mm'
d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='6mm','6mm','-12mm'
d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt'
d[:marginparsep],d[:marginparwidth]='4mm','8mm'
@@ -2160,10 +2414,14 @@ module SiSU_TeX_Pdf
when /book|b5/i #book default - larger
fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt')
d[:papertype],d[:fontsize],d[:columnsep]='b5paper',fontsize,'35pt'
+ d[:left],d[:right]='25mm','25mm'
+ d[:top],d[:bottom]='20mm','20mm'
d[:textheight],d[:textwidth]=@tx.b5.landscape.h,@tx.b5.landscape.w
when /a5/i
fontsize=(fontsize_set==:na) ? '10pt' : (fontsize_set + 'pt')
d[:papertype],d[:fontsize],d[:columnsep]='a5paper',fontsize,'32pt'
+ d[:left],d[:right]='25mm','25mm'
+ d[:top],d[:bottom]='20mm','20mm'
d[:textheight],d[:textwidth]=@tx.a5.landscape.h,@tx.a5.landscape.w
else #default currently A4
fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt')
@@ -2226,53 +2484,14 @@ module SiSU_TeX_Pdf
else ''
end
<<-WOK
-\\usepackage{alltt}
-\\usepackage{thumbpdf}
-\\usepackage[#{@tex2pdf},
- #{hyperlinks_color?.strip}
- pdftitle={#{@txt}},
- pdfauthor={#{author}},
- pdfsubject={#{@subject}},
- pdfkeywords={#{@keywords}},
- pageanchor=true,
- plainpages=true,
- pdfpagelabels=true,
- pagebackref,
- bookmarks=true,
- bookmarksopen=true,
- pdfmenubar=true,
- pdfpagemode=UseOutline,
- pdffitwindow=true,
- pdfwindowui=true,
- plainpages=false,
-% pdfusetitle=true,
-% pdfpagelayout=SinglePage,
-% pdfpagelayout=TwoColumnRight,
-% pdfpagelayout=TwoColumnLeft,
-% pdfstartpage=3,
- pdfstartview=FitH
-]
-{hyperref}
-%% trace lost characters
-% \\tracinglostchars = 1
-% \\tracingonline = 1
-\\usepackage[usenames]{color}
-\\definecolor{myblack}{rgb}{0,0,0}
-\\definecolor{myred}{rgb}{0.75,0,0}
-\\definecolor{mygreen}{rgb}{0,0.5,0}
-\\definecolor{myblue}{rgb}{0,0,0.5}
-\\definecolor{mywhite}{rgb}{1,1,1}
-\\usepackage{url}
-\\urlstyle{sf}
-%\\usepackage{breakurl}
WOK
end
def tex_head_codeblock(codeblock_box_type)
codeblock_box=if codeblock_box_type=='listings'
<<-WOK
-\\usepackage{listings}
-\\usepackage{color}
-\\usepackage{textcomp}
+% \\usepackage{listings}
+% \\usepackage{color}
+% \\usepackage{textcomp}
WOK
elsif codeblock_box_type=='boites'
"\\usepackage{boites}"
@@ -2281,22 +2500,6 @@ module SiSU_TeX_Pdf
end
codeblock_box
end
- def tex_head_misc
- <<-WOK
-\\usepackage{textcomp}
-\\usepackage[parfill]{parskip}
-\\usepackage[normalem]{ulem}
-\\usepackage{soul}
-\\usepackage{longtable}
-\\usepackage[tc]{titlepic}
-\\usepackage{graphicx}
-\\makeatletter
-\\parindent0pt
-%\\usepackage{mathptmx}
-\\usepackage{amssymb}
-% amssymb used for backslash
- WOK
- end
def document_head_with_orientation(codeblock_box_type)
endnotes=("\\usepackage{endnotes}" if @txt =~/endnotes?/) || '' #not implemented see also def endnotes
@lang.list[@md.i18n[0]][:xlp]
@@ -2304,79 +2507,8 @@ module SiSU_TeX_Pdf
#{tex_head_paper}
#{tex_head_encode}
#{tex_head_pdftex}
-#{tex_head_misc}
#{tex_head_codeblock(codeblock_box_type)}
-\\setcounter{secnumdepth}{2}
-\\setcounter{tocdepth}{4}
-\\makeatletter
-#{endnotes}
-\\usepackage[multiple,ragged]{footmisc}
-\\setlength\\footnotemargin{12pt}
-\\usepackage[para]{manyfoot}
-\\DeclareNewFootnote{A}
-%\\DeclareNewFootnote[para]{A}
-\\newenvironment{ParagraphIndent}[1]%
-{
-\\begin{list}{}{%
-\\setlength\\topsep{0pt}%
-\\addtolength{\\leftmargin}{#1}
-\\setlength\\parsep{0pt plus 1pt}%
-}
-\\item[]
-}
-{\\end{list}}
-
-\\newenvironment{ParagraphHang}[2]%
-{
-\\begin{list}{}{%
-\\setlength\\topsep{0pt}%
-\\addtolength{\\leftmargin}{#1}
-\\itemindent=#2
-\\setlength\\parsep{0pt plus 1pt}%
-}
-\\item[]
-}
-{\\end{list}}
-
-\\newenvironment{Bullet}[1]%
-{
-\\begin{list}{}{%
-\\setlength\\topsep{0pt}%
-\\addtolength{\\leftmargin}{#1}
-\\itemindent=-1em
-\\setlength\\parsep{0pt plus 1pt}%
-}
-\\item[]
-}
-{\\end{list}}
-\\usepackage{fancyhdr}
-\\lhead{}
-\\renewcommand{\\part}{\\\@startsection
- {part}{1}{-2mm}%
- {-\\baselineskip}{0.5\\baselineskip}%
- {\\bfseries\\large\\upshape\\raggedright}}
-\\renewcommand{\\section}{\\\@startsection
- {section}{2}{-2mm}%
- {-\\baselineskip}{0.5\\baselineskip}%
- {\\bfseries\\large\\upshape\\raggedright}}
-\\renewcommand{\\subsection}{\\\@startsection
- {subsection}{3}{-2mm}%
- {-\\baselineskip}{0.5\\baselineskip}%
- {\\bfseries\\large\\upshape\\raggedright}}
-\\renewcommand{\\subsubsection}{\\\@startsection
- {subsubsection}{4}{-2mm}%
- {-\\baselineskip}{0.5\\baselineskip}%
- {\\normalfont\\normalsize\\bfseries\\raggedright}}
-\\renewcommand{\\paragraph}{\\\@startsection
- {paragraph}{5}{-2mm}%
- {-\\baselineskip}{0.5\\baselineskip}%
- {\\normalfont\\normalsize\\itshape\\raggedright}}
-\\renewcommand{\\subparagraph}{\\\@startsection
- {subparagraph}%{6}%{-2mm}%
- {-\\baselineskip}{0.5\\baselineskip}%
- {\\normalfont\\normalsize\\itshape\\raggedright}}
-% \\makeatother
-\\selectlanguage{#{@lang.list[@md.i18n[0]][:xlp]}}
+% \\selectlanguage{#{tex_head_lang[:mainlang]}}
WOK
end
def a4generic
@@ -2668,9 +2800,7 @@ module SiSU_TeX_Pdf
"\n"
end
def header
- "\\lhead[ ]{ }\n" +
- "\\chead[ \\fancyplain{} \\bfseries \\footnotesize \\leftmark ]{ \\fancyplain{} \\bfseries \\footnotesize \\rightmark }\n" +
- "\\rhead[ ]{ }\n"
+ ""
end
def footer
"\\lfoot[\\textrm{\\thepage}]{\\tiny \\href{#{@md.footer_links[:left][:url]}}{#{@md.footer_links[:left][:say]}}}\n" +
@@ -2712,7 +2842,7 @@ module SiSU_TeX_Pdf
<<-WOK
\\\\ ~
{\\begin{footnotesize}#{base_prog_txt}
-\\\\ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU} \\begin{tiny}[ #{v.project} #{v.version} of #{v.date_stamp} ]\\end{tiny} \\href{http://www.jus.uio.no/sisu}{www.jus.uio.no/sisu}
+\\\\ Generated by \\href{https://git.sisudoc.org/}{SiSU} \\begin{tiny}[ #{v.project} #{v.version} of #{v.date_stamp} ]\\end{tiny} \\href{https://git.sisudoc.org/}{git.sisudoc.org}
\\\\ Copyright #{@copymark} 1997, current #{@date.year_static} Ralph Amissah, All Rights Reserved.
\\\\ SiSU is software for document structuring, publishing and search (with object citation numbering), \\href{http://www.sisudoc.org}{www.sisudoc.org}
\\\\ SiSU is released under \\href{http://www.fsf.org/licenses/gpl.html}{GPL 3 } or later, #{url_brace.tex_open}\\href{http://www.fsf.org/licenses/gpl.html}{http://www.fsf.org/licenses/gpl.html}#{url_brace.tex_close}.
@@ -2722,11 +2852,11 @@ module SiSU_TeX_Pdf
end
def doc_sc_info_footnote_full
<<-WOK
-\\footnote{%\nGenerated by \\href{http://www.jus.uio.no/sisu}{SiSU \\ www.jus.uio.no/sisu }\\ \\newline \\scriptsize{Document version information: \\emph{sourcefile} \\uline{#{@md.fnstex}}; \\emph{version} \\uline{#{@md.sc_number}}; \\emph{date} \\uline{#{@md.sc_date}}; \\emph{time} \\uline{#{@md.sc_time}}}}
+\\footnote{%\nGenerated by \\href{https://git.sisudoc.org/}{SiSU \\ git.sisudoc.org }\\ \\newline \\scriptsize{Document version information: \\emph{sourcefile} \\uline{#{@md.fnstex}}; \\emph{version} \\uline{#{@md.sc_number}}; \\emph{date} \\uline{#{@md.sc_date}}; \\emph{time} \\uline{#{@md.sc_time}}}}
WOK
end
def doc_sc_info_footnote_brief
- " \\footnote{%\nGenerated by \\href{http://www.jus.uio.no/sisu}{SiSU} \\ \\href{http://www.jus.uio.no/sisu}{www.jus.uio.no/sisu} \\newline \\href{http://www.sisudoc.org}{www.sisudoc.org} \\\n}"
+ " \\footnote{%\nGenerated by \\href{https://git.sisudoc.org/}{SiSU} \\ \\href{https://git.sisudoc.org/}{git.sisudoc.org} \\newline \\href{https://sisudoc.org}{sisudoc.org} \\\n}"
end
def doc_sc_info
v=SiSU_Env::InfoVersion.instance.get_version
@@ -2735,7 +2865,7 @@ module SiSU_TeX_Pdf
{\\begin{footnotesize}
Document version information: \\\\
\\emph{sourcefile} \\uline{#{@md.fnstex}}; \\emph{version} \\uline{#{@md.sc_number}}; \\emph{date} \\uline{#{@md.sc_date}}; \\emph{time} \\uline{#{@md.sc_time}} \\\\
-Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- version information: \\\\
+Generated by \\href{https://git.sisudoc.org/}{SiSU git.sisudoc.org }\\- version information: \\\\
\\uline{ #{v.project} #{v.version} of #{v.date_stamp}}
\\end{footnotesize}}&
WOK
@@ -2747,7 +2877,7 @@ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu }\\- ve
{\\begin{small}
Document information: \\\\
\\emph{sourcefile} \\uline{#{@md.fnstex}} \\\\
-Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu } \\\\ version information: \\
+Generated by \\href{https://git.sisudoc.org/}{SiSU https://git.sisudoc.org/ } \\\\ version information: \\
\\uline{ #{v.project} #{v.version} of #{v.date_stamp}}
\\end{small}}&
@@ -2764,10 +2894,10 @@ Generated by \\href{http://www.jus.uio.no/sisu}{SiSU www.jus.uio.no/sisu } \\\\
end
end
__END__
-ag usepackage texpdf*
-ag usepackage texpdf* | ag '\{.+?\}'
+rg usepackage texpdf*
+rg usepackage texpdf* | rg '\{.+?\}'
# texpdf_format.rb
-ag usepackage texpdf* | ag --only-matching '\{.+?\}'
+rg usepackage texpdf* | rg --only-matching '\{.+?\}' |sort|uniq
,* sort & make unique
@tex2pdf
@@ -2869,6 +2999,7 @@ xunicode.sty
texlive-base:
amssymb.sty
+
texlive-latex-base:
alltt.sty
babel.sty
@@ -2881,6 +3012,7 @@ texlive-latex-base:
multicol.sty
textcomp.sty
url.sty
+
texlive-latex-extra:
boites.sty
breakurl.sty
@@ -2890,6 +3022,7 @@ texlive-latex-extra:
soul.sty
titlepic.sty
ucs.sty
+
texlive-latex-recommended:
fontspec.sty
listings.sty
@@ -2898,8 +3031,10 @@ texlive-latex-recommended:
thumbpdf.sty
xltxtra.sty
xunicode.sty
+
texlive-plain-generic:
ulem.sty
+
texlive-xetex:
xeCJK.sty
@@ -2911,7 +3046,6 @@ texlive-latex-extra
texlive-latex-recommended
texlive-plain-generic
texlive-xetex
-
#+END_SRC
* document header
@@ -2968,6 +3102,6 @@ encoding: utf-8
- Git
<https://git.sisudoc.org/projects/>
- <https://git.sisudoc.org/projects/?p=software/sisu.git;a=summary>
- <https://git.sisudoc.org/projects/?p=markup/sisu-markup-samples.git;a=summary>
+ <https://git.sisudoc.org/projects/sisu>
+ <https://git.sisudoc.org/projects/sisu-markup>
#+END_SRC