From cf4d2164c6ed64dccbe7d8abdd8b0c95f8509a1c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 19 Feb 2008 17:05:28 +0000 Subject: new latex collection shipunov (18feb08) git-svn-id: svn://tug.org/texlive/trunk@6680 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/shipunov/biokey2html.bat | 5 ++ Master/texmf-dist/scripts/shipunov/biokey2html.sh | 8 ++ Master/texmf-dist/scripts/shipunov/biokey2html1.pl | 30 ++++++++ Master/texmf-dist/scripts/shipunov/biokey2html2.pl | 31 ++++++++ Master/texmf-dist/scripts/shipunov/biokey2html3.pl | 89 ++++++++++++++++++++++ 5 files changed, 163 insertions(+) create mode 100755 Master/texmf-dist/scripts/shipunov/biokey2html.bat create mode 100644 Master/texmf-dist/scripts/shipunov/biokey2html.sh create mode 100644 Master/texmf-dist/scripts/shipunov/biokey2html1.pl create mode 100644 Master/texmf-dist/scripts/shipunov/biokey2html2.pl create mode 100644 Master/texmf-dist/scripts/shipunov/biokey2html3.pl (limited to 'Master/texmf-dist/scripts/shipunov') diff --git a/Master/texmf-dist/scripts/shipunov/biokey2html.bat b/Master/texmf-dist/scripts/shipunov/biokey2html.bat new file mode 100755 index 00000000000..49534708611 --- /dev/null +++ b/Master/texmf-dist/scripts/shipunov/biokey2html.bat @@ -0,0 +1,5 @@ +@echo off +perl -w biokey2html1.pl %1 > %12 +perl -w biokey2html2.pl %12 > %1.tmp +perl -w biokey2html3.pl %1.tmp > %1.html +if exist %1.tmp del %1.tmp \ No newline at end of file diff --git a/Master/texmf-dist/scripts/shipunov/biokey2html.sh b/Master/texmf-dist/scripts/shipunov/biokey2html.sh new file mode 100644 index 00000000000..50ee8a52ab2 --- /dev/null +++ b/Master/texmf-dist/scripts/shipunov/biokey2html.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +export PATH=.:{$PATH} +biokey2html1.pl $1 > $12 +biokey2html2.pl $12 > /tmp/$1.$$ +biokey2html3.pl /tmp/$1.$$ > $1.html + +# diff --git a/Master/texmf-dist/scripts/shipunov/biokey2html1.pl b/Master/texmf-dist/scripts/shipunov/biokey2html1.pl new file mode 100644 index 00000000000..e7eb44b07d2 --- /dev/null +++ b/Master/texmf-dist/scripts/shipunov/biokey2html1.pl @@ -0,0 +1,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) + } + } +} +# \ No newline at end of file diff --git a/Master/texmf-dist/scripts/shipunov/biokey2html2.pl b/Master/texmf-dist/scripts/shipunov/biokey2html2.pl new file mode 100644 index 00000000000..75801f4430a --- /dev/null +++ b/Master/texmf-dist/scripts/shipunov/biokey2html2.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w + +print STDERR "Making HTML title and paragrafs tags... \n"; + +while(<>){ + s@^\s+?$@\n

@g; +print; +} + +BEGIN { +print < + + + \t + \t + + + +END_OF_BEGIN +} + +END{ +print < + +END_OF_END +} + +# \ No newline at end of file diff --git a/Master/texmf-dist/scripts/shipunov/biokey2html3.pl b/Master/texmf-dist/scripts/shipunov/biokey2html3.pl new file mode 100644 index 00000000000..296daaab6af --- /dev/null +++ b/Master/texmf-dist/scripts/shipunov/biokey2html3.pl @@ -0,0 +1,89 @@ +#!/usr/bin/perl -w +$/ = ""; + +use File::Basename; + +$kl = $ARGV[0]; +if ($kl && ($kl =~ /-h|-\?/)) {&message(); exit(1);} + +$file = @ARGV; +if ($file < 1) {&message(); exit(1);} + +$a = $ARGV[0]; +open(VCHOD, "$a") || die "Sorry, I cannot open $a: $!\n"; + +print STDERR "Making reference tags... \n"; + +&hesh_stup(); + +while(){ + + &format1(); + &name_href(); + &format2(); + print; +} + +sub hesh_stup { + $schet_stup = 0; + while(){ + if (/\\TEZA{(\w\w)}/) {$schet_stup++; $stup{"$1"} = "$schet_stup";} + if (/\\STEZA{(\w\w)}{(\w\w)}/) {$schet_stup++; $stup{"$1"} = "$schet_stup";} + } + seek (VCHOD, 0, 0); +} + +END { + close (VCHOD); +} + +sub format1 { + s@@$1@g; + s@(\\TEZA{\w\w})@$1\.@gi; + s@(\\STEZA{\w\w}{\w\w})@$1\.@gi; + s@(\\SSYLKA{\w\w})@ ... $1\.@gi; +} + +sub name_href { + s@\\TEZA{(\w\w)}@$stup{$1}<\/a>@g; + s@\\STEZA{(\w\w)}{(\w\w)}@$stup{$1}<\/a>\($stup{$2}<\/a>\)@g; + s@\\SSYLKA{(\w\w)}@$stup{$1}<\/a>@g; +} + +sub format2 { + s@\\documentclass.*@@gi; + s@\\usepackage.*@@gi; + s@\\begin.*@@gi; + s@\\end.*@@gi; + s@

%@@gi; + s@\\i *{}@i@gsi; + s@\$\\times\$@×\;@gi; + s@\\#@-@gi; + s@\\<|<<@«\;@g; + s@\\>|>>@»\;@g; + s@~@ \;@gi; + s@---|\\---@—@gi; + s@(\\T+?)(.*?)\n\n@ ... + $2\n\n@gsi; + s@\\KN (.+?) @$1 @gsi; + s@\\NN (.+?) (.+?) @$1 $2 @gsi; + s@\\K *{(.+?)}@$1@gsi; + s@\\J *{(.+?)}@$1@gsi; + s@\\textit *{(.+?)}@$1@gsi; + s@\\textbf *{(.+?)}@$1@gsi; + s@

\\FK@

@sgi; + s@

@

@sgi; + s@\\AN@–@gi; + s@\\AAN|\\AAAN@=@gi; + s@ +?@ @sgi; + s@\\'@@sgi; + s@\\i{}@@sgi; +} + +sub message { +$Me = basename($0); +print <File2] +END_OF_MESSAGE +} +# \ No newline at end of file -- cgit v1.2.3