diff options
author | Karl Berry <karl@freefriends.org> | 2008-02-19 17:05:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-02-19 17:05:28 +0000 |
commit | cf4d2164c6ed64dccbe7d8abdd8b0c95f8509a1c (patch) | |
tree | adbb0d174b4ab3c017b085367d946ad7ba3b417b /Master/texmf-dist/scripts | |
parent | f95f16133feaac8dd66077e38d247937f819c815 (diff) |
new latex collection shipunov (18feb08)
git-svn-id: svn://tug.org/texlive/trunk@6680 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
5 files changed, 163 insertions, 0 deletions
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<p>@g; +print; +} + +BEGIN { +print <<END_OF_BEGIN +<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\"> +<html> +<head> + \t<meta http-equiv=\"Content-Type\" content=\"text/html\"> + \t<link type="text/css" rel="stylesheet" href="ws_key.css"> +</head> +<body> + +END_OF_BEGIN +} + +END{ +print <<END_OF_END + +</body> +</html> +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(<VCHOD>){ + + &format1(); + &name_href(); + &format2(); + print; +} + +sub hesh_stup { + $schet_stup = 0; + while(<VCHOD>){ + 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})@<span class="TEZA">$1\.</span>@gi; + s@(\\STEZA{\w\w}{\w\w})@<span class="STEZA">$1\.</span>@gi; + s@(\\SSYLKA{\w\w})@ ... <span class="SSYLKA">$1\.</span>@gi; +} + +sub name_href { + s@\\TEZA{(\w\w)}@<a name=\"$1\">$stup{$1}<\/a>@g; + s@\\STEZA{(\w\w)}{(\w\w)}@<a name=\"$1\">$stup{$1}<\/a>\(<a href=\"#$2\">$stup{$2}<\/a>\)@g; + s@\\SSYLKA{(\w\w)}@<a href=\"#$1\">$stup{$1}<\/a>@g; +} + +sub format2 { + s@\\documentclass.*@@gi; + s@\\usepackage.*@@gi; + s@\\begin.*@@gi; + s@\\end.*@@gi; + s@<p>%@@gi; + s@\\i *{}@i@gsi; + s@\$\\times\$@×\;@gi; + s@\\#@-@gi; + s@\\<|<<@«\;@g; + s@\\>|>>@»\;@g; + s@~@ \;@gi; + s@---|\\---@—@gi; + s@(\\T+?)(.*?)\n\n@ ... + <!--<a href="">--><span class="SP">$2</span><!--</a>-->\n\n@gsi; + s@\\KN (.+?) @<em>$1</em> @gsi; + s@\\NN (.+?) (.+?) @<em>$1 $2</em> @gsi; + s@\\K *{(.+?)}@<em>$1</em>@gsi; + s@\\J *{(.+?)}@<strong>$1</strong>@gsi; + s@\\textit *{(.+?)}@<em>$1</em>@gsi; + s@\\textbf *{(.+?)}@<strong>$1</strong>@gsi; + s@<p>\\FK@<p class="FK">@sgi; + s@<p>@<p class="ST">@sgi; + s@\\AN@–@gi; + s@\\AAN|\\AAAN@=@gi; + s@ +?@ @sgi; + s@\\'@@sgi; + s@\\i{}@@sgi; +} + +sub message { +$Me = basename($0); +print <<END_OF_MESSAGE +USAGE: $Me [-h|-?] File1 [>File2] +END_OF_MESSAGE +} +#
\ No newline at end of file |