diff options
Diffstat (limited to 'lib/sisu/v0/texpdf_format.rb')
-rw-r--r-- | lib/sisu/v0/texpdf_format.rb | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb index 55a9473f..58dca26e 100644 --- a/lib/sisu/v0/texpdf_format.rb +++ b/lib/sisu/v0/texpdf_format.rb @@ -701,7 +701,7 @@ WOK def tex_head_paper_landscape(d) <<WOK #{tex_head_info} -\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang}, landscape, titlepage, twocolumn]{scrartcl} %with titlepage +\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang},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]}} @@ -714,7 +714,7 @@ WOK def tex_head_paper_portrait_dvi(d) <<WOK #{tex_head_info} -\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang},titlepage]{scrartcl} %with titlepage +\\documentclass[#{d[:fontsize]},#{d[:papertype]},#{tex_head_lang},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]}} @@ -760,12 +760,12 @@ WOK when /landscape/ #d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w d[:papertype],d[:fontsize]='a4paper','11pt' - d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-8mm','-8mm','-18mm' + d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='6mm','6mm','-12mm' d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt' d[:marginparsep],d[:marginparwidth]='4mm','8mm' case @ps #@md.papersize when /a4/i #European default, SiSU default - d[:papertype],d[:fontsize]='a4paper','12pt' + d[:papertype],d[:fontsize]='a4paper','11pt' d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w when /letter/i #U.S. default d[:papertype],d[:fontsize]='letterpaper','11pt' @@ -813,7 +813,6 @@ WOK end if @layout =~/portrait|landscape/ <<WOK -\\usepackage{url} \\usepackage{alltt} \\usepackage{thumbpdf} \\usepackage[#{@tex2pdf}, @@ -851,10 +850,11 @@ WOK \\definecolor{mygreen}{rgb}{0,0.5,0} \\definecolor{myblue}{rgb}{0,0,0.5} \\definecolor{mywhite}{rgb}{1,1,1} +\\usepackage{url} +%\\usepackage{breakurl} WOK elsif @txt =~/dvi/ <<WOK -\\usepackage{url} \\usepackage{alltt} #{color.strip} pageanchor=true, @@ -871,6 +871,8 @@ WOK \\definecolor{mygreen}{rgb}{0,0.5,0} \\definecolor{myblue}{rgb}{0,0,0.5} \\definecolor{mywhite}{rgb}{1,1,1} +\\usepackage{url} +%\\usepackage{breakurl} WOK end end @@ -884,7 +886,7 @@ WOK \\usepackage{graphicx} \\makeatletter \\parindent0pt -\\usepackage{mathptmx} +%\\usepackage{mathptmx} \\usepackage{amssymb} % amssymb used for backslash WOK @@ -1045,14 +1047,14 @@ WOK string.gsub!(/<a href=".+?">/,' ') string.gsub!(/<\/a>/,' ') string.gsub!(/((?:^|\s)#{Mx[:lnk_c]})((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/, - '\1\begin{scriptsize}\\href{\2}{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url + '\1\begin{scriptsize}\url{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url string.gsub!(/[^\}>_]((?:https?|file|ftp):\/\/\S+?)(<\/\S>)/, - ' \begin{scriptsize}\href{\1}{\1} \end{scriptsize}\2') #special case + ' \begin{scriptsize}\url{\1} \end{scriptsize}\2') #special case string.gsub!(/\B(?:\\_|\\)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/, - '\begin{scriptsize}\\href{\1}{\1}\end{scriptsize}\2') #specially escaped url no decoration + '\begin{scriptsize}\\url{\1}\end{scriptsize}\2') #specially escaped url no decoration unless @@flag_code string.gsub!(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/, - "\\1#{@url_brace.tex_open}\\begin{scriptsize}\\href{\\2}{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration <url> positive lookahead, sequence issue with { linked }http://url cannot use \b at start + "\\1#{@url_brace.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration <url> positive lookahead, sequence issue with { linked }http://url cannot use \b at start else #code-block: angle brackets special characters, note _ already escaped string.gsub!(/\\_</,'{\UseTextSymbol{OML}{<}}') string.gsub!(/\\_>/,'{\UseTextSymbol{OML}{>}}') @@ -1103,7 +1105,7 @@ WOK #string.gsub!(/<=gt>/,'\>') string.gsub!(/<=underscore>/,'\_') string.gsub!(/(\href\{http:\/\/\S+?)(?:(?:<=tilde>)(\S+))+\}/,'\1\~\2}') #tildes in urls \href treated differently from text - string.gsub!(/<=tilde>/,'{\~~}') + string.gsub!(/<=tilde>/,'{$\sim$}') string.gsub!(/<=pipe>/,'{\textbar}') string.gsub!(/<=caret>/,'{\^{~}}') #string.gsub!(/<=caret>/,'\^{}') @@ -1212,14 +1214,14 @@ WOK string.gsub!(/<a href=".+?">/,' ') string.gsub!(/<\/a>/,' ') string.gsub!(/((?:^|\s)#{Mx[:lnk_c]})((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/, - '\1\begin{scriptsize}\\href{\2}{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url + '\1\begin{scriptsize}\url{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url string.gsub!(/[^\}>_]((?:https?|file|ftp):\/\/\S+?)(<\/\S>)/, - ' \begin{scriptsize}\href{\1}{\1} \end{scriptsize}\2') #special case + ' \begin{scriptsize}\url{\1} \end{scriptsize}\2') #special case string.gsub!(/\B(?:\\_|\\)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/, - '\begin{scriptsize}\\href{\1}{\1}\end{scriptsize}\2') #specially escaped url no decoration + '\begin{scriptsize}\\url{\1}\end{scriptsize}\2') #specially escaped url no decoration unless @@flag_code string.gsub!(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/, - "\\1#{@url_brace.tex_open}\\begin{scriptsize}\\href{\\2}{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration <url> positive lookahead, sequence issue with { linked }http://url cannot use \b at start + "\\1#{@url_brace.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration <url> positive lookahead, sequence issue with { linked }http://url cannot use \b at start else #code-block: angle brackets special characters, note _ already escaped string.gsub!(/\\_</,'{\UseTextSymbol{OML}{<}}') string.gsub!(/\\_>/,'{\UseTextSymbol{OML}{>}}') @@ -1274,7 +1276,7 @@ WOK #string.gsub!(/<=gt>/,'\>') string.gsub!(/<=underscore>/,'\_') string.gsub!(/(\href\{http:\/\/\S+?)(?:(?:<=tilde>)(\S+))+\}/,'\1\~\2}') #tildes in urls \href treated differently from text - string.gsub!(/<=tilde>/,'{\~~}') + string.gsub!(/<=tilde>/,'{$\sim$}') string.gsub!(/<=pipe>/,'{\textbar}') string.gsub!(/<=caret>/,'{\^{~}}') #string.gsub!(/<=caret>/,'\^{}') |