blob: e7eb44b07d229ffe8d09a4b0dfa0efd89d12d977 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/usr/bin/perl -w
$/="";
print STDERR "Making relative LaTeX key... \n";
&ochki();
print "\n";
while(<>){
s/\\Z(\d+)\./\\TEZA{$ochki[$1-1]}/g;
s/\\T+?\s*(\d+)\./\\SSYLKA{$ochki[$1-1]}/sg;
s/\\ZZ(\d+)\((\d+)\)\./\\STEZA{$ochki[$1-1]}{$ochki[$2-1]}/g;
print;
}
# fill array to links
sub ochki {
$B0 = $B1 = $nom = "";
@ochki = ();
for ($x = 0; $x < 26; $x++) {
for ($y = 0; $y < 26; $y++) {
$B0 = chr($y + 65);
$B1 = chr($x + 65);
$nom = "$B1$B0";
@ochki = (@ochki, $nom)
}
}
}
#
|