summaryrefslogtreecommitdiff
path: root/info/symbols/comprehensive/source/makefakecmupint
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-06-27 03:01:57 +0000
committerNorbert Preining <norbert@preining.info>2020-06-27 03:01:57 +0000
commit62dc979b3581324476e859c5193c81c4583e2618 (patch)
tree904d8fb4209da1477a440a4b3693b25433b1f585 /info/symbols/comprehensive/source/makefakecmupint
parentb90e3e485b70dd9bb00e0e9dc240a6b83321620e (diff)
CTAN sync 202006270301
Diffstat (limited to 'info/symbols/comprehensive/source/makefakecmupint')
-rwxr-xr-xinfo/symbols/comprehensive/source/makefakecmupint60
1 files changed, 60 insertions, 0 deletions
diff --git a/info/symbols/comprehensive/source/makefakecmupint b/info/symbols/comprehensive/source/makefakecmupint
new file mode 100755
index 0000000000..d703db1ad8
--- /dev/null
+++ b/info/symbols/comprehensive/source/makefakecmupint
@@ -0,0 +1,60 @@
+#! /usr/bin/env perl
+
+# Convert cmupint.sty to a faked version that does not require
+# the definition of any additional math alphabets
+#
+# By Scott Pakin <scott+clsl@pakin.org>
+
+use warnings;
+use strict;
+
+# Read and process cmupint.sty.
+my %raw_sym2slot; # Map from a no-limits integral to a font slot
+my %sym2slot; # Map from an integral with limits to a font slot
+my $provides; # \ProvidesPackage line
+while (my $line = <>) {
+ chomp $line;
+ if ($line =~ /^\\DeclareMathSymbol\{\\(\w+)\}.*\{(\d+)\}/) {
+ $raw_sym2slot{$1} = $2 + 0;
+ }
+ elsif ($line =~ /^\\def\\(\w+)\{\\relax\\(\w+)/) {
+ $sym2slot{$1} = $raw_sym2slot{$2};
+ }
+ elsif ($line =~ /^\\ProvidesPackage/) {
+ $provides = $line;
+ }
+}
+
+# Output some header boilerplate.
+print "\%" x 43, "\n";
+print "\% This is a generated file. DO NOT EDIT. \%\n";
+print "\%" x 43, "\n";
+print "\n";
+print $provides, "\n";
+print <<'DEFCMD';
+\newcommand*{\cmupintsym}[2]{%
+ \raisebox{#1}{%
+ \usefont{U}{cmupint}{m}{n}\selectfont
+ \char#2%
+ }%
+}
+
+DEFCMD
+;
+
+# Define each symbol as a text symbol.
+foreach my $sym (sort {$sym2slot{$a} <=> $sym2slot{$b}} keys %sym2slot) {
+ printf '\DeclareRobustCommand{\CMUP%sT}{\cmupintsym{8pt}{%d}}'."\n", $sym, $sym2slot{$sym};
+ printf '\DeclareRobustCommand{\CMUP%sD}{\cmupintsym{13pt}{%d}}'."\n", $sym, $sym2slot{$sym} + 1;
+}
+
+# \idotsint needs to be constructed manually.
+print <<'IDOTSINT';
+\DeclareRobustCommand{\CMUPidotsintT}{\CMUPintT$\,\intdots@$\CMUPintT}
+\DeclareRobustCommand{\CMUPidotsintD}{\CMUPintD$\,\intdots@$\CMUPintD}
+IDOTSINT
+;
+
+# Output some header boilerplate.
+print "\n";
+print "\\endinput\n";