diff options
author | Norbert Preining <preining@logic.at> | 2014-04-20 22:59:20 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2014-04-20 22:59:20 +0000 |
commit | 8e75cdadaf0dc67b1fe9412a8245567d646fa3d9 (patch) | |
tree | 56117ee3d2d1d2ef897ed6349665414d4cb0a6d1 /Master | |
parent | ce5dd4137c8f88f9449e78ea4e02081bb589432e (diff) |
psutils support in TLPaper.pm
git-svn-id: svn://tug.org/texlive/trunk@33566 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPaper.pm | 32 |
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: |