summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/TeXLive/TLPaper.pm32
1 files changed, 32 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLPaper.pm b/Master/tlpkg/TeXLive/TLPaper.pm
index f5c1e97d147..e206b7de681 100644
--- a/Master/tlpkg/TeXLive/TLPaper.pm
+++ b/Master/tlpkg/TeXLive/TLPaper.pm
@@ -58,6 +58,7 @@ my %paper_sub = (
"dvipdfmx" => \&paper_dvipdfmx,
"dvipdfm" => \&paper_dvipdfm,
"context" => \&paper_context,
+ "psutils" => \&paper_psutils,
);
# Where to write to by default.
@@ -68,6 +69,7 @@ my %default_paper_config_path_component = (
"dvipdfmx" => "dvipdfmx",
"dvipdfm" => "dvipdfm",
"context" => "tex/context/user",
+ "psutils" => "psutils",
);
my %default_paper_config_name = (
@@ -77,6 +79,7 @@ my %default_paper_config_name = (
"dvipdfmx" => "dvipdfmx.cfg",
"dvipdfm" => "config",
"context" => "cont-sys.tex",
+ "psutils" => "paper.cfg",
);
# Output is done to the components in this hash.
@@ -152,6 +155,8 @@ my %dvipdfm_papersize = (
"tabloid" => 1,
);
+my %psutils_papersize = ( "a4" => 1, "letter" => 1, );
+
@@ -616,6 +621,33 @@ sub paper_context {
}
+# psutils
+# config file "psutils/paper.cfg" only contains two words:
+# p <papersize>
+#
+sub paper_psutils {
+ my $outtree = shift;
+ my $newpaper = shift;
+
+ my ($outcomp, $filecomp) = setup_names("psutils");
+ my $dftfile = $default_paper_config_name{"psutils"};
+ my $outfile = "$outtree/$outcomp/$filecomp";
+ my $inp = &find_paper_file("psutils", "other text files", $filecomp, $dftfile);
+
+ return unless $inp;
+
+
+ my @sizes = keys %psutils_papersize;
+ return &paper_do_simple($inp, "psutils", '^\s*p', '^\s*p\s+(\w+)\s*$',
+ sub {
+ my ($ll,$np) = @_;
+ $ll =~ s/^\s*p\s+(\w+)\s*$/p $np\n/;
+ return($ll);
+ },
+ $outfile, \@sizes, '(undefined)', 'p a4', $newpaper);
+}
+
+
# paper_do_simple does the work for single line config files
# (xdvi, dvipdfm, ...)
# arguments: