diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sisu/v3/epub.rb | 11 | ||||
| -rw-r--r-- | lib/sisu/v3/odf.rb | 9 | ||||
| -rw-r--r-- | lib/sisu/v3/shared_images.rb | 47 | ||||
| -rw-r--r-- | lib/sisu/v3/sisupod_make.rb | 66 | ||||
| -rw-r--r-- | lib/sisu/v3/sysenv.rb | 32 | ||||
| -rw-r--r-- | lib/sisu/v3/texpdf_format.rb | 100 | 
6 files changed, 164 insertions, 101 deletions
| diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index 70b86f25..a2530cbb 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -631,13 +631,20 @@ module SiSU_EPUB        end        def images          img_pth=@md.env.path.image_source_include +        img_src_pth=unless @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ +          @md.file.output_path.epub.rel_image +        else +          pt=/(\/\S+?\/sisupod\/\S+?\/sisupod)\/doc/.match(@md.opt.f_pth[:pth])[1] +          pt + '/image' +        end          @md.ec[:image].each do |x|            if FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \ -          && FileTest.file?("#{@md.file.output_path.epub.rel_image}/#{x}") -            FileUtils::cp("#{@md.file.output_path.epub.rel_image}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") +          && FileTest.file?("#{img_src_pth}/#{x}") +            FileUtils::cp("#{img_src_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image")            elsif FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \            && FileTest.file?("#{img_pth}/#{x}")              FileUtils::cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") +          else STDERR.puts %{\t*WARN* did not find image - "#{x}" in #{img_src_pth} or #{img_pth} [#{__FILE__}:#{__LINE__}]}            end          end        end diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index 57994a28..4985b3dd 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -187,6 +187,15 @@ module SiSU_ODF          image_source=if @md.fns =~/\.ss[tm]$/ \          and FileTest.file?("#{@env.path.image_source_include}/#{i}") #review            @env.path.image_source_include +        elsif @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ +          pt=/(\/\S+?\/sisupod\/\S+?\/sisupod)\/doc/.match(@md.opt.f_pth[:pth])[1] +          img_src=pt + '/image' +          if FileTest.file?("#{img_src}/#{i}") +            img_src +          else +            SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{i}" missing},"search locations: #{@env.path.image_source_include_local},#{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.cmd =~/q/ +            nil +          end          elsif @md.fns =~/\.ss[tm]$/ \          and FileTest.file?("#{@env.path.image_source_include_local}/#{i}") #review            @env.path.image_source_include_local diff --git a/lib/sisu/v3/shared_images.rb b/lib/sisu/v3/shared_images.rb index 46b568d8..a5a412b8 100644 --- a/lib/sisu/v3/shared_images.rb +++ b/lib/sisu/v3/shared_images.rb @@ -73,6 +73,9 @@ module SiSU_Images        def songsheet          images_set.select_sisu_base          images_set.select_with_document +        if @md.opt.cmd =~/h/ +          images_set.select_with_document_skin +        end        end        def images_set          @pwd=ENV['PWD'] @@ -101,19 +104,57 @@ module SiSU_Images            pth=if image_type==:image_sys              pth=(@o_str.dump_or_redirect?) \              ? "#{@md.file.output_path.html.dir}/image" -            : "#{@env.path.webserv}/_sisu/image_sys" +            : "#{@md.file.output_path.base.dir}/_sisu/image_sys"            elsif image_type==:image              pth=(@o_str.dump_or_redirect?) \              ? "#{@md.file.output_path.html.dir}/image" -            : "#{@env.path.webserv}/_sisu/image" +            : "#{@md.file.output_path.base.dir}/_sisu/image"            end +          pth          end          def select_with_document            images=@md.ec[:image] -          src_path="#{@pwd}/_sisu/image" +          src_path=unless @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ +            "#{@pwd}/_sisu/image" +          else #sisupod +            pt=/(\/\S+?\/sisupod\/\S+?\/sisupod)\/doc/.match(@md.opt.f_pth[:pth])[1] +            pt + '/image' +          end            dest=dest_path(:image)            copy(src_path,dest,images)          end +        def select_with_document_skin +          rgx_rb_image=/["']\S*?([a-zA-Z0-9_-]+?\.(?:png|jpg|gif))["']/ +          skin_source=SiSU_Env::InfoSkin.new(@md).apply +          docskin=nil +          if skin_source[:type] == :dir +            docskin_with_path="#{docskin_place}/skin_#{@env.stub_pwd}.rb" +            docskin=[docskin_with_path.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')] +            #docskin='skin_sisupod' +          end +          images=[] +          if skin_source \ +          and skin_source[:name_path] #imperfect, revisit +            unless (skin_source[:name_path].nil? \ +            or skin_source[:name_path].empty?) +              skinfile_array=IO.readlines(skin_source[:name_path],'') +              skinfile_array.each do |f|                                           #% work area +                unless f =~/^%+ / #hmmm +                  images << f.scan(rgx_rb_image).uniq if f =~rgx_rb_image +                  #does not really discriminate, may duplicate images in sisu file, and may take images from default image pool +                end +              end +            end +          end +          src_path=unless @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ +            "#{@pwd}/_sisu/image" +          else #sisupod +            pt=/(\/\S+?\/sisupod\/\S+?\/sisupod)\/doc/.match(@md.opt.f_pth[:pth])[1] +            pt + '/image' +          end +          dest=dest_path(:image) +          copy(src_path,dest,images.flatten) +        end          def select_sisu_base            images=%w[arrow_next_red.png arrow_prev_red.png arrow_up_red.png dot_clear.png dot_white.png b_doc.png b_epub.png b_odf.png b_pdf.png b_toc.png]            src_path="#{@env.path.share}/image" diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb index 54376271..984d807d 100644 --- a/lib/sisu/v3/sisupod_make.rb +++ b/lib/sisu/v3/sisupod_make.rb @@ -143,14 +143,14 @@ module SiSU_Doc        sk_doc,sk_dir="doc/#{skin}.rb","dir/skin_#{@env.stub_pwd}.rb"        skin_path.each do |v|                                                    #document skin priority 1          if FileTest.file?("#{v}/#{sk_doc}") -          @skin[:name],@skin[:type]="#{v}/#{sk_doc}",'doc' +          @skin={ name_path: "#{v}/#{sk_doc}", type: :doc }            break          end        end        unless @skin.length > 0          skin_path.each do |v|                                                  #directory skin priority 2            if FileTest.file?("#{v}/#{sk_dir}") -            @skin[:name],@skin[:type]="#{v}/#{sk_dir}",'dir' +            @skin={ name_path: "#{v}/#{sk_dir}", type: :dir }              break            end          end @@ -167,7 +167,7 @@ module SiSU_Doc      end      def sisupod_build                                                          #see also sisupod in sysenv        @pwd=Dir.pwd -      @rgx_rb_image=/["'](\S+?\.(?:png|jpg|gif))["']/ +      @rgx_rb_image=/["']\S*?([a-zA-Z0-9_-]+?\.(?:png|jpg|gif))["']/        @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/        @rgx_skin=/^\s+:skin:\s+(\S+)/        @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/ @@ -207,24 +207,26 @@ module SiSU_Doc        else          skin_source=select_skin        end -      docskin_place="#{@env.processing_path.processing_sisupod(@opt)}/doc/_sisu/skin/#{skin_source[:type]}" +      docskin_place="#{@env.processing_path.processing_sisupod(@opt)}/doc/_sisu/skin/#{skin_source[:type].to_s}"        FileUtils::mkdir_p(docskin_place) -      if skin_source[:type] =~/dir/ +      if skin_source[:type] == :dir          docskin_with_path="#{docskin_place}/skin_#{@env.stub_pwd}.rb"          docskin=[docskin_with_path.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')]          docskin='skin_sisupod'        end        if skin_source \ -      and docskin #imperfect, revisit -        unless skin_source[:name].nil? \ -        or skin_source[:name].empty? -          FileUtils::cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb") -          skinfile_array=IO.readlines(skin_source[:name],'') -          para_images=[] -          skinfile_array.each do |f|                                           #% work area -            unless f =~/^%+ / #hmmm -              images << f.scan(@rgx_rb_image).uniq if f =~@rgx_rb_image -              #does not really discriminate, may duplicate images in sisu file, and may take images from default image pool +      and skin_source[:name_path] +        unless skin_source[:name_path].nil? \ +        or skin_source[:name_path].empty? +          if FileTest.file?(skin_source[:name_path]) +            FileUtils::cp(skin_source[:name_path],"#{docskin_place}/#{docskin}.rb") +            skinfile_array=IO.readlines(skin_source[:name_path],'') +            para_images=[] +            skinfile_array.each do |f|                                           #% work area +              unless f =~/^%+ / #hmmm +                images << f.scan(@rgx_rb_image).uniq if f =~@rgx_rb_image +                #does not really discriminate, may duplicate images in sisu file, and may take images from default image pool +              end              end            else STDERR.puts %{\t*WARN* did not find - "#{skin_source[:name_path]}" [#{__FILE__}:#{__LINE__}]}            end @@ -282,18 +284,34 @@ module SiSU_Doc            if f[:f] =~/\~(\S{2,3})\.ss[tm]$/              lng_f=$1              if @opt.lng == lng_f -              (@opt.fno =~/\.ssm$/) \ -              ? FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}", +              if @opt.fno =~/\.ssm$/ +                if FileTest.file?("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}") +                  FileUtils::cp("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}", +                    "#{@env.processing_path.processing_sisupod(@opt)}/doc/#{@opt.lng}/#{f[:n]}") +                else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} +                end +              else +                if FileTest.file?("#{@env.path.pwd}/#{f[:f]}") +                  FileUtils::cp("#{@env.path.pwd}/#{f[:f]}", +                    "#{@env.processing_path.processing_sisupod(@opt)}/doc/#{@opt.lng}/#{f[:n]}") +                else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} +                end +              end +            end +          else +            if @opt.fno =~/\.ssm$/ +              if FileTest.file?("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}") +                FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}",                    "#{@env.processing_path.processing_sisupod(@opt)}/doc/#{@opt.lng}/#{f[:n]}") -              : FileUtils::cp_r("#{@env.path.pwd}/#{f[:f]}", +              else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} +              end +            else +              if FileTest.file?("#{@env.path.pwd}/#{f[:f]}") +                FileUtils::cp("#{@env.path.pwd}/#{f[:f]}",                    "#{@env.processing_path.processing_sisupod(@opt)}/doc/#{@opt.lng}/#{f[:n]}") +              else STDERR.puts %{\t*WARN* did not find - "#{@env.path.pwd}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} +              end              end -          else -            (@opt.fno =~/\.ssm$/) \ -            ? FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}", -                "#{@env.processing_path.processing_sisupod(@opt)}/doc/#{@opt.lng}/#{f[:n]}") -            : FileUtils::cp_r("#{@env.path.pwd}/#{f[:f]}", -                "#{@env.processing_path.processing_sisupod(@opt)}/doc/#{@opt.lng}/#{f[:n]}")            end          end        end #NB not all possibilies met, revisit, also in case of composite file may wish to add README diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index e03c668d..f57185fc 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -5668,6 +5668,38 @@ WOK        @pwd_stub=@pwd[m,1]        @env=SiSU_Env::InfoEnv.new      end +    def apply +      if @md.make.skin +        skin_path=unless @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ +          [ +            "#{@env.path.pwd}/_sisu/skin", +            "#{@env.path.home}/.sisu/skin", +            '/etc/sisu/skin', +            "#{@env.processing_path.processing_sisupod(@md.opt)}/external_document/skin" +          ] +        else #sisupod +          pt=/(\/\S+?\/sisupod\/\S+?\/sisupod\/doc)/.match(@md.opt.f_pth[:pth])[1] +          [ "#{pt}/_sisu/skin" ] +        end +        sk_doc,sk_dir="doc/#{@md.make.skin}.rb","dir/skin_#{@env.stub_pwd}.rb" +        skin_path.each do |v|                                                    #document skin priority 1 +          if FileTest.file?("#{v}/#{sk_doc}") +            @skin_apply={ name: @md.make.skin, name_path: "#{v}/#{sk_doc}", type: :doc } +            break +          end +        end +        unless @skin_apply.length > 0 +          skin_path.each do |v|                                                  #directory skin priority 2 +            if FileTest.file?("#{v}/#{sk_dir}") +              @skin_apply={ name: "skin_#{@env.stub_pwd}.rb", name_path: "#{v}/#{sk_dir}", type: :dir } +              break +            end +          end +        end +      else nil +      end +      @skin_apply +    end      def select                                                                 # skin loading logic here        load "#{SiSU_lib}/defaults.rb"        skin_path=[] diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 626020c3..75eadedc 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -478,67 +478,6 @@ module SiSU_TeX_Pdf          @txt.gsub!(/#{Mx[:lnk_o]}\S+\.(png|jpg|gif).+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/,'') # fragile match operator\\ fragile !        end      end -    def image -      dir=SiSU_Env::InfoEnv.new(@md.fns) -      image,m=/#{Mx[:lnk_o]}\s*(\S+)\s+.+?width=``(\d+)''.+?#{Mx[:lnk_c]}/m.match(@txt).captures -      width=m[1] || '100' -      width=width.to_i*0.4 -      image_source=if @md.fns =~/\.(?:ssm\.)?sst$/ \ -      and FileTest.file?("#{dir.path.image_source_include_local}/#{image}") -        dir.path.image_source_include_local -      elsif @md.fns =~/\.-ss[tm]$/ \ -      and FileTest.file?("#{dir.path.image_source_include_remote}/#{image}") -        dir.path.image_source_include_remote -      elsif FileTest.file?("#{dir.path.image_source_include}/#{image}") -        dir.path.image_source_include -      else -        SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.opt.cmd =~/q/ -        nil -      end -      if image_source #CHECK -        @txt.gsub!(/#{Mx[:lnk_o]}\s*(\S+)\s+.+?#{Mx[:lnk_c]}/, -          @center_begin + "\\includegraphics*[width=#{width}pt]{#{image_source}/\\1}" + @center_end ) -      else @txt.gsub!(/#{Mx[:lnk_o]}\s*(\S+)\s+.+?#{Mx[:lnk_c]}/,'\1}') -      end -    end -    def png(ps='') #fc missing image check -      dir=SiSU_Env::InfoEnv.new(@md.fns) -      # messy clean up -      z=@txt[/#{Mx[:lnk_o]}(\S.+?)#{Mx[:lnk_c]}(?:image|png)/,1].strip if @txt =~ /#{Mx[:lnk_o]}\S.+?#{Mx[:lnk_c]}(?:image|png)/ # match operator for z \\ fragile ! -      if z #debug 2004w14 -        image=z[/(\S+?\.(?:png|jpg|gif)\b)/m] -        image.gsub!(/\\/,'') -        width=if z =~ /\d+x\d*/ -          w=(z[/\s(\d+)x\d*/,1]).to_i -          w*0.8 -        else '100' #revisit, is bug for small images/icons -        end -        width='380' if width.to_i > 380 -        c=z[/``(.+?)''/m] -      end -      hsp="\n{\\color{mywhite} .}&~\n" # ~ character for hardspace -      caption="{\\\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" if c -      image_source=if @md.fns =~/\.(?:ssm\.)?sst$/ \ -      and FileTest.file?("#{dir.path.image_source_include_local}/#{image}") -        dir.path.image_source_include_local -      elsif @md.fns =~/\.-ss[tm]$/ \ -      and FileTest.file?("#{dir.path.image_source_include_remote}/#{image}") -        dir.path.image_source_include_remote -      elsif FileTest.file?("#{dir.path.image_source_include}/#{image}") -        dir.path.image_source_include -      else -        unless image.nil? \ -        or image.length < 2 -          SiSU_Screen::Ansi.new(@md.opt.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_include_local},#{dir.path.image_source_include_remote} and #{dir.path.image_source_include}").error2 unless @md.opt.cmd =~/q/ -        end -        nil -      end -      if image_source -        @txt.gsub!(/#{Mx[:lnk_o]}\S+\.(png|jpg|gif).+?#{Mx[:lnk_c]}(image|png)/, # fragile match operator\\ fragile ! -          "#{@center_begin}\n\\includegraphics*[width=#{width}pt]{#{image_source}/#{image}}#{caption}#{@center_end}") -      else @txt.gsub!(/#{Mx[:lnk_o]}\S+\.(png|jpg|gif).+?#{Mx[:lnk_c]}(image|png)/,'') -      end -    end      def url_str_internal(str,idx=nil)        map_nametags=SiSU_Particulars::CombinedSingleton.instance.get_map_nametags(@md).nametags_map #p map_nametags        rgx_url_generic=/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/m @@ -684,36 +623,53 @@ module SiSU_TeX_Pdf                images_hash[ps].gsub!(/#{Mx[:lnk_o]}\s*(\S+\.?\.(?:png|jpg|gif))/,'[image]')              end              if image #most images fc etc. #% clean up ! -              if @md.fns =~/\.(?:ssm\.)?sst$/ \ -              and FileTest.file?("#{dir.path.image_source_include_local}/#{image}") +              if FileTest.file?("#{dir.path.image_source_include}/#{image}")                  case images_hash[ps]                  when url_image_rgx                    images_hash[ps].sub!(url_image_rgx, -                    "#{@center_begin}\\\n\\href{#{url}}{\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_local}/#{image}}}#{caption} #{@center_end}") +                    "#{@center_begin}\\\n\\href{#{url}}\n{\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include}/#{image}}}#{caption}#{@center_end}")                  when image_rgx                    images_hash[ps].sub!(image_rgx, -                    "#{@center_begin}\\\n\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_local}/#{image}}#{caption} #{@center_end}") +                    "#{@center_begin}\\\n\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include}/#{image}}#{caption}#{@center_end}")                  end                  images_hash[ps] -              elsif @md.fns =~/\.-ss[tm]$/ \ -              and FileTest.file?("#{dir.path.image_source_include_remote}/#{image}") +              elsif @md.opt.f_pth[:pth] =~/\/\S+?\/sisupod\/\S+?\/sisupod\/doc/ +                pt=/(\/\S+?\/sisupod\/\S+?\/sisupod)\/doc/.match(@md.opt.f_pth[:pth])[1] +                img_src=pt + '/image' +                if FileTest.file?("#{img_src}/#{image}") +                  img_src + +                  case images_hash[ps] +                  when url_image_rgx +                    images_hash[ps].sub!(url_image_rgx, +                      "#{@center_begin}\\\n\\href{#{url}}{\\includegraphics*[width=#{width[ps]}pt]{#{img_src}/#{image}}}#{caption} #{@center_end}") +                  when image_rgx +                    images_hash[ps].sub!(image_rgx, +                      "#{@center_begin}\\\n\\includegraphics*[width=#{width[ps]}pt]{#{img_src}/#{image}}#{caption} #{@center_end}") +                  end +                  images_hash[ps] +                end + +              elsif @md.fns =~/\.(?:ssm\.)?sst$/ \ +              and FileTest.file?("#{dir.path.image_source_include_local}/#{image}")                  case images_hash[ps]                  when url_image_rgx                    images_hash[ps].sub!(url_image_rgx, -                    "#{@center_begin}\\\n\\href{#{url}}{\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_remote}/#{image}}}#{caption}#{@center_end}") +                    "#{@center_begin}\\\n\\href{#{url}}{\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_local}/#{image}}}#{caption} #{@center_end}")                  when image_rgx                    images_hash[ps].sub!(image_rgx, -                    "#{@center_begin}\\\n\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_remote}/#{image}}#{caption}#{@center_end}") +                    "#{@center_begin}\\\n\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_local}/#{image}}#{caption} #{@center_end}")                  end                  images_hash[ps] -              elsif FileTest.file?("#{dir.path.image_source_include}/#{image}") +              elsif @md.fns =~/\.-ss[tm]$/ \ +              and FileTest.file?("#{dir.path.image_source_include_remote}/#{image}")                  case images_hash[ps]                  when url_image_rgx                    images_hash[ps].sub!(url_image_rgx, -                    "#{@center_begin}\\\n\\href{#{url}}\n{\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include}/#{image}}}#{caption}#{@center_end}") +                    "#{@center_begin}\\\n\\href{#{url}}{\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_remote}/#{image}}}#{caption}#{@center_end}")                  when image_rgx                    images_hash[ps].sub!(image_rgx, -                    "#{@center_begin}\\\n\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include}/#{image}}#{caption}#{@center_end}") +                    "#{@center_begin}\\\n\\includegraphics*[width=#{width[ps]}pt]{#{dir.path.image_source_include_remote}/#{image}}#{caption}#{@center_end}")                  end                  images_hash[ps]                else | 
