1# graphics.perl
2#    by Bruce Miller <bruce.miller@nist.gov>
3# Support of the graphics.sty standard LaTeX2e package
4#    with `standard argument format'
5# See graphics-support.perl
6# ======================================================================
7do_require_package('graphics-support');
8
9# Package Options
10sub do_graphics_dvips {}
11sub do_graphics_draft {} # What'd be the point?
12sub do_graphics_final {}
13sub do_graphics_hiresbb {}
14sub do_graphics_hiderotate {
15  map($GRAPHICS_OPTHIDE{$_}=1, @GRAPHICS_ROTATEOPTS); }
16sub do_graphics_hidescale  {
17  map($GRAPHICS_OPTHIDE{$_}=1, @GRAPHICS_SCALEEOPTS); }
18
19# ======================================================================
20sub do_cmd_includegraphics {
21  local($_)=@_;
22  my $opt=x_next_optarg();   $opt =~ s/,/ /;
23  my $op2=x_next_optarg();   $op2 =~ s/,/ /;
24  my $file = x_next_arg();
25  do_includegraphics($file,
26     ($op2 ? "bb=$opt $op2" : ($opt ? "bb=0 0 $opt" : '')),
27     "\\includegraphics".($opt && "[$opt]").($op2 && "[$op2]")."\{$file\}"); }
28
29sub do_cmd_includegraphicsstar {
30  local($_)=@_;
31  my $opt=x_next_optarg();  $opt =~ s/,/ /;
32  my $op2=x_next_optarg();  $op2 =~ s/,/ /;
33  my $file = x_next_arg();
34  do_includegraphics($file,
35     ($op2 ? "bb=$opt $op2, clip" : ($opt ? "bb=0 0 $opt, clip" : "clip")),
36     "\\includegraphics*".($opt && "[$opt]").($op2 && "[$op2]")."\{$file\}"); }
37
38# ======================================================================
391;
40
41