summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-11-03 18:29:45 +0000
committerKarl Berry <karl@freefriends.org>2015-11-03 18:29:45 +0000
commit9400888610cff531773a7fea1602494e3e99c20f (patch)
treee2f513e62f57045f272211850bc00819cd9737db
parent402f87a98128f638d855a194f884e0e73c0c0e69 (diff)
makedtx script (Rolf mail, 2 Nov 2015 19:08:19)
git-svn-id: svn://tug.org/texlive/trunk@38769 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.am1
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.in1
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/epspdf/epspdf.tlu30
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/epspdf/epspdftk.tcl2
-rwxr-xr-x[-rw-r--r--]Build/source/texk/texlive/linked_scripts/makedtx/makedtx.pl (renamed from Master/texmf-dist/doc/latex/makedtx/makedtx.pl)0
l---------Master/bin/alpha-linux/makedtx1
l---------Master/bin/amd64-freebsd/makedtx1
l---------Master/bin/amd64-netbsd/makedtx1
l---------Master/bin/armel-linux/makedtx1
l---------Master/bin/armhf-linux/makedtx1
l---------Master/bin/i386-cygwin/makedtx1
l---------Master/bin/i386-freebsd/makedtx1
l---------Master/bin/i386-linux/makedtx1
l---------Master/bin/i386-netbsd/makedtx1
l---------Master/bin/i386-solaris/makedtx1
l---------Master/bin/mipsel-linux/makedtx1
l---------Master/bin/powerpc-linux/makedtx1
l---------Master/bin/sparc-solaris/makedtx1
l---------Master/bin/universal-darwin/makedtx1
-rwxr-xr-xMaster/bin/win32/makedtx.exebin0 -> 1536 bytes
l---------Master/bin/x86_64-cygwin/makedtx1
l---------Master/bin/x86_64-darwin/makedtx1
l---------Master/bin/x86_64-linux/makedtx1
l---------Master/bin/x86_64-solaris/makedtx1
-rw-r--r--Master/texmf-dist/doc/support/makedtx/CHANGES (renamed from Master/texmf-dist/doc/latex/makedtx/CHANGES)0
-rw-r--r--Master/texmf-dist/doc/support/makedtx/README (renamed from Master/texmf-dist/doc/latex/makedtx/README)0
-rw-r--r--Master/texmf-dist/doc/support/makedtx/creatdtx.perl (renamed from Master/texmf-dist/doc/latex/makedtx/creatdtx.perl)0
-rw-r--r--Master/texmf-dist/doc/support/makedtx/makedtx-manual.html (renamed from Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html)0
-rw-r--r--Master/texmf-dist/doc/support/makedtx/makedtx.pdf (renamed from Master/texmf-dist/doc/latex/makedtx/makedtx.pdf)bin202740 -> 202740 bytes
-rwxr-xr-xMaster/texmf-dist/scripts/makedtx/makedtx.pl979
-rw-r--r--Master/texmf-dist/source/support/makedtx/makedtx.dtx (renamed from Master/texmf-dist/source/latex/makedtx/makedtx.dtx)0
-rw-r--r--Master/texmf-dist/source/support/makedtx/makedtx.ins (renamed from Master/texmf-dist/source/latex/makedtx/makedtx.ins)0
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds1
-rw-r--r--Master/tlpkg/tlpsrc/makedtx.tlpsrc1
34 files changed, 1021 insertions, 12 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am
index 9548d82f0c9..64c2b251c8d 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.am
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.am
@@ -135,6 +135,7 @@ texmf_other_scripts = \
ltximg/ltximg.pl \
luaotfload/luaotfload-tool.lua \
m-tx/m-tx.lua \
+ makedtx/makedtx.pl \
make4ht/make4ht \
match_parens/match_parens \
mathspic/mathspic.pl \
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in
index 53c3f180d3b..59dcb3c1aa8 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.in
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.in
@@ -351,6 +351,7 @@ texmf_other_scripts = \
ltximg/ltximg.pl \
luaotfload/luaotfload-tool.lua \
m-tx/m-tx.lua \
+ makedtx/makedtx.pl \
make4ht/make4ht \
match_parens/match_parens \
mathspic/mathspic.pl \
diff --git a/Build/source/texk/texlive/linked_scripts/epspdf/epspdf.tlu b/Build/source/texk/texlive/linked_scripts/epspdf/epspdf.tlu
index 463fb22f35a..7a7c2d78a97 100755
--- a/Build/source/texk/texlive/linked_scripts/epspdf/epspdf.tlu
+++ b/Build/source/texk/texlive/linked_scripts/epspdf/epspdf.tlu
@@ -6,9 +6,10 @@ kpse.set_program_name('texlua')
-- 0.6.0: first texlua version
-- 0.6.1: allow TeX installation on path with spaces
+-- 0.6.2: compatibility fix for luatex 0.81
-ep_version = '0.6.1'
-ep_copyright = '2006, 2008, 2009, 2010, 2011, 2013, 2014'
+ep_version = '0.6.2'
+ep_copyright = '2006, 2008, 2009, 2010, 2011, 2013, 2014, 2015'
--[[
@@ -1528,6 +1529,13 @@ function PsPdf:pdf_crop()
#3%
\fi
}
+
+% future modification: \pdfoutput => \outputmode
+\begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname pdfoutput\endcsname\relax
+ \let\pdfoutput \outputmode
+\fi
+
\begingroup
\newlinechar=10 %
\endlinechar=\newlinechar %
@@ -1540,8 +1548,8 @@ function PsPdf:pdf_crop()
'pdfcompresslevel',
'pdfhorigin',
'pdfvorigin',
- 'pdfpagewidth',
- 'pdfpageheight',
+ 'pagewidth',
+ 'pageheight',
'pdfmapfile',
'pdfximage',
'pdflastximage',
@@ -1559,8 +1567,8 @@ function PsPdf:pdf_crop()
\global\let\pdfcompresslevel\TESTpdfcompresslevel %
\global\let\pdfhorigin\TESTpdfhorigin %
\global\let\pdfvorigin\TESTpdfvorigin %
- \global\let\pdfpagewidth\TESTpdfpagewidth %
- \global\let\pdfpageheight\TESTpdfpageheight %
+ \global\let\pagewidth\TESTpagewidth %
+ \global\let\pageheight\TESTpageheight %
\global\let\pdfmapfile\TESTpdfmapfile %
\global\let\pdfximage\TESTpdfximage %
\global\let\pdflastximage\TESTpdflastximage %
@@ -1602,11 +1610,11 @@ function PsPdf:pdf_crop()
}%
\pdfhorigin=-#2bp\relax
\pdfvorigin=#3bp\relax
- \pdfpagewidth=#4bp\relax
- \advance\pdfpagewidth by -#2bp\relax
- \pdfpageheight=#5bp\relax
- \advance\pdfpageheight by -#3bp\relax
- \ht0=\pdfpageheight
+ \pagewidth=#4bp\relax
+ \advance\pagewidth by -#2bp\relax
+ \pageheight=#5bp\relax
+ \advance\pageheight by -#3bp\relax
+ \ht0=\pageheight
\shipout\box0\relax
}
]]
diff --git a/Build/source/texk/texlive/linked_scripts/epspdf/epspdftk.tcl b/Build/source/texk/texlive/linked_scripts/epspdf/epspdftk.tcl
index b55db2c979f..e28118853f3 100755
--- a/Build/source/texk/texlive/linked_scripts/epspdf/epspdftk.tcl
+++ b/Build/source/texk/texlive/linked_scripts/epspdf/epspdftk.tcl
@@ -3,7 +3,7 @@
# epspdf conversion utility, GUI frontend
#####
-# Copyright (C) 2006, 2008, 2009, 2010, 2011, 2013, 2014 Siep Kroonenberg
+# Copyright (C) 2006, 2008, 2009, 2010, 2011, 2013, 2014, 2015 Siep Kroonenberg
# n dot s dot kroonenberg at rug dot nl
#
# This program is free software, licensed under the GNU GPL, >=2.0.
diff --git a/Master/texmf-dist/doc/latex/makedtx/makedtx.pl b/Build/source/texk/texlive/linked_scripts/makedtx/makedtx.pl
index 41516e79920..41516e79920 100644..100755
--- a/Master/texmf-dist/doc/latex/makedtx/makedtx.pl
+++ b/Build/source/texk/texlive/linked_scripts/makedtx/makedtx.pl
diff --git a/Master/bin/alpha-linux/makedtx b/Master/bin/alpha-linux/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/alpha-linux/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/amd64-freebsd/makedtx b/Master/bin/amd64-freebsd/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/amd64-freebsd/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/amd64-netbsd/makedtx b/Master/bin/amd64-netbsd/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/amd64-netbsd/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/armel-linux/makedtx b/Master/bin/armel-linux/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/armel-linux/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/armhf-linux/makedtx b/Master/bin/armhf-linux/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/armhf-linux/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/i386-cygwin/makedtx b/Master/bin/i386-cygwin/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/i386-cygwin/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/i386-freebsd/makedtx b/Master/bin/i386-freebsd/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/i386-freebsd/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/i386-linux/makedtx b/Master/bin/i386-linux/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/i386-linux/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/i386-netbsd/makedtx b/Master/bin/i386-netbsd/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/i386-netbsd/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/i386-solaris/makedtx b/Master/bin/i386-solaris/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/i386-solaris/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/mipsel-linux/makedtx b/Master/bin/mipsel-linux/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/mipsel-linux/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/powerpc-linux/makedtx b/Master/bin/powerpc-linux/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/powerpc-linux/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/sparc-solaris/makedtx b/Master/bin/sparc-solaris/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/sparc-solaris/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/universal-darwin/makedtx b/Master/bin/universal-darwin/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/universal-darwin/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/win32/makedtx.exe b/Master/bin/win32/makedtx.exe
new file mode 100755
index 00000000000..5777d90a17a
--- /dev/null
+++ b/Master/bin/win32/makedtx.exe
Binary files differ
diff --git a/Master/bin/x86_64-cygwin/makedtx b/Master/bin/x86_64-cygwin/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/x86_64-cygwin/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/x86_64-darwin/makedtx b/Master/bin/x86_64-darwin/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/x86_64-darwin/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/x86_64-linux/makedtx b/Master/bin/x86_64-linux/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/x86_64-linux/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/bin/x86_64-solaris/makedtx b/Master/bin/x86_64-solaris/makedtx
new file mode 120000
index 00000000000..187b2cea875
--- /dev/null
+++ b/Master/bin/x86_64-solaris/makedtx
@@ -0,0 +1 @@
+../../texmf-dist/scripts/makedtx/makedtx.pl \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/makedtx/CHANGES b/Master/texmf-dist/doc/support/makedtx/CHANGES
index cbd18311fda..cbd18311fda 100644
--- a/Master/texmf-dist/doc/latex/makedtx/CHANGES
+++ b/Master/texmf-dist/doc/support/makedtx/CHANGES
diff --git a/Master/texmf-dist/doc/latex/makedtx/README b/Master/texmf-dist/doc/support/makedtx/README
index e4abbba5d90..e4abbba5d90 100644
--- a/Master/texmf-dist/doc/latex/makedtx/README
+++ b/Master/texmf-dist/doc/support/makedtx/README
diff --git a/Master/texmf-dist/doc/latex/makedtx/creatdtx.perl b/Master/texmf-dist/doc/support/makedtx/creatdtx.perl
index 9149cba164b..9149cba164b 100644
--- a/Master/texmf-dist/doc/latex/makedtx/creatdtx.perl
+++ b/Master/texmf-dist/doc/support/makedtx/creatdtx.perl
diff --git a/Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html b/Master/texmf-dist/doc/support/makedtx/makedtx-manual.html
index 4438c92c219..4438c92c219 100644
--- a/Master/texmf-dist/doc/latex/makedtx/makedtx-manual.html
+++ b/Master/texmf-dist/doc/support/makedtx/makedtx-manual.html
diff --git a/Master/texmf-dist/doc/latex/makedtx/makedtx.pdf b/Master/texmf-dist/doc/support/makedtx/makedtx.pdf
index 79a8b5e822b..79a8b5e822b 100644
--- a/Master/texmf-dist/doc/latex/makedtx/makedtx.pdf
+++ b/Master/texmf-dist/doc/support/makedtx/makedtx.pdf
Binary files differ
diff --git a/Master/texmf-dist/scripts/makedtx/makedtx.pl b/Master/texmf-dist/scripts/makedtx/makedtx.pl
new file mode 100755
index 00000000000..41516e79920
--- /dev/null
+++ b/Master/texmf-dist/scripts/makedtx/makedtx.pl
@@ -0,0 +1,979 @@
+#!/usr/bin/perl
+
+# File : makedtx
+# Author : Nicola L. C. Talbot
+# Date : 29 Oct 2004
+# Last Modified : 19 Aug 2007
+# Version : 0.94b
+
+# usage : makedtx [options] -src <expr>=><expr> -doc <filename> <basename>
+#
+# -h : help message
+# -src <expr>=><expr> : e.g. -src "(foo)src\.(bar)=>$1.$2" will add foosrc.bar to <basename>.dtx to be extracted to foo.bar
+# -doc <filename> : file containing documentation.
+# -prefinale <string> : text to add to dtx file just before \Finale (added to version 0.91b)
+# <basename> : create <basename>.dtx and <basename>.ins
+
+use Getopt::Long;
+
+$version = "0.94b";
+
+# process command line options
+
+ %optctl = ();
+
+&GetOptions(\%optctl, "h", "help", "v", "src=s@", "doc=s",
+"dir=s", "op=s", "askforoverwrite!", "ins!",
+"preamble=s", "postamble=s", "setambles=s@", "macrocode=s@",
+"author=s", "date=s", "stopeventually=s",
+"prefinale=s", "codetitle=s", "comment=s@",
+"version", "license=s") or &syntaxerror();
+
+$srcdir = ".";
+$patternop = "=";
+$verbose = 0;
+$noins = 0;
+$askforoverwrite = 0;
+$preamble = "";
+$postamble = "";
+$author = (getpwuid($<))[6] || 'Unknown';
+$stopeventually = "";
+$prefinale = "";
+$codetitle = "The Code";
+$license = "lppl";
+
+($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
+
+$year = $year + 1900;
+
+foreach $setting (keys %optctl)
+{
+ if (($setting eq "h") || ($setting eq "help"))
+ {
+ &help();
+ }
+ elsif ($setting eq "version")
+ {
+ die "makedtx version $version\n";
+ }
+ elsif ($setting eq "doc")
+ {
+ $docsrc = $optctl{$setting};
+ }
+ elsif ($setting eq "src")
+ {
+ @source = @{ $optctl{$setting} };
+ }
+ elsif ($setting eq "dir")
+ {
+ $srcdir = $optctl{$setting};
+ }
+ elsif ($setting eq "op")
+ {
+ $patternop = $optctl{$setting};
+ }
+ elsif ($setting eq "v")
+ {
+ $verbose = 1;
+ }
+ elsif ($setting eq "ins")
+ {
+ $noins = 1-$optctl{$setting};
+ }
+ elsif ($setting eq "askforoverwrite")
+ {
+ $askforoverwrite = $optctl{$setting};
+ }
+ elsif ($setting eq "preamble")
+ {
+ $preamble = $optctl{$setting};
+ }
+ elsif ($setting eq "postamble")
+ {
+ $postamble = $optctl{$setting};
+ }
+ elsif ($setting eq "setambles")
+ {
+ @setambles = @{ $optctl{$setting} };
+ }
+ elsif ($setting eq "macrocode")
+ {
+ @macrocode = @{ $optctl{$setting} };
+ }
+ elsif ($setting eq "author")
+ {
+ $author = $optctl{$setting};
+ }
+ elsif ($setting eq "date")
+ {
+ $year = $optctl{$setting};
+ }
+ elsif ($setting eq "stopeventually")
+ {
+ $stopeventually = $optctl{$setting};
+ }
+ elsif ($setting eq "prefinale")
+ {
+ $prefinale = $optctl{$setting};
+ }
+ elsif ($setting eq "codetitle")
+ {
+ $codetitle = $optctl{$setting};
+ }
+ elsif ($setting eq "comment")
+ {
+ @comment = @{ $optctl{$setting} };
+ }
+ elsif ($setting eq "license")
+ {
+ $license = $optctl{$setting};
+ }
+}
+
+if ($#ARGV != 0)
+{
+ print "No basename specified\n";
+ &syntaxerror();
+}
+
+$basename = $ARGV[0];
+
+if ($docsrc eq "")
+{
+ print "No document source specified (missing -doc)\n";
+ &syntaxerror();
+}
+
+if ($#source == -1)
+{
+ print "No source code specified (missing -src)\n";
+ &syntaxerror();
+}
+
+open DTX, ">$basename.dtx" or die "Can't open '$basename.dtx'\n";
+
+if ($verbose)
+{
+ print "Documentation source : " . $docsrc . "\n";
+}
+
+# work out the derived files
+
+ @srcdirfile = glob("$srcdir/*");
+
+ @derivedfiles = ();
+
+ @outputfiles = ();
+
+$numoutput = 0;
+
+foreach $source (@source)
+{
+ ($infile, $outfile, $remainder) = split /=>/, $source;
+
+ if ($outfile eq "")
+ {
+ print "-src $source argument invalid (no output file specified)\n";
+
+ &syntaxerror();
+ }
+
+ if (not ($remainder eq ""))
+ {
+ print "-src $source argument invalid (too many => specified)\n";
+
+ &syntaxerror();
+ }
+
+ foreach $srcdirfile (@srcdirfile)
+ {
+ $fileexp = $srcdir . "/" . $infile;
+
+ $_ = $srcdirfile;
+
+ $expr = "s$patternop$fileexp$patternop$outfile$patternop";
+
+ if (eval($expr))
+ {
+ $thisoutfile = $_;
+
+ $thisinfile = $srcdirfile;
+
+ $file{$thisinfile} = $thisoutfile;
+ $derivedfiles[$numoutput]{'in'} = $thisinfile;
+ $derivedfiles[$numoutput]{'out'} = $thisoutfile;
+ $outputfiles[$numoutput] = $thisoutfile;
+
+ $numoutput++;
+ }
+ }
+}
+
+if ($preamble eq "")
+{
+ if ($license eq "lppl")
+ {
+ $preamble = <<_END_LICENSE
+
+ $basename.dtx
+ Copyright $year $author
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either version 1.3
+ of this license of (at your option) any later version.
+ The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of LaTeX
+ version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is $author.
+
+_END_LICENSE
+ }
+ elsif ($license eq 'bsd')
+ {
+ $preamble = <<_END_LICENSE
+
+ $basename.dtx
+ Copyright (c) $year $author
+ All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_END_LICENSE
+ }
+ elsif ($license eq 'gpl')
+ {
+ $preamble = <<_END_LICENSE
+
+ $basename.dtx
+ Copyright (c) $year $author
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+_END_LICENSE
+ }
+ else
+ {
+ die "Unknown license '$license'\n".
+ "Known licenses: lppl, bsd, gpl";
+ }
+
+ $preamble .= " This work consists of the files "
+ . "$basename.dtx and $basename.ins and the derived "
+ . ($numoutput > 1 ? "files" : "file")
+ . " " . join(', ', @outputfiles) . ".\n";
+}
+
+open DOC, $docsrc or die "Can't open '$docsrc'\n";
+
+print DTX "\%\\iffalse\n";
+print DTX "\% $basename.dtx generated using makedtx version $version (c) Nicola Talbot\n";
+print DTX "\% Command line args:\n";
+
+foreach $setting (keys %optctl)
+{
+ if ($setting eq "src")
+ {
+ foreach $source (@source)
+ {
+ print DTX "\% -src \"$source\"\n";
+ }
+ }
+ elsif ($setting eq "setambles")
+ {
+ foreach $setamble (@setambles)
+ {
+ print DTX "\% -setambles \"$setamble\"\n";
+ }
+ }
+ elsif ($setting eq "macrocode")
+ {
+ foreach $macrocode (@macrocode)
+ {
+ print DTX "\% -macrocode \"$macrocode\"\n";
+ }
+ }
+ elsif ($setting eq "comment")
+ {
+ foreach $comment (@comment)
+ {
+ print DTX "\% -comment \"$comment\"\n";
+ }
+ }
+ else
+ {
+ $val = $optctl{$setting};
+ $val=~s/\\/\\\\/g;
+ print DTX "\% -", $setting, " \"", $val, "\"\n";
+ }
+}
+
+print DTX "\% $basename\n";
+
+print DTX "\% Created on $year/", $mon+1, "/$mday $hour:", $min<10?"0$min" : $min,"\n";
+print DTX "\%\\fi\n";
+print DTX "\%\\iffalse\n";
+print DTX "\%<*package>\n";
+print DTX "\%\% \\CharacterTable\n";
+print DTX "\%\% {Upper-case \\A\\B\\C\\D\\E\\F\\G\\H\\I\\J\\K\\L\\M\\N\\O\\P\\Q\\R\\S\\T\\U\\V\\W\\X\\Y\\Z\n";
+print DTX "\%\% Lower-case \\a\\b\\c\\d\\e\\f\\g\\h\\i\\j\\k\\l\\m\\n\\o\\p\\q\\r\\s\\t\\u\\v\\w\\x\\y\\z\n";
+print DTX "\%\% Digits \\0\\1\\2\\3\\4\\5\\6\\7\\8\\9\n";
+print DTX "\%\% Exclamation \\! Double quote \\\" Hash (number) \\#\n";
+print DTX "\%\% Dollar \\\$ Percent \\\% Ampersand \\&\n";
+print DTX "\%\% Acute accent \\\' Left paren \\( Right paren \\)\n";
+print DTX "\%\% Asterisk \\* Plus \\+ Comma \\,\n";
+print DTX "\%\% Minus \\- Point \\. Solidus \\/\n";
+print DTX "\%\% Colon \\: Semicolon \\; Less than \\<\n";
+print DTX "\%\% Equals \\= Greater than \\> Question mark \\?\n";
+print DTX "\%\% Commercial at \\\@ Left bracket \\[ Backslash \\\\\n";
+print DTX "\%\% Right bracket \\] Circumflex \\^ Underscore \\_\n";
+print DTX "\%\% Grave accent \\\` Left brace \\{ Vertical bar \\|\n";
+print DTX "\%\% Right brace \\} Tilde \\~}\n";
+print DTX "\%</package>\n";
+print DTX "\%\\fi\n";
+
+print DTX "\% \\iffalse\n";
+print DTX "\% Doc-Source file to use with LaTeX2e\n";
+print DTX "\% Copyright (C) $year $author, all rights reserved.\n";
+print DTX "\% \\fi\n";
+
+# driver
+
+print DTX "\% \\iffalse\n";
+print DTX "\%<*driver>\n";
+
+$indoc=0;
+
+while (<DOC>)
+{
+ s/\\usepackage{creatdtx}//;
+
+ $restofline = $_;
+
+ $beginline = "";
+ $line = $restofline;
+
+ while ($restofline =~ /(.*)\\ifmakedtx(.*)/)
+ {
+ $beginline = $1;
+
+ ($group,$restofline,$done) = &getnextgroup($2);
+
+ $startline = $.;
+
+ while (!$done)
+ {
+ if ($nextline = <DOC>)
+ {
+ $line = $line . $nextline;
+
+ $restofline = $restofline . $nextline;
+
+ ($group,$restofline,$done) = &getnextgroup($restofline);
+ }
+ else
+ {
+ die "EOF found whilst scanning first argument to \\ifmakedtx on line $startline\n";
+ }
+ }
+
+ # print first arg, ignore second
+
+ $beginline = $beginline . $group;
+
+ ($group,$restofline,$done) = &getnextgroup($restofline);
+
+ while (!$done)
+ {
+ if ($nextline = <DOC>)
+ {
+ $line = $line . $nextline;
+
+ $restofline = $restofline . $nextline;
+
+ ($group,$restofline,$done) = &getnextgroup($restofline);
+ }
+ else
+ {
+ die "EOF found whilst scanning second argument to \\ifmakedtx on line $startline\n";
+ }
+ }
+
+ $line = $restofline;
+ }
+
+ $line = $beginline . $restofline;
+
+ print DTX $line;
+
+ if ($line=~/\\begin{document}/)
+ {
+ $indoc = 1;
+
+ last;
+ }
+}
+
+print DTX "\\DocInput{$basename.dtx}\n";
+print DTX "\\end{document}\n";
+print DTX "\%</driver>\n";
+print DTX "\%\\fi\n";
+
+$inverb=0;
+$stopfound=0;
+
+print DTX "\%";
+
+while (<DOC>)
+{
+ if (/\\begin{verbatim}/)
+ {
+ $inverb=1;
+ }
+
+ if (/\\end{verbatim}/)
+ {
+ $inverb=0;
+ }
+
+ if (/\\StopEventually/ && ($inverb==0))
+ {
+ $stopfound=1;
+ }
+
+ $restofline = $_;
+
+ $beginline = "";
+ $line = $restofline;
+
+ while ($restofline =~ /(.*)\\ifmakedtx(.*)/)
+ {
+ $beginline = $1;
+
+ ($group,$restofline,$done) = &getnextgroup($2);
+
+ $startline = $.;
+
+ while (!$done)
+ {
+ if ($nextline = <DOC>)
+ {
+ $line = $line . $nextline;
+
+ $restofline = $restofline . $nextline;
+
+ ($group,$restofline,$done) = &getnextgroup($restofline);
+ }
+ else
+ {
+ die "EOF found whilst scanning first argument to \\ifmakedtx on line $startline\n";
+ }
+ }
+
+ # print first arg, ignore second
+
+ $beginline = $beginline . $group;
+
+ ($group,$restofline,$done) = &getnextgroup($restofline);
+
+ while (!$done)
+ {
+ if ($nextline = <DOC>)
+ {
+ $line = $line . $nextline;
+
+ $restofline = $restofline . $nextline;
+
+ ($group,$restofline,$done) = &getnextgroup($restofline);
+ }
+ else
+ {
+ die "EOF found whilst scanning second argument to \\ifmakedtx on line $startline\n";
+ }
+ }
+
+ $line = $restofline;
+ }
+
+ $line = $beginline . $restofline;
+
+ if (($line=~/\\end{document}/) and not $inverb)
+ {
+ $indoc=0;
+
+ $line=~s/\\end{document}//;
+ }
+
+ $line=~s/\n/\n\%/mg;
+
+ print DTX "$line";
+}
+
+close DOC;
+
+print DTX "\n";
+
+if ($stopfound==0)
+{
+ print DTX "\%\\StopEventually{$stopeventually}\n";
+}
+
+print DTX "\%\\section{$codetitle}\n";
+
+for (my $idx = 0; $idx <= $#derivedfiles; $idx++)
+{
+ $thisinfile = $derivedfiles[$idx]{'in'};
+ $thisoutfile = $derivedfiles[$idx]{'out'};
+
+ if ($verbose)
+ {
+ print "$srcdirfile -> $_ \n";
+ }
+
+ open SRC, $thisinfile or die "Can't open $thisinfile\n";
+
+ print DTX "\%\\iffalse\n";
+ print DTX "\% \\begin{macrocode}\n";
+ print DTX "\%<*$thisoutfile>\n";
+ print DTX "\% \\end{macrocode}\n";
+ print DTX "\%\\fi\n";
+
+ $macrocode = 0;
+ $comment = 0;
+
+ foreach $expr (@comment)
+ {
+ if ($thisoutfile =~ m/$expr/)
+ {
+ print DTX "\%\\iffalse\n";
+
+ $comment = 1;
+ }
+ }
+
+ foreach $expr (@macrocode)
+ {
+ if ($thisoutfile =~ m/$expr/)
+ {
+ print DTX "\% \\begin{macrocode}\n";
+
+ $macrocode = 1;
+ }
+ }
+
+ while (<SRC>)
+ {
+ print DTX "$_";
+ }
+
+ if ($macrocode == 1)
+ {
+ print DTX "\% \\end{macrocode}\n";
+ }
+
+ if ($comment == 1)
+ {
+ print DTX "\%\\fi\n";
+ }
+
+ print DTX "\%\\iffalse\n";
+ print DTX "\% \\begin{macrocode}\n";
+ print DTX "\%</$thisoutfile>\n";
+ print DTX "\% \\end{macrocode}\n";
+ print DTX "\%\\fi\n";
+
+ close SRC;
+}
+
+print DTX "\%$prefinale\n" if ($prefinale);
+print DTX "\%\\Finale\n";
+print DTX "\\endinput\n";
+
+close DTX;
+
+if (!$noins)
+{
+ open INS, ">$basename.ins" or die "Can't open '$basename.ins'\n";
+
+ print INS "\% $basename.ins generated using makedtx version $version $year/",$mon+1,"/$mday $hour:", $min<10?"0$min":$min,"\n";
+
+ print INS "\\input docstrip\n\n";
+ print INS "\\preamble\n";
+ print INS "$preamble\n";
+ print INS "\\endpreamble\n\n";
+
+ if ($postamble ne "")
+ {
+ print INS "\\postamble\n";
+ print INS "$postamble\n";
+ print INS "\\endpostamble\n\n";
+ }
+
+ if ($askforoverwrite)
+ {
+ print INS "\\askforoverwritetrue\n\n";
+ }
+ else
+ {
+ print INS "\\askforoverwritefalse\n\n";
+ }
+
+ print INS "\\generate{";
+
+ for (my $idx = 0; $idx <= $#derivedfiles; $idx++)
+ {
+ $file = $derivedfiles[$idx]{'in'};
+ $outfile = $derivedfiles[$idx]{'out'};
+
+ print INS "\\file{$outfile}{";
+
+ $ambleset = 0;
+ $noamble = 0;
+
+ foreach $setamble (@setambles)
+ {
+ ($fileexp, $amble, $remainder) = split /=>/, $setamble;
+
+ if (not ($remainder eq ""))
+ {
+ die "-setambles $setamble argument invalid (too many => specified)\n";
+ }
+
+ if ($outfile =~ m/$fileexp/)
+ {
+ if ($verbose)
+ {
+ print "$fileexp matches $outfile -> setting \"$amble\"\n";
+ }
+
+ print INS $amble;
+
+ $ambleset = 1;
+
+ if ($amble =~ m/\\nopreamble/)
+ {
+ $noamble = 1;
+ }
+ }
+ }
+
+ if (!$ambleset)
+ {
+ print INS "\\usepreamble\\defaultpreamble\n\\usepostamble\\defaultpostamble";
+ }
+
+ print INS "\\from{$basename.dtx}{$outfile";
+
+ if ($noamble == 0)
+ {
+ # this will add the character table to all files except those that use \nopreamble
+
+ print INS ",package";
+ }
+
+ print INS "}}\n";
+ }
+
+ print INS "}\n\n";
+
+ print INS "\\endbatchfile\n";
+
+ close INS;
+}
+
+sub syntaxerror
+{
+ die "Syntax : makedtx [options] <basename>\nUse -h for help\n";
+}
+
+sub help
+{
+ print "makedtx Help\n\n";
+
+ print "Current Version : $version\n\n";
+
+ print "usage : makedtx [options] -src \"<expr>=><expr>\" -doc <filename> <basename>\n\n";
+
+ print "makedtx can be used to construct a LaTeX2e dtx and ins file from\n";
+ print "the specified source code. The final command line argument\n";
+ print "<basename> should be used to specify the basename of the dtx\n";
+ print "and ins files.\n\n";
+
+ print "-src \"<expr1>=><expr2>\"\n";
+ print "The command line switch -src identifies the original source code and the name\n";
+ print "of the file to which it will utimately be extracted on latexing the ins file\n";
+ print "<expr1> can be a Perl expression, such as (foo)src.(sty), and <expr2> can\n";
+ print "a Perl substitution style expression, such as $1.$2\n";
+ print "Note that double quotes must be used to prevent shell expansion\n";
+ print "Multiple invocations of -src are permitted\n";
+ print "See examples below.\n\n";
+
+ print "-doc <filename>\n";
+ print "The name of the documentation source code. This should be a LaTeX2e document\n\n";
+
+ print "Optional Arguments:\n\n";
+
+ print "-dir <directory> : search for source files in <directory>\n";
+ print "-op <character> : set the pattern matching operator (default '$patternop')\n";
+ print "-askforoverwrite : set askforoverwrite switch in INS file to true\n";
+ print "-noaskforoverwrite : set askforoverwrite switch in INS file to false (default)\n";
+ print "-preamble <text> : set the preamble. Standard one inserted if omitted\n";
+ print "-postamble <text> : set the postamble.\n";
+ print "-setambles \"<pattern>=><text>\" : set pre- and postambles to <text> if file matches pattern\n";
+ print "-author <text> : name of author (inserted into standard preamble. User name inserted if omitted)\n";
+ print "-date <text> : copyright date\n";
+ print "-ins : create the ins file (default)\n";
+ print "-noins : don't create the ins file\n";
+ print "-prefinale <text> : add <text> immediately prior to \\Finale\n";
+ print "-macrocode <expr> : surround any file which matches <expr> in a macrocode environment\n";
+ print "-comment <expr> : surround any file which matches <expr> with \\iffalse \\fi pair\n";
+ print "-codetitle <text> : The title for the documented code section (default: The Code)\n";
+ print "-license <license> : use the given license for the preamble.\n";
+ print " Known licenses: lppl (default), bsd, gpl.\n";
+ print "-h : help message\n";
+ print "-v : verbose\n\n";
+
+ print "Examples:\n\n";
+
+ print "Example 1:\n";
+ print "Documenation is in foodoc.tex\n";
+ print "Source code is in foosrc.sty. The final extracted version should be \n";
+ print "called foo.sty. The dtx file should be called foo.dtx and the ins file\n";
+ print " should be called foo.ins\n\n";
+
+ print "makedtx -src \"foosrc\\.sty=>foo.sty\" -doc foodoc.tex foo\n\n";
+
+ print "Example 2:\n";
+ print "Documenation is in bardoc.tex\n";
+ print "Source code is in barsrc.sty. The final extracted version should be\n";
+ print "called bar.sty. Source code is also in barsrc.bst. The final extracted\n";
+ print "version should be called bar.bst. The dtx file should be called bar.dtx and\n";
+ print "the ins file should be called bar.ins\n\n";
+
+ print "makedtx -src \"barsrc\\.sty=>bar.sty\" -src \"barsrc\\.bst=>bar.bst\" -doc bardoc.tex bar\n\n";
+
+ print "Or\n\n";
+
+ print "makedtx -src \"barsrc\\.(bst|sty)=>bar.\$1\" -doc bardoc.tex bar\n\n";
+
+ die;
+}
+
+sub eatinitialspaces
+{
+ my ($STR) = @_;
+
+ while (substr($STR,0,1) eq "\s")
+ {
+ $STR = substr($STR,1);
+ }
+
+ return $STR;
+}
+
+sub getnextgroup
+{
+ my($curline) = @_;
+
+ $curline = &eatinitialspaces($curline);
+
+ # check to see if current string is blank
+
+ if ($curline!~/[^\s]+/m)
+ {
+ return ("","",0);
+ }
+
+ if (($group = substr($curline,0,1)) ne "{")
+ {
+ # next group hasn't been delimited with braces
+ # return first non-whitespace character
+
+ $curline = substr($curline,1);
+
+ # unless it's a backslash, in which case get command name
+
+ if ($group eq "\\")
+ {
+ if ($curline=~/([a-zA-Z]+)(^[a-zA-Z].*)/m)
+ {
+ $group = $1;
+
+ $curline = $2;
+ }
+ else
+ {
+ # command is made up of backslash followed by symbol
+
+ $curline=~/([\W_0-9\s\\])(.*)/m;
+
+ $group = $1;
+
+ $curline = $2;
+ }
+ }
+
+ return ($group,$curline,1);
+ }
+
+ my $pos=index($curline, "{");
+ my $startpos=$pos;
+ my $posopen=0;
+ my $posclose=0;
+
+ my $bracelevel = 1;
+
+ my $done=0;
+
+ while (!$done)
+ {
+ $pos++;
+
+ $posopen = index($curline, "{", $pos);
+
+ # check to make sure it's not a \{
+
+ while ((substr($curline, $posopen-1,1) eq "\\") and ($posopen > 0))
+ {
+ # count how many backlashes come before it.
+
+ $i = $posopen-1;
+
+ $numbs = 1;
+
+ while ((substr($curline, $i-1,1) eq "\\") and ($i > 0))
+ {
+ $numbs++;
+ $i--;
+ }
+
+ # is $numbs is odd, we have a \{, otherwise we have \\{
+
+ if ($numbs%2 == 0)
+ {
+ last;
+ }
+ else
+ {
+ $posopen = index($curline, "{", $posopen+1);
+ }
+ }
+
+ $posclose= index($curline, "}", $pos);
+
+ # check to make sure it's not a \}
+
+ while ((substr($curline, $posclose-1,1) eq "\\") and ($posclose > 0))
+ {
+ # count how many backlashes come before it.
+
+ $i = $posclose-1;
+
+ $numbs = 1;
+
+ while ((substr($curline, $i-1,1) eq "\\") and ($i > 0))
+ {
+ $numbs++;
+ $i--;
+ }
+
+ # is $numbs is odd, we have a \}, otherwise we have \\}
+
+ if ($numbs%2 == 0)
+ {
+ last;
+ }
+ else
+ {
+ $posclose = index($curline, "}", $posclose+1);
+ }
+ }
+
+ if (($posopen==-1) and ($posclose==-1))
+ {
+ $done=1;
+ }
+ elsif ($posopen==-1)
+ {
+ $pos=$posclose;
+
+ $bracelevel--;
+
+ if ($bracelevel==0)
+ {
+ $group = substr($curline, $startpos+1, $pos-$startpos-1);
+
+ $curline = substr($curline, $pos+1);
+
+ return ($group,$curline,1);
+ }
+ }
+ elsif ($posclose==-1)
+ {
+ $pos=$posopen;
+
+ $bracelevel++;
+ }
+ elsif ($posopen<$posclose)
+ {
+ $pos=$posopen;
+
+ $bracelevel++;
+ }
+ elsif ($posclose<$posopen)
+ {
+ $pos=$posclose;
+
+ $bracelevel--;
+
+ if ($bracelevel==0)
+ {
+ $group = substr($curline, $startpos+1, $pos-$startpos-1);
+
+ $curline = substr($curline, $pos+1);
+
+ return ($group,$curline,1);
+ }
+ }
+ }
+
+ # closing brace must be on another line
+
+ return ("", $curline, 0);
+}
+1;
diff --git a/Master/texmf-dist/source/latex/makedtx/makedtx.dtx b/Master/texmf-dist/source/support/makedtx/makedtx.dtx
index eaefdfe11df..eaefdfe11df 100644
--- a/Master/texmf-dist/source/latex/makedtx/makedtx.dtx
+++ b/Master/texmf-dist/source/support/makedtx/makedtx.dtx
diff --git a/Master/texmf-dist/source/latex/makedtx/makedtx.ins b/Master/texmf-dist/source/support/makedtx/makedtx.ins
index 0f28af11859..0f28af11859 100644
--- a/Master/texmf-dist/source/latex/makedtx/makedtx.ins
+++ b/Master/texmf-dist/source/support/makedtx/makedtx.ins
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index 84efd216ce1..b63e6c5b163 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -2658,6 +2658,7 @@ $standardttf = '\.ttf|\.TTC';
'lua2dox' => 'lua2dox_filter?$',
'luaotfload' => 'luaotfload-tool',
'make4ht' => 'make4ht$',
+ 'makedtx' => '^makedtx\.pl$',
'match_parens' => '^match_parens$',
'mathspic' => '^mathspic\.pl$',
'multibibliography' => '\.pl$',
diff --git a/Master/tlpkg/tlpsrc/makedtx.tlpsrc b/Master/tlpkg/tlpsrc/makedtx.tlpsrc
index e69de29bb2d..dca338c719c 100644
--- a/Master/tlpkg/tlpsrc/makedtx.tlpsrc
+++ b/Master/tlpkg/tlpsrc/makedtx.tlpsrc
@@ -0,0 +1 @@
+binpattern f bin/${ARCH}/${PKGNAME}