[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

TL2012 and paper config



Hi Frank, hi all,

I would like to propose some changes to the paperconf stuff ...
you know I am horrible.

You did hard work to include it in texconfig, but texconfig is going
to disappear ... we don't see any use for it anyway, most things
are done in tlmgr now.

Now, there is also paper handling in tlmgr and that is much better:
$ tlmgr xdvi paper --list
a4
c4
...
$ tlmgr pdftex paper --list
a4
letter
$ 

etc etc and one can set paper size, too.

The code is quite easy, from tlmgr.pl:
  my $action = shift @ARGV;
  if ($action =~ m/^paper$/i) {  # generic paper
    my $newpaper = shift @ARGV;
    if ($opts{"list"}) {  # tlmgr paper --list => complain.
      tlwarn("tlmgr: ignoring paper setting to $newpaper with --list\n")
        if $newpaper;  # complain if they tried to set, too.
      tlwarn("tlmgr: please specify a program before paper --list, ",
             "as in: tlmgr pdftex paper --list\n");

    } elsif (!defined($newpaper)) {  # tlmgr paper => show all current sizes.
      TeXLive::TLPaper::paper_all($texmfsysconfig,undef);

    } elsif ($newpaper !~ /^(a4|letter)$/) {  # tlmgr paper junk => complain.
      $newpaper = "the empty string" if !defined($newpaper);
      tlwarn("tlmgr: expected `a4' or `letter' after paper, not $newpaper\n");

    } else { # tlmgr paper {a4|letter} => do it.
      return if !check_on_writable();
      TeXLive::TLPaper::paper_all($texmfsysconfig,$newpaper);
    }

  } else {  # program-specific paper
    my $prog = $action;     # first argument is the program to change
    my $arg = shift @ARGV;  # get "paper" argument
    if (!defined($arg) || $arg ne "paper") {
      $arg = "the empty string." if ! $arg;
      tlwarn("tlmgr: expected `paper' after $prog, not $arg\n");
      return;
    }
    # the do_paper progs check for the argument --list, so if given
    # restore it to the cmd line.
    if (@ARGV) {
      return if !check_on_writable();
    }
    unshift(@ARGV, "--list") if $opts{"list"};
    TeXLive::TLPaper::do_paper($prog,$texmfsysconfig,@ARGV);
  }

I can easily create a very simple perl script that does the same without
tlmgr, actually only the use ... statements are missing.

Would that be integrable into this?

Files are written to TEXMFCONFIG automatically

Best wishes

Norbert
------------------------------------------------------------------------
Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan                                 TeX Live & Debian Developer
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
CONDOVER (n.)
One who is employed to stand about all day browsing through the
magazine racks in the newsagent.
			--- Douglas Adams, The Meaning of Liff


Reply to: