| 1 | # Copyright (c) 2002 Trustees of Indiana University |
|---|
| 2 | # |
|---|
| 3 | # Distributed under the Boost Software License, Version 1.0. |
|---|
| 4 | # (See accompanying file LICENSE_1_0.txt or copy at |
|---|
| 5 | # http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | $lastpage = 0; |
|---|
| 9 | $thispage = 1; |
|---|
| 10 | $counter = 1; |
|---|
| 11 | $alphabet = "\@abcdefghijklmnopqrstuvwxyz"; |
|---|
| 12 | $Alphabet = "\@ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
|---|
| 13 | $out = ""; |
|---|
| 14 | $saved_full = ""; |
|---|
| 15 | $saved_empty = ""; |
|---|
| 16 | |
|---|
| 17 | while(<>) { |
|---|
| 18 | |
|---|
| 19 | # These changes are so that it works when we aren't using hyperref |
|---|
| 20 | |
|---|
| 21 | # if (/(\\newlabel.*\{\{)([0-9]+)(\}\{)([0-9ivx]+)(\}.*JWebCtr\.)([0-9]+)(.*)/) { |
|---|
| 22 | if (/\\newlabel\{sec:.*/) { |
|---|
| 23 | # make sure not to munge normal (non jweb part) section labels |
|---|
| 24 | print ; |
|---|
| 25 | } elsif (/\\newlabel\{class:.*/) { |
|---|
| 26 | # make sure not to munge normal (non jweb part) class labels |
|---|
| 27 | print ; |
|---|
| 28 | } elsif (/\\newlabel\{tab:.*/) { |
|---|
| 29 | # make sure not to munge normal (non jweb part) table labels |
|---|
| 30 | print ; |
|---|
| 31 | } elsif (/\\newlabel\{concept:.*/) { |
|---|
| 32 | # make sure not to munge normal (non jweb part) concept labels |
|---|
| 33 | print ; |
|---|
| 34 | } elsif (/\\newlabel\{fig:.*/) { |
|---|
| 35 | # make sure not to munge normal (non jweb part) class labels |
|---|
| 36 | print ; |
|---|
| 37 | } elsif (/(\\newlabel.*\{\{)([0-9\.]+)(\}\{)([0-9ivx]+)(\}.*)(.*)/) { |
|---|
| 38 | $thispage = $4; |
|---|
| 39 | |
|---|
| 40 | if ($thispage ne $lastpage) { |
|---|
| 41 | |
|---|
| 42 | $counter = 1; |
|---|
| 43 | |
|---|
| 44 | print $saved_empty; |
|---|
| 45 | |
|---|
| 46 | # $saved_full = "$1".substr($alphabet,$counter,1)."$3$4$5$6$7\n"; |
|---|
| 47 | # $saved_empty = "$1"."$3$4$5$6$7\n"; |
|---|
| 48 | $saved_full = "$1".substr($alphabet,$counter,1)."$3$4$5\n"; |
|---|
| 49 | $saved_empty = "$1"."$3$4$5\n"; |
|---|
| 50 | |
|---|
| 51 | } else { |
|---|
| 52 | print $saved_full; |
|---|
| 53 | # print "$1".substr($alphabet,$counter,1)."$3$4$5$counter$7\n"; |
|---|
| 54 | print "$1".substr($alphabet,$counter,1)."$3$4$5\n"; |
|---|
| 55 | $saved_full = ""; |
|---|
| 56 | $saved_empty = ""; |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | $lastpage = $thispage; |
|---|
| 60 | $counter++; |
|---|
| 61 | |
|---|
| 62 | } else { |
|---|
| 63 | print ; |
|---|
| 64 | } |
|---|
| 65 | } |
|---|
| 66 | print $saved_empty; |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | # get a line |
|---|
| 71 | # cases |
|---|
| 72 | # - ref |
|---|
| 73 | # - if it is first, save off someplace |
|---|
| 74 | # - if there is a first saved, dump the empty version |
|---|
| 75 | # - else |
|---|
| 76 | # - if there is a first saved, dump the non empty version |
|---|
| 77 | # - not a ref |
|---|