From e38554e5acad9b3dd93b0e6e4cedd39d5ff2f1a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:31:23 -0400 Subject: v5 v6: coding, various minor cosmetic --- lib/sisu/v6/texpdf_format.rb | 46 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'lib/sisu/v6/texpdf_format.rb') diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index 97007d17..c1bd0f1c 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -1188,16 +1188,16 @@ module SiSU_TeX_Pdf @brace_url=SiSU_Viz::Defaults.new.url_decoration @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine end - def xetex_code_listings(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list + def xetex_code_listings(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ para_array=[] str=if word word.each do |w| # _ - / # | : ! ^ ~ w=w.gsub(/#{Mx[:gl_o]}#lt#{Mx[:gl_c]}/,'<').gsub(/#{Mx[:gl_o]}#gt#{Mx[:gl_c]}/,'>'). gsub(/[\\]?~/,'~'). - gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,"\n"). #watch - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). #126 usual - gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX + gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,"\n"). #watch + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). #126 usual + gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX para_array << w end str=para_array.join(' ') @@ -1210,30 +1210,30 @@ module SiSU_TeX_Pdf gsub(/#{Mx[:br_eof]}/,''). gsub(/#{Mx[:br_endnotes]}/,''). #problem sequence -> - gsub(/&(?:lt|#060);/,'<'). # < SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'>'). # > SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{'). # { SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}'). # } SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). # ~ SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#'). # # SiSU special character also LaTeX + gsub(/&(?:lt|#060);/,'<'). # < SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'>'). # > SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{'). # { SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}'). # } SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). # ~ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#'). # SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!'). # ! SiSU not really special sisu character but done, also LaTeX #gsub(/(^|\s)\*\s/,'\1\asterisk '). # * should you wish to escape astrisk e.g. describing \*{bold}* - gsub(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*'). # * should you wish to escape astrisk e.g. describing \*{bold}* + gsub(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*'). # * should you wish to escape astrisk e.g. describing \*{bold}* gsub(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-'). # - SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#043#{Mx[:gl_c]}/,'+'). # + SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#044#{Mx[:gl_c]}/,','). # + SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'&'). #unless @txt=~/<:code>/ # / SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/'). # / SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\'). # \ SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_'). # _ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'&'). #unless @txt=~/<:code>/ # / SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/'). # / SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\'). # \ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_'). # _ SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|'). # | SiSU not really special sisu character but done, also LaTeX gsub(/#{Mx[:gl_o]}#058#{Mx[:gl_c]}/,':'). # : SiSU not really special sisu character but done, also LaTeX - gsub(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'^'). # ^ SiSU not really special sisu character but done, also LaTeX + gsub(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'^'). # ^ SiSU not really special sisu character but done, also LaTeX ##watch placement, problem sequence ^ gsub(/&atild;<\/font><\/sup>/,' '). - gsub(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript + gsub(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript end - def xetex_special_characters_1(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list + def xetex_special_characters_1(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ para_array=[] str=if word @@ -1245,9 +1245,9 @@ module SiSU_TeX_Pdf end w=w.gsub(/#{Mx[:gl_o]}#lt#{Mx[:gl_c]}/,'<').gsub(/#{Mx[:gl_o]}#gt#{Mx[:gl_c]}/,'>'). gsub(/[\\]?~/,'<=tilde>'). - gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline '). #watch - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>'). #126 usual - gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'\pipe') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX + gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline '). #watch + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>'). #126 usual + gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'\pipe') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX if w !~/#{Mx[:rel_o]}/ \ and w !~/#{Mx[:gl_o]}#/ w=w.gsub(/\#/,'<=hash>') @@ -1264,8 +1264,8 @@ module SiSU_TeX_Pdf gsub(/#{Mx[:br_eof]}/,''). gsub(/#{Mx[:br_endnotes]}/,'') #problem sequence -> - str=str.gsub(/&(?:nbsp);|#{Mx[:nbsp]}/,'\hardspace') unless is==:code # < SiSU special character also LaTeX - str=str.gsub(/&(?:lt|#060);/,'\lt'). # < SiSU special character also LaTeX + str=str.gsub(/&(?:nbsp);|#{Mx[:nbsp]}/,'\hardspace') unless is==:code # < SiSU special character also LaTeX + str=str.gsub(/&(?:lt|#060);/,'\lt'). # < SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'\gt'). # > SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'\curlyopen'). # { SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'\curlyclose'). # } SiSU special character also LaTeX -- cgit v1.2.3