diff options
Diffstat (limited to 'lib/sisu/v5/texpdf.rb')
-rw-r--r-- | lib/sisu/v5/texpdf.rb | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb index fe7ec47e..c2c9dc70 100644 --- a/lib/sisu/v5/texpdf.rb +++ b/lib/sisu/v5/texpdf.rb @@ -64,7 +64,8 @@ module SiSU_TeX begin require 'pstore' rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error('pstore NOT FOUND (LoadError)') end require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -85,7 +86,8 @@ module SiSU_TeX begin require 'pstore' rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error('pstore NOT FOUND (LoadError)') end require_relative 'se' # se.rb include SiSU_Env @@ -267,8 +269,16 @@ module SiSU_TeX FileUtils::cp(portrait_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_p}") FileUtils::rm(portrait_pdf) else - STDERR.puts "#{cX.fuchsia}pdf file not generated#{cX.off} <#{cX.blue}#{portrait_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" STDERR.puts "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.opt.act[:maintenance][:set]==:on + errmsg="pdf file not generated #{portrait_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')} (check texlive dependencies)" + if @md.opt.act[:no_stop][:set]==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error("#{errmsg}, proceeding without pdf output (as requested)") + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error("#{errmsg}, STOPPING") + exit + end end end if @md.opt.act[:pdf_l][:set]==:on @@ -276,8 +286,16 @@ module SiSU_TeX FileUtils::cp(landscape_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_l}") FileUtils::rm(landscape_pdf) else - STDERR.puts "#{cX.fuchsia}pdf file not generated#{cX.off} <#{cX.blue}#{landscape_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" STDERR.puts "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.opt.act[:maintenance][:set]==:on + errmsg="pdf file not generated #{landscape_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')} (check texlive dependencies)" + if @md.opt.act[:no_stop][:set]==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error("#{errmsg}, proceeding without pdf output (as requested)") + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error("#{errmsg}, STOPPING") + exit + end end end if (@md.opt.act[:verbose][:set]==:on \ @@ -312,7 +330,15 @@ module SiSU_TeX and File.size(texfile) > 0 #@tex_f_no+=1 else - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error("\tzero file size #{@env.processing_path.tex}/#{texfile}") + errmsg="zero file size #{@env.processing_path.tex}/#{texfile}" + if @md.opt.act[:no_stop][:set]==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error("#{errmsg}, proceeding without pdf output (as requested)") + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error("#{errmsg}, STOPPING") + exit + end end end end @@ -423,12 +449,10 @@ module SiSU_TeX if defined? @md.rights.all \ and not @md.rights.all.empty? rght=@md.rights #.author.dup #dup is necessary, else contents of :rights changed - sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.all) - 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) + sp_char=SiSU_TeX_Pdf::SpecialCharacters.new(@md,rght.copyright.copyright_and_license) + copymark='Copyright {\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 if defined? @md.notes.prefix_b \ |