• Home (current)
  • वर्तमान निदेशक => /bin/X11/
  • सूचना एवं अपलोड
    Info Server
Indian Cyber Force
Folders रचयन्तु सञ्चिकां रचयन्तु RansomWeb लॉगआउट
Current File : //bin/X11/tl-paper
#!/usr/bin/perl
#
# tl-paper
#
# query and change paper settings using TLPaper
# this is independent from tlmgr
#
# Copyright 2011-2015 Norbert Preining
# This file is licensed under the GNU General Public License version 3
# or any later version.
#

BEGIN {
  $^W = 1;
  chomp ($mydir = `dirname $0`);
  unshift (@INC, "/usr/share/texlive/tlpkg");
}

$^W = 1;
use strict;
use Cwd qw/abs_path/;
use Pod::Usage;
use Getopt::Long qw(:config no_autoabbrev permute);
use TeXLive::TLPaper;

# overwrite the default paper config settings
our %paper_config_name = (
  "xdvi"     => "XDvi-paper",
  "pdftex"   => "pdftexconfig.tex",
  "dvips"    => "config-paper.ps",
  "dvipdfmx" => "dvipdfmx-paper.cfg",
  "context"  => "cont-sys-paper.tex",
);

binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");

&main();

sub main {
  # the script always runs in sys mode
  chomp(my $texmfsysconfig = `kpsewhich -var-value=TEXMFSYSCONFIG`);
  chomp(my $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`);
  $ENV{"TEXMFCONFIG"} = $texmfsysconfig;
  $ENV{"TEXMFVAR"} = $texmfsysvar;

  my $action = shift @ARGV;
  $action = "status" if !defined($action);
  if ($action =~ m/^status$/i) {  # "tl-paper status" shows the current settings
    TeXLive::TLPaper::paper_all($texmfsysvar,undef);
    
  } elsif ($action =~ m/^list$/i) { # "tl-paper list prg" lists options for prg
    my $prg = shift @ARGV;
    if (!$prg) {
      # currently, pdftex has the most restricted set of paper sizes
      $prg = "pdftex";
    }
    # the following actually also *reads* the configuration and returns
    # a list where the first item is the one selected.
    my $paperref = TeXLive::TLPaper::get_paper_list($prg);
    my ($current_paper, @other_options) = @{$paperref};
    for my $i ($current_paper, sort @other_options) {
      print "$i\n";
    }
    # for simply getting the list of supported paper sizes without reading
    # anything, one can use:
    # my @paper_options = keys(%{${prg}_papersize});

  } elsif ($action =~ m/^set$/i) { # "tl-paper set <prg|all> <paper>" sets paper
    my $prg = shift @ARGV;
    my $newpaper = shift @ARGV;

    if ($prg !~ m/^(xdvi|pdftex|dvips|dvipdfmx|context|all)$/i) {
      usage();
      exit 1;
    }
    # set TEXMFVAR and TEXMFSYSVAR to TEXMFDIST (which is == TEXMFMAIN)
    # so that we always find either the system provided config file
    # as distributed in /usr/share/texlive/texmf-dist, or, if the
    # admin decided to override that, a copy in TEXMFSYSCONFIG
    # but *not* the one we have created at some point in history
    # in TEXMF(SYS)VAR
    chomp(my $texmfdist = `kpsewhich -var-value=TEXMFDIST`);
    $ENV{"TEXMFVAR"} = $ENV{"TEXMFSYSVAR"} = $texmfdist;
    if ($prg =~ m/^all$/i) {
      if ($newpaper !~ /^(a4|letter)$/) {
        # we cannot deal with that for now, only a4|letter supported for
        # all programs
        print "tl-paper: cannot change setting for all programs to $newpaper\n\n";
        exit 1;
      }
      TeXLive::TLPaper::paper_all($texmfsysvar,$newpaper);
    
    } else {
      TeXLive::TLPaper::do_paper($prg,$texmfsysvar,$newpaper);
    }
  
    # we probably have changed the paper, so run the execute actions
    # as announced by TLPaper, that is $::files_changed and 
    # $::regenerate_all_formats.
    #
    # but we do not do this here, but rely on the libpaper shell
    # script to do the rest

  } elsif ($action =~ m/^get$/i) { # "tl-paper get prg" gets paper setting for prg
    my $prg = shift @ARGV;
    if ($prg !~ m/^(xdvi|pdftex|dvips|dvipdfmx|context)$/i) {
      usage();
      exit 1;
    }
    my $paperref = TeXLive::TLPaper::get_paper_list($prg);
    my ($current_paper, @other_options) = @{$paperref};
    print "$current_paper\n" if defined($current_paper);
    
  } else {
    usage();
    exit 1;
  }
  exit 0;
}

sub usage {
  print STDERR "
tl-paper: inquire and set paper settings for various programs in the TeX World.

usage:
  tl-paper list <program>     lists available papers, current paper first
  tl-paper status             lists all current settings
  tl-paper get <program>      prints the current paper for <program>
  tl-paper set <program> <newpaper>    sets new paper for <program>
  tl-paper set all <a4|letter>         sets new paper for all programs

Note: after changing the paper setting for pdftex or context, a rebuild
      of formats (fmtutil-sys --all) is necessary to make the changes
      take effect.
";
}



### Local Variables:
### perl-indent-level: 2
### tab-width: 2
### indent-tabs-mode: nil
### End:
# vim:set tabstop=2 expandtab: #
Frontend Submission – Verilere bak
Menu
  • Top 10

Verilere bak

Follow us
  • facebook
  • twitter
Search
Login
Create
Menu

Verilere bak

Login

You are here:

  1. Home
  2. Frontend Submission

Frontend Submission

  • Story

    Mix text with images and embeds

  • Image

    JPG, PNG or GIF

  • Audio

    MP3 or SoundCloud embed, MixCloud, etc.

  • Video

    MP4 or YouTube embed, Vimeo, Dailymotion, etc.

  • Gallery

    A collection of images

  • Embed

    Facebook post, Twitter status, etc.

  • Link

    External site's link

  • Open list

    Everyone can submit new list items and vote up for the best submission

  • Ranked list

    Everyone can vote up for the best list item

  • Classic list

    A list-based article

  • Meme

    Create a funny pic

  • Trivia quiz

    What do you know about ...?

  • Personality quiz

    What type of person are you?

  • Poll

    One or multiple questions about a subject or person

  • Versus

    A poll where each question has two competing answers

  • Hot or Not

    A poll where each question has two opposite answers

Bir yanıt yazın Yanıtı iptal et

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

  • facebook
  • twitter

© 2017 bring the pixel. Remember to change this

  • Home
  • Contact us
Back to Top
Close
  • Top 10
  • Home
  • Animals
  • Funny
  • WOW
  • WTF
  • Features
  • facebook
  • twitter
Create

Log In

Sign In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Back to Login

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Accept

Add to Collection

  • Public collection title

  • Private collection title

No Collections

Here you'll find all collections you've created before.

Close
of

Processing files…

Hey Friend!
Before You Go…

Get the best viral stories straight into your inbox before everyone else!

Don't worry, we don't spam

Close

Newsletter

Don’t miss out on new posts!

Don't worry, we don't spam

Close