diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-10 21:58:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-10 21:58:46 +0000 |
commit | dd0d081462a3fa63368e0f0ec875e097c883c361 (patch) | |
tree | fdf37dda7428d68a58db673422734a708eae3643 /Master/texmf-dist/doc/latex/shipunov/scripts/abs2rel.pl | |
parent | 2d0e78c3e9d6118b73f0a80f3b8d84b99cc3dd60 (diff) |
shipunov with -shipunov postfix for new .sty (8oct19)
git-svn-id: svn://tug.org/texlive/trunk@52334 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/shipunov/scripts/abs2rel.pl')
-rwxr-xr-x | Master/texmf-dist/doc/latex/shipunov/scripts/abs2rel.pl | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/shipunov/scripts/abs2rel.pl b/Master/texmf-dist/doc/latex/shipunov/scripts/abs2rel.pl new file mode 100755 index 00000000000..abbbea419a8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/shipunov/scripts/abs2rel.pl @@ -0,0 +1,40 @@ +#!/usr/bin/perl -w + +# Perl script to convert LaTeX / biokey diagnistic keys from absolute to relative (automatic) +# Usage: perl ./abs2rel.pl input.tex > output.tex + +# Anna Shipunova, 2000 +# Updated by Alexey Shipunov, 20150912 +# Updated by Alexey Shipunov 20150919 + +# NOTE: multiple keys in one document possibly lead to conflicting references +# Temporary solution: modify $prefix which is specified below. + +$/=""; + +print STDERR "Converts absolute LaTeX biokey to the relative... \n"; + +&points(); + +print "\n"; +while(<>){ + s/\\Z(\d+)\./\\TE{$points[$1-1]}/g; + s/\\T+?\s*(\d+)\./\\SS{$points[$1-1]}/sg; + s/\\ZZ(\d+)\((\d+)\)\./\\SE{$points[$1-1]}{$points[$2-1]}/g; + print; +} + +# refs will be in in form $prefix[A-Z][1-3] +sub points { +$prefix="G"; # modify here! +$B1 = $nom = ""; +@points = (); + for ($x = 0; $x < 26; $x++) { + for ($z = 1; $z < 9; $z++) { + $B1 = chr($x + 65); + $nom = "$prefix$B1$z"; + @points = (@points, $nom) + } + } +} +# |