|
2 | 2 | eval 'exec perl -S $0 "$@"' |
3 | 3 | if $running_under_some_shell; |
4 | 4 |
|
| 5 | +# |
| 6 | +# This is version has been patched by Arnaud Le Hors 1997 - lehors@w3.org |
| 7 | +# Changes are: |
| 8 | +# - fixed bug in cross references (some weren't generated) |
| 9 | +# - added some comments, many more would be nice though!... |
| 10 | +# - use less memory: |
| 11 | +# every file is processed in memory and then appended to a temp file |
| 12 | +# - DIVs of class 'navbar' are not "printed out" |
| 13 | +# - replace links of class 'index-inst' by the corresponding page number |
| 14 | +# - replace links of class 'index-def' by the corresponding page number in bold |
| 15 | +# - force old toc style (".....<page #>") for links of class 'tocxref' |
| 16 | +# - force modern toc style (", <page #>") for links of class 'toc-link' |
| 17 | +# - no xref is added on links of class 'noxref' |
| 18 | +# |
| 19 | + |
| 20 | +# |
5 | 21 | # This is html2ps version 1.0 beta1, an HTML-to-PostScript converter. |
6 | 22 | # Copyright (C) 1995-1997 Jan Karrman. |
7 | 23 | # |
@@ -370,7 +386,7 @@ $space=join('|',keys %space); |
370 | 386 | "archb",30.5, "archa",22.9, "flsa",21.6, "flse",21.6, "halfletter",14, |
371 | 387 | "11x17",27.9, "ledger",43.2); |
372 | 388 |
|
373 | | -$version="html2ps version 1.0 beta1"; |
| 389 | +$version="html2ps version 1.0 beta1 patched by Arnaud Le Hors"; |
374 | 390 | $opts="2|b:|c|C:|d|D|e:|f:|F|g|h|H|i:|l:|L|m:|n|N:|o:|O|r:|R|s:|S:|T|u|U|v|W:|" |
375 | 391 | ."x:"; |
376 | 392 | %optalias=( 'twoup','2', 'base','b', 'check','c', 'toc','C', 'debug','d', |
@@ -2672,10 +2688,16 @@ sub Subst{ |
2672 | 2688 | # add page reference unless class of anchor is "noxref" |
2673 | 2689 | ($acl)=$tag=~/class\s*=\s*($S)/i?$+:""; |
2674 | 2690 | if(grep(/^index-def$/i,split(/\s+/,$acl))) { |
| 2691 | + # replace anchor by the page number in bold |
2675 | 2692 | $rest=~s|.*?</a>|)BD()$refs{$lnk} $ltype ITN TL()Ec /AF f D() ES(|i; |
2676 | 2693 | } elsif(grep(/^index-inst$/i,split(/\s+/,$acl))) { |
| 2694 | + # replace anchor by the page number |
2677 | 2695 | $rest=~s|.*?</a>|)$refs{$lnk} $ltype ITN TL()Ec /AF f D(|i; |
| 2696 | + } elsif(grep(/^tocxref$/i,split(/\s+/,$acl))) { |
| 2697 | + # add page number to anchor with a TOC style ($ltype = 1) |
| 2698 | + $rest=~s|</a>|)$refs{$lnk} 1 TN TL()Ec /AF f D(|i; |
2678 | 2699 | } elsif(grep(/^toc-link/i,split(/\s+/,$acl))) { |
| 2700 | + # add a comma + space + page number to anchor |
2679 | 2701 | $rest=~s|</a>|, ) $refs{$lnk} $ltype ITN TL()Ec /AF f D(|i; |
2680 | 2702 | } elsif(!grep(/^noxref$/i,split(/\s+/,$acl))) { |
2681 | 2703 | $rest=~s|</a>|)$refs{$lnk} $ltype TN TL()Ec /AF f D(|i; |
@@ -3826,9 +3848,13 @@ sub DSC { |
3826 | 3848 | last S; |
3827 | 3849 | } |
3828 | 3850 | if($line=~/^\[(.*) (\d+) $io\]$/) { |
3829 | | - $li=$BM[$ix[$2]]=~y/\n/\n/+2; |
| 3851 | + $li=$BM[$2]=~y/\n/\n/+2; |
| 3852 | + # the above Arnaud's line; this is the old: |
| 3853 | + # $li=$BM[$ix[$2]]=~y/\n/\n/+2; |
3830 | 3854 | $line="\/picstr $WS[$ix[$2]] string D\n$1\n" |
3831 | | - ."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$ix[$2]]\n%%EndData"; |
| 3855 | + ."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$2]\n%%EndData"; |
| 3856 | + # The above is Arnaud's line, this is the old: |
| 3857 | + # ."%%BeginData: $li Hex Lines\n$val[$3]\n$BM[$ix[$2]]\n%%EndData"; |
3832 | 3858 | last S; |
3833 | 3859 | } |
3834 | 3860 | if($line=~/^\((.*)\)$/) { |
|
0 commit comments