aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-07-12 16:51:12 -0400
committerRalph Amissah <ralph@amissah.com>2010-07-12 16:51:12 -0400
commit59a86332cb9d653f1f7c3b3fe77e95aa8aa30135 (patch)
tree8258d2f5ddf9b26395b1d3fcccd5d3febef25018
parentparam, rights (all) add line breaks between copyright, license and other rights (diff)
texpdf, if no "copy @" info remove; rename left footer; asterisk issue
-rw-r--r--lib/sisu/v2/defaults.rb3
-rw-r--r--lib/sisu/v2/texpdf.rb16
-rw-r--r--lib/sisu/v2/texpdf_format.rb11
3 files changed, 20 insertions, 10 deletions
diff --git a/lib/sisu/v2/defaults.rb b/lib/sisu/v2/defaults.rb
index 09a9808b..da61c7eb 100644
--- a/lib/sisu/v2/defaults.rb
+++ b/lib/sisu/v2/defaults.rb
@@ -364,6 +364,9 @@ module SiSU_Viz
def url_sisudoc
'http://www.sisudoc.org'
end
+ def url_footer_signature
+ 'http://www.jus.uio.no/sisu'
+ end
def url_root
'/sisu' #watch
end
diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb
index 0d77d65b..531cc5c9 100644
--- a/lib/sisu/v2/texpdf.rb
+++ b/lib/sisu/v2/texpdf.rb
@@ -295,10 +295,10 @@ module SiSU_TeX
and not @md.rights.all.empty?
rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed
sp_char=SiSU_TeX_Pdf::Special_characters.new(@md,rght.copyright.all)
- copymark=if @md.author_copymark; '{\\begin{small}\\raisebox{1ex}{\\copyright}\\end{small}} '
- else ''
- end
- copymark='Copyright {\\begin{small}\\raisebox{1ex}{\\copyright}\\end{small}} '
+ copymark=@md.author_copymark \
+ ? '{\begin{small}\copyright\end{small}} ' \
+ : ''
+ copymark='Copyright {\begin{small}\copyright\end{small}} '
copyright=sp_char.special_characters_safe.gsub(/^\s*Copyright \(C\)/, copymark)
@@rights||="\n #{Tex[:backslash]*2}[3]\\ \\linebreak #{copyright}"
end
@@ -566,8 +566,10 @@ module SiSU_TeX
\\makeatother
\\chardef\\txtbullet="2022
\\chardef\\tilde="7E
+%\\chardef\\asterisk="2A
+\\def\\asterisk{{\\rm \\char42} }
\\definecolor{Light}{gray}{.92}
-\\newcommand{\\Codeblock}[1]{\\normaltext\\raggedright\\tiny\\ttfamily\\texbackslash#1}
+\\newcommand{\\Codeblock}[1]{\\normaltext\\raggedright\\small\\ttfamily\\texbackslash#1}
\\newcommand{\\monosp}[1]{\\normaltext\\ttfamily\\texbackslash#1}
% \\sloppy
\\begin{document}
@@ -594,8 +596,8 @@ WOK
else "\n\\author{#{@copymark} \\textnormal{#{author}}}"
end
end
- @tex_file << unless @md.fnb =~/^mail\s*$/; "\n\\date{\\begin{footnotesize} copy @ #{@tex_ml.site} \\end{footnotesize}}"
- else "\\date"
+ @tex_file << unless @md.fnb =~/^mail\s*$/; @tex_ml.site
+ else '\date'
end
@tex_file <<<<WOK
\\pagenumbering{roman}\\maketitle
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index 4e489466..41802557 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -992,7 +992,8 @@ WOK
str.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>') # ~ SiSU special character also LaTeX
str.gsub!(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'\#') # # SiSU special character also LaTeX
str.gsub!(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!') # ! SiSU not really special sisu character but done, also LaTeX
- str.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*') # * should you wish to escape astrisk e.g. describing \*{bold}*
+ str.gsub!(/(^|\s)\*\s/,'\1\asterisk ') # * should you wish to escape astrisk e.g. describing \*{bold}*
+ str.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'\*') # * should you wish to escape astrisk e.g. describing \*{bold}*
str.gsub!(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-') # - SiSU special character also LaTeX
str.gsub!(/#{Mx[:gl_o]}#043#{Mx[:gl_c]}/,'+') # + SiSU special character also LaTeX
str.gsub!(/#{Mx[:gl_o]}#044#{Mx[:gl_c]}/,',') # + SiSU special character also LaTeX
@@ -1196,12 +1197,16 @@ WOK
end
else ''
end
- "\\lfoot[\\textrm{\\thepage}]{\\tiny \\href{#{@vz.url_sisu}}{#{@vz.txt_signature}}#{base_prog_txt}}\n" +
+ "\\lfoot[\\textrm{\\thepage}]{\\tiny \\href{#{@vz.url_footer_signature}}{#{@vz.txt_signature}}#{base_prog_txt}}\n" +
"\\cfoot[\\href{#{@vz.url_home}}{#{@vz.url_txt}}]{\\href{#{@vz.url_home}}{#{@vz.url_txt}}}\n" +
"\\rfoot[\\tiny \\href{#{@vz.url_sisu}}{#{@vz.txt_signature}}]{\\textrm{\\thepage}}\n"
end
def site
- "\\href{#{@vz.url_home}}{#{@vz.url_txt}}"
+ if not @vz.url_home.empty? \
+ and not @vz.url_txt.empty?
+ "\n\\date{\\begin{footnotesize} copy @ \\href{#{@vz.url_home}}{#{@vz.url_txt}} \\end{footnotesize}}"
+ else ''
+ end
end
def sitename #owners site, eg freeculture, free.for.all, gutenberg etc.
"\\href{#{@vz.url_home}}{#{@vz.txt_home}}"