Package: latex2html
Version: 2008-debian1-5
Severity: normal

Hi,

the following patch has a look at how many output files there will be and
pads as many zeros as needed/when needed. Also it separates the counter
from the filename with an underscore.

patch is against pstoimg from latex2html version 2008-debian1-5 (Squeeze).


--- /usr/bin/pstoimg    2011-02-08 19:46:54.037904248 +1300
+++ pstoimg.pad 2011-02-17 23:28:16.571866070 +1300
@@ -911,11 +911,14 @@
     my @list = grep(/^\d+_${pnmbase}\.pnm/,readdir(DIR));
     closedir(DIR);
     if(@list) {
+      sub log10 { log($_[0]) / log(10) }
+      my $len = int(log10(@list))+1;
       my $i;
       foreach $i (@list) {
         my ($n) = $i =~ /^(\d+)_/;
+        my $n_pad = sprintf("%0${len}d", $n);
         my $j = $outfile;
-        $j =~ s|(\.[^/.]*)$|$n$1|;
+        $j =~ s|(\.[^/.]*)$|_$n_pad$1|;
        if(crop_scale_etc("$pnmdir$i", $j)) {
           L2hos->Unlink("$pnmdir$i") unless($opt{debug});
           }



regards,
Hamish


-- System Information:
Debian Release: 6.0
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/6 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages latex2html depends on:
ii  ghostscript-x             8.71~dfsg2-9   The GPL Ghostscript PostScript/PDF
ii  netpbm                    2:10.0-12.2+b1 Graphics conversion tools between 
ii  perl                      5.10.1-17      Larry Wall's Practical Extraction 
ii  perl-doc                  5.10.1-17      Perl documentation
ii  texlive-binaries [texlive 2009-8         Binaries for TeX Live
ii  texlive-fonts-recommended 2009-11        TeX Live: Recommended fonts
ii  texlive-latex-extra       2009-10        TeX Live: LaTeX supplementary pack
ii  texlive-latex-recommended 2009-11        TeX Live: LaTeX recommended packag

latex2html recommends no packages.

latex2html suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to