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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#! /usr/bin/env perl
###############################################################
# Convert boisik.sty to a faked version that does not require #
# the definition of any additional math alphabets #
# #
# By Scott Pakin <scott.clsl@pakin.org> #
###############################################################
use POSIX;
use warnings;
use strict;
# Output some header boilerplate.
print "\%" x 43, "\n";
print "\% This is a generated file. DO NOT EDIT. \%\n";
print "\%" x 43, "\n";
print "\n";
# Read and process boisik.sty.
while (my $oneline = <>) {
chomp $oneline;
# Output some package header information.
if ($oneline =~ /NeedsTeXFormat/o) {
print $oneline, "\n";
next;
}
if ($oneline =~ /ProvidesPackage/o) {
$oneline =~ s/boisik/fakeboisik/;
$oneline =~ s/bsk/faked bsk/;
print $oneline, "\n\n";
print <<'HEADER';
\DeclareFontEncoding{LBL}{}{}
\DeclareFontFamily{LBL}{bskm}{\skewchar\font130 }
\DeclareFontShape{LBL}{bskm}{m}{it}{<->bskmi10}{}
\newcommand*{\BSKletterschar}[1]{{\usefont{LBL}{bskm}{m}{it}\char#1}}
\DeclareFontEncoding{LBM}{}{}
\DeclareFontFamily{LBM}{bskms}{\skewchar\font130 }
\DeclareFontShape{LBM}{bskms}{m}{n}{<->bskms10}{}
\newcommand*{\BSKbsksymbolschar}[1]{{\usefont{LBM}{bskms}{m}{n}\char#1}}
\DeclareFontEncoding{LBS}{}{}
\DeclareFontFamily{LBS}{bsk}{}
\DeclareFontShape{LBS}{bsk}{m}{n}{<->ssub*bsksy/m/n}{}
\newcommand*{\BSKsymbolschar}[1]{{\usefont{LBS}{bsk}{m}{n}\char#1}}
\DeclareFontFamily{U}{bskarr}{}
\DeclareFontShape{U}{bskarr}{m}{n}{<->bskarr10}{}
\newcommand*{\BSKbskarrchar}[1]{{\usefont{U}{bskarr}{m}{n}\char#1}}
\DeclareFontFamily{U}{bskma}{}
\DeclareFontShape{U}{bskma}{m}{n}{<->bskma10}{}
\newcommand*{\BSKbskaddchar}[1]{{\usefont{U}{bskma}{m}{n}\char#1}}
\DeclareFontFamily{U}{bskex}{}
\DeclareFontShape{U}{bskex}{m}{n}{<->sfixed*bskex10}{}
\newcommand*{\BSKlargesymbolschar}[1]{{\usefont{U}{bskex}{m}{n}\char#1}}
HEADER
;
next;
}
# Define most of boisik's symbols.
if ($oneline =~ /^\\DeclareMath(?:Symbol|Delimiter)\{\\([A-Za-z\@]+)\}.*\{(\w+)\}\s*\{(\"\w+)\}\s*$/o) {
my ($sym, $cat, $slot) = ($1, $2, $3);
print "\\DeclareRobustCommand{\\BSK$sym}{\\BSK${cat}char{$slot}}\n";
}
}
# Write some trailer boilerplate.
print <<'TRAILER';
\DeclareRobustCommand{\BSKmaltese}{\BSKbsksymbolschar{"EE}}
\DeclareRobustCommand{\BSKcheckmark}{\BSKbsksymbolschar{"EF}}
\DeclareRobustCommand{\BSKtintup}{\raisebox{2ex}{\BSKlargesymbolschar{"8A}}}
\DeclareRobustCommand{\BSKdintup}{\raisebox{3ex}{\BSKlargesymbolschar{"8B}}}
\DeclareRobustCommand{\BSKvec}[1]{%
\mbox{#1}%
\llap{\makebox[\wd0]{\BSKletterschar{"81}}\hspace{4pt}}%
}
\endinput
TRAILER
;
|