|
42 | 42 | require 'pswidth.ph'; # PostScript string width
|
43 | 43 | require 'findfont.ph'; # Find fonts in the system
|
44 | 44 |
|
| 45 | +sub basename($) { |
| 46 | + my($path) = @_; |
| 47 | + my($vol,$dir,$file) = File::Spec->splitpath($path); |
| 48 | + return $file; |
| 49 | +} |
| 50 | + |
45 | 51 | #
|
46 | 52 | # Document formatting parameters
|
47 | 53 | #
|
|
869 | 875 | # Paragraph types which are heading (meaning they should not be broken
|
870 | 876 | # immediately after)
|
871 | 877 | my $nobreakafter = "^(chap|appn|head|subh)\$";
|
872 |
| - # Paragraph types which should never be broken *before* |
| 878 | + # Paragraph types which should never be broken *before*, unless |
| 879 | + # the previous paragraph has the same type |
873 | 880 | my $nobreakbefore = "^idx[1-9]\$";
|
874 | 881 | # Paragraph types which are set in columnar format
|
875 | 882 | my $columnregexp = "^idx.\$";
|
@@ -918,15 +925,17 @@ ($$)
|
918 | 925 | # This would be an orphan, don't break.
|
919 | 926 | } elsif ( $$linfo[1] & 1 ) {
|
920 | 927 | # Sole line or start of paragraph. Break unless
|
921 |
| - # the previous line was part of a heading. |
922 |
| - $broken = 1 if ( $$pinfo[0] !~ /$nobreakafter/o && |
923 |
| - $$linfo[0] !~ /$nobreakbefore/o ); |
| 928 | + # the previous line was part of a heading or a comma |
| 929 | + # index entry. |
| 930 | + $broken = $$pinfo[0] !~ /$nobreakafter/o && |
| 931 | + ($$linfo[0] !~ /$nobreakbefore/o || |
| 932 | + $$linfo[0] eq $$pinfo[0]); |
924 | 933 | } else {
|
925 | 934 | # Middle of paragraph. Break unless we're in a
|
926 | 935 | # no-break paragraph, or the previous line would
|
927 | 936 | # end up being a widow.
|
928 |
| - $broken = 1 if ( $$linfo[0] !~ /$nobreakregexp/o && |
929 |
| - $$pinfo[1] != 1 ); |
| 937 | + $broken = $$linfo[0] !~ /$nobreakregexp/o && |
| 938 | + $$pinfo[1] != 1; |
930 | 939 | }
|
931 | 940 | $i--;
|
932 | 941 | }
|
@@ -1066,7 +1075,7 @@ ($$)
|
1066 | 1075 | print "%!PS-Adobe-3.0\n";
|
1067 | 1076 | print "%%Pages: $curpage\n";
|
1068 | 1077 | print "%%BoundingBox: 0 0 ", $psconf{pagewidth}, ' ', $psconf{pageheight}, "\n";
|
1069 |
| -print "%%Creator: (NASM psflow.pl)\n"; |
| 1078 | +print "%%Creator: ", basename($0), "\n"; |
1070 | 1079 | print "%%DocumentData: Clean7Bit\n";
|
1071 | 1080 | print "%%DocumentFonts: $all_fonts_str\n";
|
1072 | 1081 | print "%%DocumentNeededFonts: $need_fonts_str\n";
|
|
0 commit comments