summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/required/graphics')
-rw-r--r--macros/latex-dev/required/graphics/README.md64
-rw-r--r--macros/latex-dev/required/graphics/cat.eps305
-rw-r--r--macros/latex-dev/required/graphics/changes.txt951
-rw-r--r--macros/latex-dev/required/graphics/color.dtx963
-rw-r--r--macros/latex-dev/required/graphics/color.pdfbin0 -> 201388 bytes
-rw-r--r--macros/latex-dev/required/graphics/drivers.dtx1701
-rw-r--r--macros/latex-dev/required/graphics/drivers.pdfbin0 -> 263550 bytes
-rw-r--r--macros/latex-dev/required/graphics/epsfig.dtx142
-rw-r--r--macros/latex-dev/required/graphics/epsfig.pdfbin0 -> 154501 bytes
-rw-r--r--macros/latex-dev/required/graphics/graphics-2017-06-25.sty526
-rw-r--r--macros/latex-dev/required/graphics/graphics-drivers.ins92
-rw-r--r--macros/latex-dev/required/graphics/graphics.dtx1992
-rw-r--r--macros/latex-dev/required/graphics/graphics.ins43
-rw-r--r--macros/latex-dev/required/graphics/graphics.pdfbin0 -> 282826 bytes
-rw-r--r--macros/latex-dev/required/graphics/graphicx.dtx939
-rw-r--r--macros/latex-dev/required/graphics/graphicx.pdfbin0 -> 232397 bytes
-rw-r--r--macros/latex-dev/required/graphics/grfguide.pdfbin0 -> 310552 bytes
-rw-r--r--macros/latex-dev/required/graphics/grfguide.tex1031
-rw-r--r--macros/latex-dev/required/graphics/keyval.dtx419
-rw-r--r--macros/latex-dev/required/graphics/keyval.pdfbin0 -> 222532 bytes
-rw-r--r--macros/latex-dev/required/graphics/lscape.dtx135
-rw-r--r--macros/latex-dev/required/graphics/lscape.pdfbin0 -> 150124 bytes
-rw-r--r--macros/latex-dev/required/graphics/rotating.dtx686
-rw-r--r--macros/latex-dev/required/graphics/rotating.pdfbin0 -> 246259 bytes
-rw-r--r--macros/latex-dev/required/graphics/rotex.pdfbin0 -> 162266 bytes
-rw-r--r--macros/latex-dev/required/graphics/rotex.tex500
-rw-r--r--macros/latex-dev/required/graphics/trig.dtx329
-rw-r--r--macros/latex-dev/required/graphics/trig.pdfbin0 -> 191711 bytes
28 files changed, 10818 insertions, 0 deletions
diff --git a/macros/latex-dev/required/graphics/README.md b/macros/latex-dev/required/graphics/README.md
new file mode 100644
index 0000000000..81f39d1d7b
--- /dev/null
+++ b/macros/latex-dev/required/graphics/README.md
@@ -0,0 +1,64 @@
+The LaTeX `graphics` bundle
+===========================
+
+Release 2019-10-01 pre-release 2
+
+Overview
+--------
+
+This bundle consists of packages supporting basic color, graphics and text
+manipulation operations in LaTeX. The packages provided here are
+
+- `color`: Core color support
+- `graphics`: The original LaTeX graphics inclusion interface
+- `graphicx`: Extended interface for graphics inclusion
+- `lscape`: Production of landscape pages
+- `keyval`: Core key-value support for LaTeX
+- `rotating`: Support for rotating material
+- `trig`: Support for fast trigonometric calculations in TeX
+
+plus the legacy stub `epsfig` (now subsumed into `graphics`).
+
+Installation
+------------
+
+We no longer distribute installation instructions for the various TeX
+implementations. All modern TeX systems include `graphics` as-standard, and end
+users should in general use the release versions supplied in this way.
+
+Release distribution is carried out only through the CTAN archives.
+
+Reporting Bugs
+--------------
+
+If you wish to report a problem or bug in the `graphics` bundle
+please use the [Issue Tracker for LaTeX2e on
+GitHub](https://github.com/latex3/latex2e/issues)
+and follow the guidelines that pop up if you press the "New issue" button.
+
+In particular, to check that you are really seeing a bug, please write
+a short, self-contained document that shows the problem. This should
+include the `latexbug` package, which will warn if your test file is
+not suitable for one or the other reason. See the [CONTRIBUTING
+guide](https://github.com/latex3/latex2e/blob/master/CONTRIBUTING.md)
+for further details, or if you need to obtain the `latexbug` package.
+
+If the bug turns out to be with third-party software then please
+contact the developer, and not us!
+
+License
+-------
+
+The contents of this bundle are distributed under the [LaTeX Project
+Public License](https://www.latex-project.org/lppl/lppl-1-3c/),
+version 1.3c or later.
+
+Copyright
+---------
+
+Copyright is maintained on each of these packages by the author(s)
+of the package.
+
+-----
+
+<p>Copyright (C) 1993-2019 The LaTeX Project <br />
diff --git a/macros/latex-dev/required/graphics/cat.eps b/macros/latex-dev/required/graphics/cat.eps
new file mode 100644
index 0000000000..0042ea088f
--- /dev/null
+++ b/macros/latex-dev/required/graphics/cat.eps
@@ -0,0 +1,305 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%BoundingBox: 44 527 80 559
+%%Creator: COREL DRAW
+%%Title: CAT.TMP
+%%CreationDate: Sat Jan 18 17:29:05 1992
+
+%%DocumentFonts:
+%%EndComments
+%%BeginProlog
+% -------------- POSTSCRIPT PROLOG FOR CORELDRAW 2.X ------
+% Copyright Corel Systems Corporation 1990
+/AutoFlatness 0 def/wCorelDict 300 dict def
+wCorelDict begin/bd{bind def}bind def/ld{load def}bd
+/xd{exch def}bd/_ null def/$c 0 def/$m 0 def
+/$y 0 def/$k 0 def/$t 1 def/$n _ def/$o 0 def
+/$fil 0 def/$C 0 def/$M 0 def/$Y 0 def/$K 0 def
+/$T 1 def/$N _ def/$O 0 def/$PF false def
+/$pan 0 def/$h false def/$al 0 def/$tr 0 def
+/$le 0 def/$lx 0 def/$ly 0 def/$ctm matrix currentmatrix def
+/$ptm matrix def/$ttm matrix def/$stm matrix def
+/$skm matrix def/$fst 128 def/$pad 0 def/$rox 0 def
+/$roy 0 def currentscreen/@dsp xd/$dsp/@dsp def
+/$dsa xd/$dsf xd/$sdf false def/$SDF false def
+/$Scra 0.0 def statusdict/pageparams known{statusdict begin
+pageparams end 1 ne{/$Scra -90.0 def}if pop pop pop}if
+/$sv 0 def/@cp/closepath ld/@gs/gsave ld/@gr/grestore ld
+/@np/newpath ld/@sv{/$sv save def}bd/@rs{$sv restore}bd
+/@ss{load setscreen}bd AutoFlatness 1 eq{/$cpx ([Error: PathTooComplex; OffendingCommand: AnyPaintingOperator;\n) def
+/@err1{$cpx print flush newpath}bd/@ifl{currentflat dup 10 gt{pop @err1 exit}if 2 add setflat}bd
+/@fill/fill ld/fill{currentflat{{@fill}stopped{@ifl}{exit}ifelse}bind loop setflat}bd
+/@eofill/eofill ld/eofill{currentflat{{@eofill}stopped{@ifl}{exit}ifelse}bind loop setflat}bd
+/@clip/clip ld/clip{currentflat{{@clip}stopped{initclip @ifl}{exit}ifelse}bind loop setflat}bd
+/@eoclip/eoclip ld/eoclip{currentflat{{@eoclip}stopped{initclip @ifl}{exit}ifelse}bind loop setflat}bd
+/@stroke/stroke ld/stroke{currentflat{{@stroke}stopped{@ifl}{exit}ifelse}bind loop setflat}bd
+}if/InRange{3 -1 roll 2 copy le{pop}{exch pop}ifelse
+2 copy ge{pop}{exch pop}ifelse}bd/wDstChck{2 1 roll dup 3 -1 roll
+eq{1 add}if}bd/@dot{dup mul exch dup mul add 1 exch sub 2 div}bd
+/@lin{exch pop abs 1 exch sub}bd/@MN{2 copy le{pop}{exch pop}ifelse}bd
+/setcmykcolor where{pop}{/setcmykcolor{4 1 roll
+3{3 index add 1 @MN 1 exch sub 3 1 roll}repeat
+setrgbcolor pop}bd}ifelse/colorimage where{pop}{/colorimage{/$ncl xd
+pop pop pop pop{currentfile $dat readhexstring pop}repeat
+pop}bd}ifelse/@tc{dup 1 ge{pop}{4{dup 6 -1 roll
+mul exch}repeat pop}ifelse}bd/@spc{7 2 roll
+ColorSeparationMode 1 eq{6 index @tc 0 4 $ink sub index
+exch pop}{5 index dup _ eq{pop 0 4 $ink sub index
+exch pop}{CurrentInkName eq{6 index}{0}ifelse}ifelse}ifelse
+5 1 roll 8 -2 roll 6{pop}repeat 1 exch sub dup setgray
+1 eq exch 1 eq and not}bd/@scc{$ink -1 eq
+{$c $m $y $k $t @tc setcmykcolor true}{$o $c $m $y $k $t $n @spc
+}ifelse}bd/@SCC{$ink -1 eq{$C $M $Y $K $T @tc setcmykcolor true}{
+$O $C $M $Y $K $T $N @spc}ifelse}bd/@sft{
+/$tx $tllx $pxf add dup $tllx gt{$pwid sub}if def
+/$ty $tury $pyf sub dup $tury lt{$phei add}if def}bd
+/@stb{pathbbox/$ury xd/$urx xd/$lly xd/$llx xd}bd
+/@ep{{cvx exec}forall}bd/@tp{@sv/$in true def
+2 copy dup $lly le{/$in false def}if $phei sub $ury ge{/$in false def}if
+dup $urx ge{/$in false def}if $pwid add $llx le{/$in false def}if
+$in{@np 2 copy moveto $pwid 0 rlineto 0 $phei neg rlineto
+$pwid neg 0 rlineto 0 $phei rlineto clip @np
+$pn cvlit load aload pop 7 -1 roll 5 index sub
+7 -1 roll 3 index sub translate/$ctm matrix currentmatrix def
+@ep pop pop pop pop}{pop pop}ifelse @rs}bd/@th{@sft
+0 1 $tly 1 sub{dup $psx mul $tx add{dup $llx gt{$pwid sub}{exit}ifelse
+}loop exch $phei mul $ty exch sub 0 1 $tlx 1 sub{$pwid mul
+3 copy 3 -1 roll add exch @tp pop}for pop pop}for}bd
+/@tv{@sft 0 1 $tlx 1 sub{dup $pwid mul $tx add
+exch $psy mul $ty exch sub{dup $ury lt{$phei add}{exit}ifelse}loop
+0 1 $tly 1 sub{$phei mul 3 copy sub @tp pop}for
+pop pop}for}bd/@pf{@gs $ctm setmatrix $pm concat
+@stb @gs ColorSeparationMode 0 eq{1 setgray eofill}{
+$o 0 0 0 0 0 (Black) @spc{eofill}if}ifelse
+@gr eoclip Bburx Bbury $pm itransform/$tury xd/$turx xd
+Bbllx Bblly $pm itransform/$tlly xd/$tllx xd
+/$wid $turx $tllx sub def/$hei $tury $tlly sub def
+$wid 0 gt $hei 0 gt and{$pn cvlit load aload pop
+/$pd xd 3 -1 roll sub/$phei xd exch sub/$pwid xd
+/$tlx $wid $pwid div ceiling 1 add def/$tly $hei $phei div ceiling 1 add def
+$psx 0 eq{@tv}{@th}ifelse}if @gr @np}bd/@dlt{ColorSeparationMode 0 eq{
+/$dc $toc $tot mul $frc $frt mul dup/$c xd sub $fst 1 sub div def
+/$dm $tom $tot mul $frm $frt mul dup/$m xd sub $fst 1 sub div def
+/$dy $toy $tot mul $fry $frt mul dup/$y xd sub $fst 1 sub div def
+/$dk $tok $tot mul $frk $frt mul dup/$k xd sub $fst 1 sub div def
+true}{$o $frc $frm $fry $frk $frt $frn @spc
+dup{/$frk 1 currentgray sub def}{/$frk 0 def}ifelse
+$o $toc $tom $toy $tok $tot $ton @spc dup{/$tok 1 currentgray sub def}
+{/$tok 0 def}ifelse or dup{/$c 0 def/$m 0 def/$y 0 def/$k $frk def
+/$dc 0 def/$dm 0 def/$dy 0 def/$dk $tok $frk sub $fst 1 sub div def}if
+}ifelse}bd/@ftl{1 index 4 index sub dup $pad mul dup/$pdw xd
+2 mul sub $fst div/$wid xd 2 index sub/$hei xd
+pop translate $c $m $y $k 4 copy ColorSeparationMode 0 ne
+{1 exch sub setgray pop pop pop}{setcmykcolor}ifelse
+0 0 moveto 0 $hei lineto $pdw $hei lineto $pdw 0 lineto 0 0 lineto fill
+$pdw 0 translate $fst{4 copy ColorSeparationMode 0 ne
+{1 exch sub setgray pop pop pop}{setcmykcolor}ifelse
+0 0 moveto 0 $hei lineto $wid $hei lineto $wid 0 lineto 0 0 lineto fill
+$wid 0 translate $dk add 4 1 roll $dy add 4 1 roll
+$dm add 4 1 roll $dc add 4 1 roll}repeat $dk sub 4 1 roll
+$dy sub 4 1 roll $dm sub 4 1 roll $dc sub 4 1 roll
+ColorSeparationMode 0 ne{1 exch sub setgray pop pop pop}
+{setcmykcolor}ifelse 0 0 moveto 0 $hei lineto $pdw $hei lineto $pdw 0 lineto 0 0 lineto fill
+}bd/@ftr{1 index 4 index sub dup $rox mul/$row xd
+2 div 1 index 4 index sub dup $roy mul/$roh xd
+2 div 2 copy dup mul exch dup mul add sqrt
+$row dup mul $roh dup mul add sqrt add dup/$hei xd $fst div/$wid xd
+4 index add $roh add exch 5 index add $row add
+exch translate pop pop pop pop currentflat 5 mul setflat
+$c $m $y $k 4 copy ColorSeparationMode 0 ne
+{1 exch sub setgray pop pop pop}{setcmykcolor}ifelse
+$wid 0 moveto 0 0 $hei 0 360 arc fill 1.0 $pad 2 mul sub dup scale
+$fst{4 copy ColorSeparationMode 0 ne{1 exch sub setgray pop pop pop}
+{setcmykcolor}ifelse $wid 0 moveto 0 0 $hei 0 360 arc fill
+/$hei $hei $wid sub def $dk add 4 1 roll $dy add 4 1 roll
+$dm add 4 1 roll $dc add 4 1 roll}repeat pop pop pop pop}bd
+/@ff{@gs @dlt{$ctm setmatrix eoclip newpath Bbllx Bblly moveto
+Bbllx Bbury lineto Bburx Bbury lineto Bburx Bblly lineto
+$fan rotate pathbbox newpath $fty 1 eq{@ftr}{@ftl}ifelse}if
+@gr @np}bd/@Pf{@sv ColorSeparationMode 0 eq $ink 3 eq or{$ctm setmatrix
+72 1000 div dup matrix scale dup concat dup Bburx exch Bbury exch itransform
+ceiling cvi/Bbury xd ceiling cvi/Bburx xd Bbllx exch Bblly exch itransform
+floor cvi/Bblly xd floor cvi/Bbllx xd $Prm aload pop
+$Psn load exec}{1 setgray eofill}ifelse @rs
+@np}bd/@ftx{{(0) dup 3 -1 roll 0 exch put
+@gs true charpath currentpoint $ctm setmatrix
+@@txt @gr @np moveto $tr 0 rmoveto}forall pop}bd
+/@sm{/$ctm $ctm currentmatrix def}bd/@lorg{$lx $ly moveto
+/$ly $ly $le sub def}bd/@ft{matrix currentmatrix 3 1 roll
+$sdf{$scf $sca $scp @ss}if $fil 1 eq{/@@txt/@pf ld @ftx}{$fil 2 eq
+{/@@txt/@ff ld @ftx}{$fil 3 eq{/@@txt/@Pf ld @ftx}{@scc
+{dup $tr exch 0 exch ashow}if pop pop}ifelse}ifelse}ifelse
+$sdf{$dsf $dsa $dsp @ss}if setmatrix}bd/@st{
+matrix currentmatrix 3 1 roll $SDF{$SCF $SCA $SCP @ss}if
+@SCC{{(0) dup 3 -1 roll 0 exch put @gs true charpath currentpoint
+$ctm setmatrix $ptm concat stroke @gr moveto $tr 0 rmoveto}forall
+pop}{pop pop}ifelse $SDF{$dsf $dsa $dsp @ss}if
+setmatrix}bd/@pt{dup length exch}bd/@te{@pt
+@lorg @ft cleartomark [}bd/@tr{@pt @lorg @st cleartomark [}bd
+/@ta{@pt @lorg 2 copy @gs @ft @gr @st cleartomark [}bd
+/@t@a{@pt @lorg 2 copy @gs @st @gr @ft cleartomark [}bd
+/g{1 exch sub/$k xd/$c 0 def/$m 0 def/$y 0 def/$t 1 def/$n _ def/$fil 0 def
+}bd/G{1 exch sub/$K xd/$C 0 def/$M 0 def/$Y 0 def/$T 1 def/$N _ def}bd
+/k{/$k xd/$y xd/$m xd/$c xd/$t 1 def/$n _ def/$fil 0 def}bd
+/K{/$K xd/$Y xd/$M xd/$C xd/$T 1 def/$N _ def}bd
+/x{1 exch sub/$t xd/$n xd/$k xd/$y xd/$m xd/$c xd/$fil 0 def}bd
+/X{1 exch sub/$T xd/$N xd/$K xd/$Y xd/$M xd/$C xd}bd
+/d/setdash ld/i{dup 0 ne{setflat}{pop}ifelse}bd
+/j/setlinejoin ld/J/setlinecap ld/M/setmiterlimit ld
+/w/setlinewidth ld/O{/$o xd}bd/R{/$O xd}bd
+/c/curveto ld/C/c ld/v{4 -2 roll 2 copy 6 -2 roll curveto}bd
+/V/v ld/y{2 copy curveto}bd/Y/y ld/l/lineto ld
+/L/l ld/m/moveto ld/n/newpath ld/N/newpath ld
+/F{matrix currentmatrix $sdf{$scf $sca $scp @ss}if
+$fil 1 eq{@pf}{$fil 2 eq{@ff}{$fil 3 eq{@Pf}{@scc{eofill}{@np}ifelse
+}ifelse}ifelse}ifelse $sdf{$dsf $dsa $dsp @ss}if
+setmatrix}bd/f{@cp F}bd/S{matrix currentmatrix
+$ctm setmatrix $SDF{$SCF $SCA $SCP @ss}if @SCC{$skm currentmatrix
+$ptm concat stroke setmatrix}{@np}ifelse $SDF{$dsf $dsa $dsp @ss}if
+setmatrix}bd/s{@cp S}bd/B{@gs F @gr S}bd/b{@cp B}bd
+/W{eoclip}bd/p{/$pm xd 7{pop}repeat/$pyf xd/$pxf xd
+/$pn xd/$fil 1 def}bd/P{11{pop}repeat}bd/z{/$al xd
+/$tr xd/$le xd exch findfont exch scalefont setfont}bd
+/Z{dup type 0 type eq{/$bDir xd}if findfont
+dup maxlength 1 add dict exch dup{1 index/FID ne{3 index
+3 1 roll put}{pop pop}ifelse}forall pop dup dup/Encoding get
+256 array copy dup/$fe xd/Encoding exch put
+dup/Fontname 3 index put 3 -1 roll dup length 0 ne{0 exch{
+dup type 0 type eq{exch pop}{$fe exch 2 index exch put
+1 add}ifelse}forall pop}if definefont pop}bd
+/e{@sm concat [/t{@te}def}bd/r{@sm concat [/t{@tr}def}bd
+/o{@sm concat [/t{pop}def}bd/a{@sm concat [/t{@ta}def}bd
+/t{@te}def/T{cleartomark @np/$lx 0 def/$ly 0 def
+$ctm setmatrix/$ttm matrix def}bd/u{}bd/U{}bd
+/A{pop}bd/H{/$h true def}bd/h{@cp H}bd/q/@gs ld
+/Q/@gr ld/E{5 array astore exch cvlit exch def}bd
+/`{}bd/~{}bd/@{}bd/&{}bd/CorelDrawRencodeVect [
+16#80/grave/circumflex/tilde/dotlessi/florin/quotedblleft/quotedblright/guilsinglleft
+16#88/guilsinglright/fi/fl/dagger/daggerdbl/endash/periodcentered/breve
+16#90/quotedblbase/ellipsis/perthousand/trademark/Pt/fractionbar
+16#98/divide 16#a1/exclamdown/cent/sterling/currency/yen/bar/section
+16#a8/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/emdash/registered/overbar
+16#b0/ring/plusminus/twosuperior/threesuperior/acute/mu/paragraph/bullet
+16#b8/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown
+16#c0/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
+16#c8/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
+16#d0/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/OE
+16#d8/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
+16#e0/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
+16#e8/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
+16#f0/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/oe
+16#f8/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis
+] def/@cc{currentfile $dat readhexstring pop}bd
+/@ii{concat 3 index 3 index m 3 index 1 index l
+2 copy l 1 index 3 index l 3 index 3 index l
+clip pop pop pop pop}bd/@E{/Bbury xd/Bburx xd
+/Bblly xd/Bbllx xd}bd/@c{@cp}bd/@p{/$fil 1 def
+/$pm xd/$psy xd/$psx xd/$pyf xd/$pxf xd/$pn xd}bd
+/@P{/$fil 3 def/$Psn xd array astore/$Prm xd}bd
+/@k{/$fil 2 def/$roy xd/$rox xd/$pad xd/$fty xd/$fan xd
+$fty 1 eq{/$fan 0 def}if/$tok xd/$toy xd/$tom xd/$toc xd
+/$frk xd/$fry xd/$frm xd/$frc xd/$frn _ def/$frt 1 def/$ton _ def/$tot 1 def
+}bd/@x{/$fil 2 def/$roy xd/$rox xd/$pad xd
+/$fty xd/$fan xd 1 exch sub/$tot xd/$ton xd/$tok xd/$toy xd/$tom xd/$toc xd
+1 exch sub/$frt xd/$frn xd/$frk xd/$fry xd/$frm xd/$frc xd}bd
+/@i{@sm @gs @ii 5 index 1 ne{@gs 1 g F @gr}if
+1 eq 5 index 1 eq and{@gs $ctm setmatrix F @gr}if
+@np/$ury xd/$urx xd/$lly xd/$llx xd/$bts xd
+/$hei xd/$wid xd/$dat $wid $bts mul 8 div ceiling cvi string def
+$bts 1 eq{@SCC/$frg xd}{1 G @SCC/$frg xd}ifelse
+$frg{$SDF{$SCF $SCA $SCP @ss}if $llx $lly translate
+$urx $llx sub $ury $lly sub scale $wid $hei abs
+$bts 1 eq{false}{$bts}ifelse [ $wid 0 0 $hei neg 0
+$hei 0 gt{$hei}{0}ifelse]/@cc load $bts 1 eq{imagemask}{image}ifelse
+$SDF{$dsf $dsa $dsp @ss}if}{$hei{@cc pop}repeat}ifelse
+@gr $ctm setmatrix}def/@M {@sv}bd/@N{/@cc{}def
+12 -1 roll neg 12 1 roll @i @rs}bd/@I{@sm @gs
+@ii @np/$ury xd/$urx xd/$lly xd/$llx xd/$ncl xd
+/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul $ncl mul 8 div ceiling cvi string def
+$llx $lly translate $urx $llx sub $ury $lly sub scale
+$wid $hei $bts [ $wid 0 0 $hei neg 0 $hei]/@cc load
+false $ncl colorimage @gr $ctm setmatrix}bd
+/@t{/$lx 0 def/$ly 0 def/$stm $stm currentmatrix def
+3 1 roll translate $ttm concat 1 exch t $stm setmatrix}def
+/@n{/$ttm exch matrix rotate def}bd/@z{ exch findfont exch scalefont setfont
+}bd/@s{}bd/@l{}bd/@B{@gs S @gr F}bd/@b{@cp @B}bd
+/@a{@sm concat [/t{@t@a}def}bd/@w{5 2 roll dup/$pan xd
+matrix rotate/$ptm xd matrix scale $ptm dup concatmatrix/$ptm xd
+1 eq{$ptm exch dup concatmatrix/$ptm xd}{pop}ifelse
+1 w}bd/@g{1 eq dup/$sdf xd{/$scp xd/$sca xd
+/$scf xd}if}bd/@G{1 eq dup/$SDF xd{/$SCP xd
+/$SCA xd/$SCF xd}if}bd/@D{3 copy @ss/$dsp xd
+/$dsa xd/$dsf xd}bd/@j{@sv @np}bind def/@J{@rs}bind def
+/@sep{/ColorSeparationMode where{pop}{/ColorSeparationMode 0 def
+/CurrentInkName (Composite) def}ifelse ColorSeparationMode 0 eq
+{/CurrentInkName (Composite) def}if/CurrentInkName where{pop}{
+/CurrentInkName (Composite) def}ifelse CurrentInkName (Composite) eq{/$ink -1 def}
+{CurrentInkName (Cyan) eq{/$ink 0 def} {CurrentInkName (Magenta) eq{/$ink 1 def}
+{CurrentInkName (Yellow) eq{/$ink 2 def} {CurrentInkName (Black) eq{/$ink 3 def}
+{/$ink 4 def}ifelse}ifelse}ifelse}ifelse}ifelse}bd
+@sep/@whi{@gs -72000 dup moveto -72000 72000 lineto
+72000 dup lineto 72000 -72000 lineto closepath 1 setgray fill
+@gr}bd/@neg{ [{1 exch sub}/exec cvx currenttransfer/exec cvx] cvx settransfer
+@whi}bd/@reg{[] 0 d 0 setgray .3 setlinewidth
+2 copy 5.4 0 360 arc closepath 2 copy moveto 9 0 rlineto
+2 copy moveto -9 0 rlineto 2 copy moveto 0 9 rlineto
+moveto 0 -9 rlineto stroke}bd/leftbracket{(\050)}def
+/rightbracket{(\051)}def
+
+%%EndProlog
+%%BeginSetup
+11.4737 setmiterlimit
+1.00 setflat
+/$fst 128 def
+
+%%EndSetup
+@sv
+/$ctm matrix currentmatrix def
+u
+%%Note: Object
+45.22 528.19 78.98 558.14 @E
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+1.01 1.01 0.00 [1.00000 0.00000 0.00000 1.00000 0.00000 0.00000] 0 @w
+%%CURV 106
+73.30 539.78 m
+73.08 538.42 72.22 537.26 71.78 536.33 C
+72.79 534.67 73.73 531.43 74.81 530.64 C
+74.59 530.64 77.04 528.84 73.87 529.06 C
+73.08 529.34 73.08 530.93 70.20 533.81 C
+69.70 533.74 70.56 530.57 71.50 529.63 c
+73.15 528.19 70.27 528.55 70.13 528.62 C
+68.98 529.34 68.62 534.60 67.03 536.26 c
+66.24 537.19 65.16 536.98 64.30 536.90 C
+63.22 536.62 60.62 537.19 60.55 534.02 C
+60.62 532.66 62.14 530.21 62.86 529.78 c
+65.30 528.41 62.06 528.34 61.70 528.77 C
+61.13 529.34 60.19 530.64 59.26 531.65 C
+57.74 532.44 56.38 533.66 56.02 534.96 C
+54.94 534.74 53.86 534.17 53.64 533.23 C
+53.42 532.22 53.86 531.58 54.86 530.14 C
+56.02 529.85 56.38 529.27 56.02 528.98 c
+55.87 528.84 53.71 528.62 53.57 528.91 C
+52.70 529.49 51.70 531.86 51.19 533.16 c
+50.90 533.88 49.97 535.82 51.55 537.77 C
+51.98 538.49 51.91 539.86 51.77 540.65 c
+51.55 541.94 51.55 542.74 52.42 544.46 C
+49.75 546.77 45.22 551.23 49.61 557.14 C
+50.11 557.64 51.55 558.14 50.76 556.27 C
+49.82 553.68 46.66 551.45 53.42 546.19 C
+54.50 546.91 58.97 546.48 60.48 546.19 c
+64.66 545.33 65.52 545.33 68.40 546.05 C
+68.76 546.19 68.83 547.99 70.34 549.22 C
+70.06 550.15 72.00 551.45 72.22 552.53 C
+72.65 553.39 73.66 550.73 73.66 550.66 C
+73.58 551.23 74.66 552.31 74.81 552.96 C
+75.74 553.25 75.10 550.94 75.89 549.50 c
+76.32 548.93 76.68 549.07 77.11 547.70 C
+77.47 546.34 78.98 545.18 76.54 543.89 c
+75.17 543.17 74.59 543.31 73.58 542.88 C
+73.58 542.23 73.51 540.79 73.30 539.78 c
+@c
+S
+U
+@rs
+%%Trailer
+ end
diff --git a/macros/latex-dev/required/graphics/changes.txt b/macros/latex-dev/required/graphics/changes.txt
new file mode 100644
index 0000000000..d059d7958a
--- /dev/null
+++ b/macros/latex-dev/required/graphics/changes.txt
@@ -0,0 +1,951 @@
+This file lists changes to the LaTeX2e files in reverse chronological order.
+It is provided for convenience only. It therefore makes no claims to
+completeness or accuracy and it contains some references to files that
+are not part of the distribution.
+=======================================================================
+
+2019-07-01 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * graphics.dtx (subsection{Graphics Inclusion}):
+ Support UTF-8 and space in graphic files.
+
+2017-06-25 Joseph Wright <latex-bugs@latex-project.org>
+
+ * New decodearray key, adopted from older pdftex.def
+
+2017-05-31 David Carlisle, Joseph Wright <latex-bugs@latex-project.org>
+
+ * graphics.dtx: Generalize bounding box reader for use in other formats than EPS
+ * graphicsx.dtx: Additional options, moved from pdftex.def
+
+
+2017-04-14 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: modify \Gscale@box for math mode usage
+ https://github.com/latex3/graphics-def/issues/6
+
+2017-03-17 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: add \leavevmode to \includegraphics
+ so that \everypar is cleared. (The \leavevmode in \Gin@setfile is
+ too late for this use, but has been left for compatibility.)
+
+2016-12-23 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: fix the a.ps example file to match the Bounding box
+ change from 2014 (Rolf Niepraschk)
+
+2016-11-18 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: Updates to drivers section, and add a note about xcolor.
+
+2016-10-09 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: Avoid arithmetic overflow on very small lengths
+ eg 5sp/2sp https://tex.stackexchange.com/q/328825
+
+2016-08-11 David Carlisle <latex-bugs@latex-project.org>
+
+ * rotating.dtx: Fix name of examples file reference in the
+ documentation (rotex.tex not examples.tex)
+
+2016-07-10 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics-drivers.ins: stop generating dvips.def
+ (moved to graphics-def)
+
+2016-06-17 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: guards for contributed packages and plain TeX.
+
+2016-06-02 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx, color.dtx, drivers.dtx: add pagesize special support to dvips
+ option to match pdftex behaviour and add setpagesize and
+ nosetpagesize options to color and graphics packages to enable or
+ disable this feature for all drivers.
+
+2016-05-22 David Carlisle <latex-bugs@latex-project.org>
+
+ * rotating.dtx: add from rotating distribution
+ * rotex.tex: add from rotating distribution (was example.tex}
+ * cat.eps: add from rotating distribution
+ * grfguide.tex: list the rotating package.
+
+2016-05-09 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx, color.dtx: add dvisvgm option (Till Tantau)
+
+2016-01-04 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: dvips can deal natively with compressed eps
+ (was in texlive's graphics.cfg)
+
+2016-01-03 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx, color.dtx: add luatex option. (luatex.def to be
+ distributed separately.)
+
+ * trig.dtx: make pre-calculated trig values expand to digits
+ rather than use \chardef
+
+2015-12-30 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: dvips can deal natively with compressed eps
+ (was in texlive's graphics.cfg)
+
+2015-04-02 Joseph Wright <latex-team@latex-project.org>
+
+ * Update CTAN link in README
+
+2015-03-27 David Carlisle <latex-bugs@@latex-project.org>
+
+ * Updating copyright notices etc
+
+2014-11-07 Joseph Wright <latex-bugs@latex-project.org>
+
+ * Rename 00readme.txt to README (named README.txt in the development
+ repository)
+
+2014-10-28 <Frank.Mittelbach@latex-project.org>
+
+ * drivers.dtx, graphics.dtx, graphicx.dtx, keyval.dtx, trig.dtx:
+ Fixed typos in documentation found by Karl Berry.
+
+2014-10-14 <Frank.Mittelbach@latex-project.org>
+
+ * graphics.dtx: Fixed typo in error message.
+
+2014-05-08 David Carlisle <david.carlisle@latex-project.org>
+
+ * keyval.dtx: Revert change to {} parsing.
+
+
+2014-04-26 David Carlisle <david.carlisle@latex-project.org>
+
+ * grfguide.tex: Changes to allow generation of grfguide.pdf via
+ pdflatex: include a.pdf in a filecontents environment and adjust
+ examples to use a modified bounding box starting at 0 0 rather
+ than 100 100.
+
+
+2014-04-25 David Carlisle <david.carlisle@latex-project.org>
+
+ * showkeys.dtx: \leavemode and \long added for
+ graphics/1521, graphics/4296
+
+ * keyval.dtx: add \long on internal parsing macros to allow \par
+ in values, Only strip one {} group not two from values.
+ graphics/3446
+
+2014-04-23 David Carlisle <david.carlisle@latex-project.org>
+
+ * color.dtx: Add \nopagecolor, graphics/3873
+
+ * drivers.dtx: Add \nopagecolor, graphics/3873
+
+2006-02-20 Morten Hoegholm <latex-bugs@latex-project.org>
+
+ * graphics.dtx: Added demo option in graphics.
+
+2005-11-14 Morten Hoegholm <latex-bugs@latex-project.org>
+
+ * 00readme.txt: Updated to reflect the changes.
+
+ * color.dtx: Added support for dvipdfmx and XeTeX.
+
+ * Makefile: Remove pstcol and add graphics-drivers.ins.
+
+ * graphics-drivers.ins: New file for installation of driver files.
+
+ * grfguide.tex: Updated documentation to reflect changes in the
+ distribution of driver files. Added dvipdfmx and XeTeX to list of
+ options.
+
+ * graphics.ins: Removed pstcol (pr/3735) and driver files
+ installation.
+
+ * graphics.dtx: Added support for dvipdfmx and XeTeX.
+
+2004-10-21 Rainer Schoepf <latex-bugs@latex-project.org>
+
+ * grfguide.pdf: Added creation of this file, from grfguide.ps.
+
+2001-07-07 Chris Rowley <latex-bugs@latex-project.org>
+
+ * graphics.dtx:
+
+ Made \rotatebox long (not previously done for graphics/2908)
+
+2001-06-20 Chris Rowley <latex-bugs@latex-project.org>
+
+ * pstcol.dtx:
+
+ Added redefinitions for PSTricks (graphics/3233)
+
+2001-06-07 Chris Rowley <latex-bugs@latex-project.org>
+
+ * graphics.dtx:
+
+ Extended documentation of \DeclareGraphicsExtensions
+ (graphics/3228}
+
+1999-02-17 David Carlisle <latex-bugs@latex-project.org>
+
+ * dvipdfm.def: lppl (Agreed with Mark Wicks)
+
+1999-02-16 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: lppl
+
+ * graphics.ins: lppl
+
+ * epsfig.dtx: lppl
+
+ * textures.def: lppl (Agreed with Art Ogawa)
+
+ * drivers.dtx: lppl
+
+ * lscape.dtx: lppl
+
+ * pstcol.dtx: lppl
+
+ * color.dtx: lppl
+
+ * graphicx.dtx: lppl
+
+ * 00readme.txt: lppl
+
+ * graphics.dtx: lppl
+
+1999-01-13 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: dvipdfm and unknownkeysallowed options.
+
+ * drivers.dtx: documentation corrections.
+
+ * color.dtx: dvipdfm option
+
+ * graphics.dtx: dvipdfm option
+
+ * dvipdfm.def: (from Sebastian) For dvipdfm dvi->pdf driver.
+
+1999-01-10 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: don't generate .def files for unsupported
+ drivers
+
+ * graphicx.dtx: new option (passed to graphicx)
+
+ * keyval.dtx: new options to not generate error on unknown
+ keys.
+
+1999-01-08 David Carlisle <latex-bugs@latex-project.org>
+
+ * pdftex.def: new version (from https://www.tug.org)
+
+1999-01-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: \Gscale@box@dd(dd) made long. graphics/2908
+ \@makeother\- added. graphics/2846
+
+1999-01-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: \Gscale@box@dd(dd) made long. graphics/2908
+ \@makeother\- added. graphics/2846
+
+1999-01-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: \Gscale@box@dd(dd) made long. graphics/2908
+ \@makeother\- added. graphics/2846
+
+1998-10-30 David Carlisle <latex-bugs@latex-project.org>
+
+ * vtex.def: new version from micropress
+
+1998-06-05 David Carlisle <latex-bugs@latex-project.org>
+
+ * pdftex.def: update for more recent pdftex (from Sebastian).
+
+ * keyval.dtx: make keyval safe if \@tempc is an \if (As
+ happens if you load amsmath and color packages, in that order)
+
+1998-05-27 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: vtex option
+
+ * color.dtx: vtex option
+
+ * graphics.dtx: vtex option
+
+ * vtex.def: Add file (supplied by MicroPress, Inc).
+
+1998-05-03 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: update of dvipsone.def from Berthold Horn.
+
+1997-11-10 David Carlisle <latex-bugs@latex-project.org>
+
+ * trig.dtx: Remove an ancient email address of mine.
+
+ * keyval.dtx: CHANGE so that # may appear in <value>s without
+ needing to be doubled. NOTE This will require a change if
+ anybody has used the comand= key in graphicx, the only key
+ currently distributed likely to require # in its argument. A
+ setting such as `command = uncompress ##1' now will need
+ changing to just use one #. Also fix brace handling so a
+ value of {abc}{xyz} is correctly handled. (Old version passed
+ abc{xyz}). Remove an ancient email address of mine.
+
+1997-09-09 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: Comment out generation of oztex.def.
+
+ * graphics.dtx: [oztex] == [dvips]
+
+ * color.dtx: [oztex] == [dvips]
+
+ * drivers.dtx: merge oztex and dvips support (for oztex 3.x).
+
+1997-09-02 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: allow TAB in BoundingBox
+ comments. graphics/2587
+
+1997-06-17 David Carlisle <latex-bugs@latex-project.org>
+
+ * textures.def: New one from Arthur Ogawa.
+
+1997-06-09 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Initialise ext= key to empty, so type= may be
+ used without specifying ext, for Sebastian.
+
+1997-06-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * Makefile: pdftex.def
+
+ * grfguide.tex: pdftex option
+
+ * 00readme.txt: pdftex.tex driver file
+
+ * color.dtx: pdftex option
+
+ * graphics.dtx: pdftex option
+
+ * pdftex.def: add this file for Han The Thanh's TeX variant.
+
+1997-02-20 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: dvipdf missed out. graphics/2420
+
+1997-01-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Make errors just info messages to the log in the
+ monocrome option. graphics/2350
+
+1996-12-12 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: new dvipsone eps code (Code from Berthold Horn)
+
+1996-12-09 David Carlisle <latex-bugs@latex-project.org>
+
+ * 00readme.txt: Remove grfguide.ps (it's in latex/doc on ctan)
+
+ * Makefile: Remove grfguide.ps (it's in latex/doc on ctan)
+
+ * grfguide.tex: Assorted improvements.
+
+1996-11-18 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Minor changes to dvipdf.def (Sergey Lesenko).
+
+1996-11-05 David Carlisle <latex-bugs@latex-project.org>
+
+ * epsfig.dtx: Support active ! for graphics/2302
+
+1996-11-02 David Carlisle <latex-bugs@latex-project.org>
+
+ * 00readme.txt: add old docstrip warning.
+
+1996-10-31 David Carlisle <latex-bugs@latex-project.org>
+
+ * textures.def: add pstricks compatibity code from original
+ textures.def
+
+ * drivers.dtx: tcidvi code supporting viewport/trim/clip.
+
+ * graphicx.dtx: viewport/trim code now saves original bb
+ coords.
+
+ * color.dtx: add dvipdf
+
+ * graphics.dtx: add dvipdf
+
+ * drivers.dtx: add dvipdf (after code from Sergey Lesenko).
+
+1996-10-30 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: add truetex and tcidvi drivers. Add literal
+ postscript specials to drivers that support it. Add RGB
+ (0-255 integer rgb) model to all drivers.
+
+ * graphics.ins: add truetex (Kinch) and tcidvi (Scientific
+ Word) drivers.
+
+1996-10-29 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: new style for docstrip 2.4.
+
+ * grfguide.tex: Describe new options, improve descriptions of
+ \graphicspath (for graphics/2294) and \DeclareGraphicsRule.
+ Describe how to add new driver options in a cfg file.
+
+ * graphicx.dtx: Add hiresbb key to \includegraphics.
+
+ * graphics.dtx: Add tcidvi and truetex options, comment out
+ some old drivers. Add hiresbb package option for
+ %%HiResBoundingBox.
+
+ * color.dtx: add missing \colors@false to monochrome option.
+ Add tcidvi and truetex drivers. Comment out some old drivers.
+
+1996-10-28 David Carlisle <latex-bugs@latex-project.org>
+
+ * pstcol.dtx: clean up documentation a bit.
+
+ * Makefile: Add SCRIPTDIR
+
+1996-09-16 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: add debugshow option, mainly so I can go
+ \usepackage[debugshow]{graphics,color} without color
+ complaining
+
+ * graphics.dtx: stop infinite loop if requested size is zero
+ graphics/2259.
+
+1996-08-05 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Missing % for /2244
+
+1996-06-11 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: pctex32
+
+1996-06-10 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: use \@gtempa not \g@tempa graphics/2090
+
+ * graphicx.dtx: Fix misplaced = in changes
+ entry. graphics/2034
+
+1996-05-29 David Carlisle <latex-bugs@latex-project.org>
+
+ * 00readme.txt: Tidy up.
+
+ * graphicx.dtx: Declare it version 1 (no other change).
+
+ * graphics.dtx: Declare it version 1 (no other change).
+
+ * color.dtx: Declare it version 1 (no other change).
+
+ * drivers.dtx: Change arithmetic in dvips' \Ginclude@eps (and
+ the identical code for pctex32) to avoid overflow on very
+ large posters. (Andreas Schott)
+
+1996-04-11 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Add pctex32 driver file based on code from pti.
+ Add support for wmf in Y&Y's dviwindo.
+
+ * epsfig.dtx: allow space after [ in \epsfbox bb argument.
+ add `silent' key to \epsfig (ignored).
+
+1996-02-20 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.ps: Bad dvips configuration forcing A4 paper fixed.
+
+ * textures.def: \gread -> \gread@ typo fixed.
+
+ * graphics.dtx: \gread -> \gread@ typo fixed.
+
+ * graphics.ins: dvi2ps dvitops dvilaser dvialw added back to
+ the .ins file, so the code gets extracted
+
+1995-12-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Remove \showhyphens and \underbar Now all
+ commands are colour safe already in the kernel. CHANGE Add
+ \leavevmode to \textcolor so that it works out right at the
+ start of a \parbox[t] (and other places)
+
+ * grfguide.tex: Bring up to date.
+
+1995-12-06 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Use \Gin@exclamation to save active !
+ problems. Rename key to keepaspectratio.
+
+ * graphics.dtx: Add \Gin@exclamation for French graphicx
+ mainly
+
+1995-12-04 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: New dviwin code after correspondence with
+ Hippocrates Sendoukas.
+
+ * graphics.ins: remove textures.def generation
+
+ * textures.def: New version, not generated from drivers.dtx.
+ Code supplied by Arthur Ogawa.
+
+1995-11-10 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: New version for concurrent docstrip
+
+ * graphicx.dtx: Support height= and width= better for bitmap
+ formats where natural size not known to LaTeX, but known to
+ the driver.
+
+ * graphics.dtx: Support height= and width= better for bitmap
+ formats where natural size not known to LaTeX, but known to
+ the driver.
+
+1995-10-31 David Carlisle <latex-bugs@latex-project.org>
+
+ * lscape.dtx: \StopEventually{\end{landscape}} for
+ graphics/1744
+
+1995-09-29 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: Support isoscale code in \Gscale@box@dddd
+
+ * graphicx.dtx: Support new isoscale key for \includegraphics.
+
+1995-09-28 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Add origin key for \includegraphics rotation.
+
+1995-09-27 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Modify \Gin@esetsize to support calc package
+
+ * graphics.dtx: Modify \Gscale@div to support calc package
+
+1995-09-22 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Fix typo in natheight and natwidth keys.
+
+ * drivers.dtx: Fix bitmap support in dvips for graphics/1879
+
+1995-09-21 David Carlisle <latex-bugs@latex-project.org>
+
+ * keyval.dtx: Documentation changes for graphics/1698
+
+1995-09-18 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: (Berthold Horn) Fix up clipping code in Y&Y
+ drivers.
+
+1995-09-11 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Fix up named colour support for dvipsone.
+
+1995-09-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Merge dvipsone and dviwindo options.
+
+ * grfguide.tex: Document the totalheight key which got omitted
+ before.
+
+ * graphics.ins: Remove generation of dviwindo.def
+
+ * drivers.dtx: Fix bounding box spec in dvipsone (should be in
+ sp) Remove generation of dviwindo.def: dviwindo option now
+ uses dvipsone.def
+
+ * graphicx.dtx: Arithmetic in viewport was wrong. (Michel
+ Goossens)
+
+ * graphics.dtx: Merge the two Y&Y options together making
+ dviwindo.def obsolete.
+
+1995-08-11 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex (section{Colour}): Refer to X Window system in
+ the approved manner.
+
+1995-06-26 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Typos fixed in bb.... keys for graphics/1685
+
+1995-06-23 David Carlisle <latex-bugs@latex-project.org>
+
+ * epsfig.dtx: oops. \ifGin@viewport renamed to \ifGin@bbox
+
+1995-06-19 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Add \Gin@PS@raw and \Gin@PS@restored for
+ literal PostScript \specials. (cf \pstVerb and \pstverb)
+
+1995-06-16 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: Modify docstrip options for Y&Y drivers.
+
+ * epsfig.dtx: Remove forcing of dvips option (use graphics.cfg
+ to force the default driver for your site). Modify
+ \ProvidesPackage usage
+
+ * drivers.dtx: Add \AtBeginDvi around `color2' color define
+ \special. Make Y&Y drivers dvipsone and dviwindo use `color2'
+ colour support following mail message from Berthold Horn.
+
+ * color.dtx: Use #1 not ##1 in \DeclareOption, for latex/1557
+
+1995-04-27 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Move \leavevmode earlier in box commands for
+ graphics/1512
+
+1995-04-19 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: Add template generation (commented out).
+
+ * drivers.dtx: Remove \Gin@tobp, not needed now.
+
+1995-04-12 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: Fix mention of obsolete syntax, as reported in
+ latex/1295
+
+1995-04-11 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphicx.dtx: Bounding box changes to match graphics.sty.
+ Add trim viewport and totalheight keys to \includegraphics.
+
+ * graphics.dtx: Start v0.7: \leavevmode positioning. Bounding
+ box cordinates stored as macros (so can use bp) Make more
+ catcodes safe, for binary headers of eps files.
+
+1995-01-03 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: (Chris Hamlin) Spurious #2 deleted in
+ dviwindo.def: \def\c@lor@cmyk@#1#2,#2,#3,#4,#5\@@{%
+
+1994-12-15 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: (Denis Roegel) Extra group to keep bb settings
+ local. (Piet van Oostrum) include `.' in \Gin@ext.
+
+1994-12-12 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Add ln (ln03, ln05 etc) support (untested).
+
+ * graphics.dtx: Add ln (ln03, ln05 etc) support (untested).
+
+1994-11-29 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: New \DeclareGraphicsExtensions description.
+
+ * graphicx.dtx: Modify the type and read keys to work with new
+ graphics.sty.
+
+ * drivers.dtx: Explicitly mention `.' in all file extensions,
+ to work with graphics v0.6.
+
+ * graphics.dtx: Remove Optional argument to
+ \DeclareGraphicsExtensions Remove the notion of a
+ `separator' and now specify extensions as (eg) .eps rather
+ than eps this makes it easier to work with files without
+ extension.
+
+1994-11-22 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: add color@vbox, remove a load of stuff now in the
+ kernel.
+
+1994-11-16 David Carlisle <latex-bugs@latex-project.org>
+
+ * keyval.dtx: Move the <% plain> docstrip commands which were
+ being typeset by mistake (reported by Martin Schroeder)
+
+ * trig.dtx: Move the <% plain> docstrip commands which were
+ being typeset by mistake (reported by Martin Schroeder)
+
+1994-11-08 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Add \color@hbox and \color@endbox
+
+1994-11-04 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.ins: add psprint.def (accidentally omitted)
+
+1994-11-02 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: fix catcodes of ctrl-D and \endlinechar when
+ reading eps files.
+
+1994-10-27 David Carlisle <latex-bugs@latex-project.org>
+
+ * pstcol.dtx: add gradbegin and gradend colours.
+
+1994-10-24 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: Modify support for ! in \resizebox (Old code
+ added to support active ! broke \width etc)
+ \DeclareGraphicsRule Check #3 (not #2) is * (Reported by
+ Arthur Ogawa). Missing \expandafter in \Gin@setfile
+ (Reported by Arthur Ogawa).
+
+ * drivers.dtx: Missing \the in dvitops \special. Reported by
+ Arthur Ogawa.
+
+1994-10-17 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: removed xdvi.def: xdvi now calls
+ dvips,monochrome
+
+1994-10-16 David Carlisle <latex-bugs@latex-project.org>
+
+ * trig.dtx: Changed \@xc to \nin@ty (old name clashed with
+ some other package)
+
+1994-10-14 David Carlisle <latex-bugs@latex-project.org>
+
+ * grfguide.tex: Minor improvements to my English.
+
+1994-10-07 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Removed out of date table. Added new code for
+ pctex drivers submitted by PTI.
+
+1994-10-05 David Carlisle <latex-bugs@latex-project.org>
+
+ * lscape.dtx: converted the old 209 style to dtx form and base
+ on graphics package.
+
+ * drivers.dtx: added hsb colour to drivers that support it.
+
+1994-10-04 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Make \definecolor and \DefineNamedColor give an
+ Info message if the colour was previously defined.
+
+ * drivers.dtx: Add support for bounding box to pctex drivers,
+ remove support for scaling which did not work anyway.
+
+1994-10-03 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Add usenames option.
+
+ * graphics.dtx: Error if no driver specified.
+
+1994-09-29 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Modifications to fit in \DefineNamedColor.
+ textures code redone based on mail from Constantin Kahn (Who
+ owns a Mac which is and advantage when writing code for
+ textures:-)
+
+ * color.dtx (section{Defining Colours}): \DefineNamedColor Add
+ this system, after conversations with Constantin Kahn about
+ the textures support.
+
+1994-09-21 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx (section{Generic PostScript Colour}): Modify
+ textures code, to force trailing .0.
+
+1994-09-19 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: small changes to \pagecolor.
+
+1994-09-15 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Add in pctex drivers from Sebastian.
+
+1994-09-14 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Add fix for footnote bug (should really be in
+ ltfloat/ltoutput)
+
+1994-09-13 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx (subsection{Coloured Boxes} New implementation of
+ \fcolorbox and \colorbox. Now share code.
+
+1994-09-12 David Carlisle <latex-bugs@latex-project.org>
+
+ * trig.dtx: Improve docstrip handling.
+
+ * keyval.dtx: Improve docstrip handling.
+
+ * color.dtx: Re-organise options, as for graphics package.
+
+ * graphics.dtx (subsection{Options}): Re-organise, so that it
+ is more efficient to specify a default option in
+ graphics.cfg.
+
+ * graphicx.dtx: Make \includegraphics check for 2nd optional
+ arg. Use standard `graphics.sty' form if 2nd arg is there.
+
+1994-07-27 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: Add missing 3rd argument to \InputIfFileExists
+
+1994-07-21 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: documentation changes.
+
+1994-07-20 Sebastian Rahtz <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Fix textures graphics inclusion.
+
+1994-07-20 David Carlisle <latex-bugs@latex-project.org>
+
+ * pstcol.sty: Package modifying pstrics colour interface to
+ work with LaTeX colours.
+
+ * graphics.dtx (subsection{Stretching and Scaling}): Support
+ active ! for French.
+
+ * drivers.dtx: extensive changes to cope with the new code in
+ graphics.dtx and color.dtx.
+
+ * graphics.dtx: Add default rule possibility, so eg a PS
+ driver can handle any unknown extension as eps, rather than
+ generate an error.
+
+ * color.dtx: Completely new implementation of the internal
+ colour commands. Conversion from `user syntax' to `special
+ syntax' is now in a separate (driver dependant) command,
+ distinct from the commands to define or use colours.
+
+1994-06-10 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: minor change to error texts. (dated 1994/05/14:-)
+
+ * drivers.dtx: (From Sebastian) fix for dviwin.
+
+1994-05-30 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: Rename egraphics to graphicx.
+
+ * testx.tex: new name to match graphicx.
+
+ * graphicx.dtx: Rename from egraphics (8+3).
+
+ * epsfig.dtx: (From Sebastian) Make epsfig default to [dvips]
+ RequirePackage{graphicx} not egraphics. Remove \wlog as now
+ done by \ProvidesPackage.
+
+1994-05-13 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Remove all support for the test release of
+ LaTeX2e. Add optional argument to \NeedsTeXFormat to show
+ this. Define new versions of the `kernel' colour commands,
+ \color@{begin|end|set}group and \normalcolor. Remove
+ redefinition of tabbing commands, now colour-safe in the
+ kernel.
+
+1994-05-09 David Carlisle <latex-bugs@latex-project.org>
+
+ * test.tex: Remove `times' package from test.tex. (Not part of
+ `base' distribution of LaTeX2e.)
+
+ * color.dtx: improve wording of error messages.
+
+ * drivers.dtx: patch to oztex support from Andrew
+ Trevorrow. (via Sebastian)
+
+1994-05-06 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx (subsection{Options}): notdraft renamed again
+ to final.
+
+ * drivers.dtx: Replace grot@ by Grot@ throughout.
+
+ * egraphics.dtx: Removed weird and incorrect setting of
+ \let\Gin@scalex\@empty and \let\Gin@scaley\@empty that I
+ must have added while asleep:-) Now the earlier correct
+ settings actually take effect.
+
+ * graphics.dtx: Changed the handling of `missing file' errors.
+ If no extension is supplied, each extension in the list is
+ tried until a file is found. A File not found error is
+ generated if this search fails. If an extension is
+ supplied, only a warning is given if the file does not
+ exist. This allows the file to be created `on the fly' eg by
+ extracting the file from a tar or zip archive.
+
+1994-04-29 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Removed rotation from drivers.dtx
+ documentation, so it can be processed at any site.
+
+1994-04-28 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: added PS rules for Mac drivers
+
+ * graphics.dtx: Improve the wording of error messages.
+
+1994-04-21 David Carlisle <latex-bugs@latex-project.org>
+
+ * drivers.dtx: Added missing \ProvidesFile for xdvi and
+ dvitops
+
+1994-04-20 David Carlisle <latex-bugs@latex-project.org>
+
+ * graphics.dtx: initialise \Gin@extensions with
+ \providecommand so that definitions in the .def file are not
+ zapped.
+
+1994-04-18 David Carlisle <latex-bugs@latex-project.org>
+
+ * color.dtx: Stop \normalfont resetting the
+ colour. (\reset@font does still reset the colour. This
+ allows \rm to work as expected. Fix marginpar, so the
+ baseline is correctly aligned.
+
+ * README Create initial change log from comments in the README
+
+1994-04-13 David Carlisle <latex-bugs@latex-project.org>
+
+ * notdraft renamed to nodraft
+
+ * zaprotate zapscale renamed to hiderotate hidescale
+
+ * kludges for graphics and colour to work with Feb 1994
+ release now automatically included (so colfix.sty gone)
+
+1994-03-23 David Carlisle <latex-bugs@latex-project.org>
+
+ * rotatebox now correctly rotates about the left hand side.
+
+ * spurious spaces in \resizebox removed
+
+ * no BoundingBox error message improved
+
+ * zaprotate and zapscale options added (probably bad names)
+
+ * notdraft option added to cancel a global draft option.
+
+ * Graphics files now listed by \listfiles
+
+ * PS drivers now support \current@ps@color
+
+ * colfix.sty put back until next release of LaTeX2e.
+
+1994-03-09 David Carlisle <latex-bugs@latex-project.org>
+
+ * \reflectbox added.
+
+ * \rotatebox* removed
+
+ * The order of the arguments of \includegraphics corrected
+
+ * \includegraphics[lower-l,lower-r][upper-l,upper-r]{file}
+
+ * \definecolor not \newcolor to define colours
+
diff --git a/macros/latex-dev/required/graphics/color.dtx b/macros/latex-dev/required/graphics/color.dtx
new file mode 100644
index 0000000000..d85b78349d
--- /dev/null
+++ b/macros/latex-dev/required/graphics/color.dtx
@@ -0,0 +1,963 @@
+%
+% \iffalse
+%
+%% color.dtx Copyright (C) 1994--1999 David Carlisle
+%% Copyright (C) 2005--2016 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+%<*dtx>
+ \ProvidesFile{color.dtx}
+%</dtx>
+%<package>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+%<package>\ProvidesPackage{color}
+%<driver> \ProvidesFile{color.drv}
+% \fi
+% \ProvidesFile{color.dtx}
+ [2016/07/10 v1.1e Standard LaTeX Color (DPC)]
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\newenvironment{option}[1]{\expandafter\macro\expandafter{%
+ \csname ds@#1\endcsname}}{\endmacro}
+\begin{document}
+ \DocInput{color.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{color.dtx}
+%
+% \title{The \textsf{color} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{D. P. Carlisle}
+% \date{\filedate}
+% \MaintainedByLaTeXTeam{graphics}
+% \maketitle
+%
+%
+%
+% \title{The implementation of the \LaTeX\ Colour interface.}
+%
+% \section{Introduction}
+% This package implements \LaTeX\ support for colour, for those
+% \texttt{dvi} drivers that can produce coloured text.
+%
+% The user level documentation of this package is contained in the
+% document \emph{Packages in the `graphics' bundle} in the file
+% \texttt{grfguide.tex}.
+%
+% \StopEventually{}
+%
+%
+% \section{Options}
+%
+% \changes{v0.2a}{1994/04/13}
+% {TEMP KLUDGE for Feb 94 release of 2e:
+% Add extra groups}
+% \changes{v0.2d}{1994/05/13}
+% {All support for Feb 1994 release removed (so used optional arg
+% of \cs{NeedsTeXFormat}).}
+% \changes{v1.0}{1996/05/29}
+% {Version 1 at last}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% First we save the catcodes of some characters, and set them to
+% fixed values whilst this file is being read.
+% \changes{v0.3b}{1994/09/14}
+% {Save and restore catcodes}
+% \begin{macrocode}
+\edef\Gin@codes{%
+ \catcode`\noexpand\^^A\the\catcode`\^^A\relax
+ \catcode`\noexpand\"\the\catcode`\"\relax
+ \catcode`\noexpand\*\the\catcode`\*\relax
+ \catcode`\noexpand\!\the\catcode`\!\relax
+ \catcode`\noexpand\:\the\catcode`\:\relax}
+\catcode`\^^A=\catcode`\%
+\catcode`\"=12
+\catcode`\*=11
+\catcode`\!=12
+\catcode`\:=12
+% \end{macrocode}
+%
+% \begin{macro}{\Gin@driver}
+% Initialize the macro to hold the driver file name.
+% \begin{macrocode}
+\providecommand\Gin@driver{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@lor@error}
+% \changes{v1.0d}{1997/01/07}
+% {Macro added for graphics/2350}
+% Helper macro for error handling (redefined by the monochrome option
+% to make errors warnings).
+% \begin{macrocode}
+\def\c@lor@error#1{%
+ \@latex@error{Undefined color #1}\@ehd}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{option}{monochrome}
+% The |monochrome| option should be used \emph{in addition}
+% to one of the standard driver options.
+% \changes{v0.3j}{1995/06/16}
+% {Use single hash for latex/1557}
+% \changes{v1.0b}{1996/10/29}
+% {Add \cs{colors@false}}
+% \changes{v1.0d}{1997/01/07}
+% {Add \cs{c@lor@error} for graphics/2350}
+% \begin{macrocode}
+\DeclareOption{monochrome}{%
+ \def\c@lor@error#1{\PackageInfo{color}{Undefined color #1}}%
+ \AtEndOfPackage{%
+ \colors@false
+ \def\set@color{%
+ \c@lor@special\m@ne
+ {color push \current@color}\aftergroup\reset@color}%
+ \def\reset@color{\c@lor@special\m@ne{color pop}}%
+ \def\set@page@color{%
+ \c@lor@special\m@ne{background \current@color}}%
+ \def\define@color#1#2{%
+ \c@lor@special\m@ne{define #1 #2}}}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{debugshow}
+% The |debugshow| option turns on debugging info (perhaps).
+% \changes{v1.0a}{1996/09/16}
+% {debugshow option added}
+% \begin{macrocode}
+\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{setpagesize}
+% \begin{option}{nosetpagesize}
+% The |setpagesize| option requests that the driver option sets the page size.
+% \changes{v1.1d}{2016/06/02}
+% {(no)setpagesize options added}
+% (Whichever option is used, the page size is not set by this package if |\mag|
+% has been changed from its default value.)
+% \begin{macrocode}
+\newif\ifGin@setpagesize\Gin@setpagesizetrue
+\DeclareOption{setpagesize}{\Gin@setpagesizetrue}
+\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% Now the options for supported drivers.
+%
+% \begin{option}{dvips}
+% \begin{option}{xdvi}
+% Tom Rokicki's dvips driver, and the X Windows previewer, xdvi which uses
+% (a subset of) the same |\specials|.
+% \begin{macrocode}
+\DeclareOption{dvips}{\def\Gin@driver{dvips.def}%
+ \def\c@lor@namefile{dvipsnam.def}}
+\DeclareOption{xdvi}{\ExecuteOptions{dvips,monochrome}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{dvipdf}
+% \changes{v1.0c}{1996/10/31}
+% {dvipdf added}
+% Sergey Lesenko's dvipdf driver.
+% \begin{macrocode}
+\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvipdfm}
+% \changes{v1.0h}{1999/01/13}
+% {dvipdfm added}
+% Mark Wick's dvipdfm driver.
+% \begin{macrocode}
+\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvipdfmx}
+% \changes{v1.0j}{2005/11/14}
+% {dvipdfmx added}
+% The driver for the dvipdfmx project.
+% \begin{macrocode}
+\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{pdftex}
+% \changes{v1.0e}{1997/06/07}
+% {pdftex added}
+% Han The Thanh's \TeX\ variant.
+% \begin{macrocode}
+\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{luatex}
+% \changes{v1.1b}{2016/01/03}
+% {luatex added}
+% Lua\TeX\ \TeX\ variant.
+% \begin{macrocode}
+\DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{luatex}
+% \changes{v1.1c}{2016/05/09}
+% {dvisvgm added}
+% dvisvgm driver.
+% \begin{macrocode}
+\DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{xetex}
+% \changes{v1.0j}{2005/11/14}
+% {xetex added}
+% Jonathan Kew's \TeX\ variant.
+% \begin{macrocode}
+\DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvipsone}
+% \begin{option}{dviwindo}
+% \changes{v0.3k}{1995/09/07}
+% {Merge dviwindo and dvipsone options}
+% The drivers of the Y\&Y \TeX\ system.
+% (Which use the same |\specials|).
+% \begin{macrocode}
+\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
+\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{emtex}
+% \begin{option}{dviwin}
+% Freely available drivers for PCs.
+% \begin{macrocode}
+\DeclareOption{emtex}{\def\Gin@driver{emtex.def}}
+\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{oztex}
+% \changes{v1.0f}{1997/09/09}
+% {Merge dvips and oztex options}
+% The Oz\TeX\ system for a Macintosh.
+% Since release 3 of Oz\TeX, merge with dvips back end.
+% \begin{macrocode}
+\DeclareOption{oztex}{\ExecuteOptions{dvips}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{textures}
+% Blue sky's Textures system on a Macintosh.
+% \begin{macrocode}
+\DeclareOption{textures}{\def\Gin@driver{textures.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{pctexps}
+% \begin{option}{pctexwin}
+% \begin{option}{pctexhp}
+% \begin{option}{pctex32}
+% \changes{v1.0b}{1996/10/29}
+% {pctex32 option added}
+% The drivers for PTI's \TeX\ system on PCs.
+% \begin{macrocode}
+\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
+\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}}
+\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}}
+\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{truetex}
+% \begin{option}{tcidvi}
+% \changes{v1.0b}{1996/10/29}
+% {truetex and tcidvi options added}
+% The drivers of the Kinch \TeX\ system on PCs, and its
+% version with extra |\special| handling dll's as shipped with
+% TCI's Scientific Word.
+% \begin{macrocode}
+\DeclareOption{truetex}{\def\Gin@driver{truetex.def}}
+\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{vtex}
+% \changes{v1.0g}{1998/05/27}
+% {vtex option added}
+% V\TeX\ driver.
+% \begin{macrocode}
+\DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvi2ps}
+% \begin{option}{dvialw}
+% \begin{option}{dvilaser}
+% \begin{option}{dvitops}
+% \begin{option}{psprint}
+% \begin{option}{pubps}
+% \begin{option}{ln}
+% \changes{v1.0b}{1996/10/29}
+% {old driver options depreciated}
+% Old, probably obsolete, drivers commented out. See the section
+% on `Driver support' in grfguide to see how to re-enable these
+% options in |color.cfg| if you need them.
+% \begin{macrocode}
+%\DeclareOption{dvi2ps}{\def\Gin@driver{dvi2ps.def}}
+%\DeclareOption{dvialw}{\def\Gin@driver{dvialw.def}}
+%\DeclareOption{dvilaser}{\def\Gin@driver{dvilaser.def}}
+%\DeclareOption{dvitops}{\def\Gin@driver{dvitops.def}}
+%\DeclareOption{psprint}{\def\Gin@driver{psprint.def}}
+%\DeclareOption{pubps}{\def\Gin@driver{pubps.def}}
+%\DeclareOption{ln}{\def\Gin@driver{ln.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+%
+%
+% \begin{option}{dvipsnames}
+% \begin{option}{nodvipsnames}
+% By default the named colour model has no pre-declared names.
+% The |dvipsnames| option predeclares all the names in the colour
+% prologue of dvips. The |dvips| option automatically implies
+% |dvipsnames| unless this choice is overruled with the |nodvipsnames|
+% option. For other drivers, eg |textures| you may use this option to
+% explicitly request that these names be declared.
+% \begin{macrocode}
+\DeclareOption{dvipsnames}{\def\c@lor@namefile{dvipsnam.def}}
+\DeclareOption{nodvipsnames}{\let\c@lor@namefile\relax}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{usenames}
+% The |usenames| option modifies the behaviour of |\DefineNamedColor|
+% So that it declares the same name as a ```user's colour'' for use in
+% a |\color| command, as well as a name in the |named| colour model.
+% The normal behaviour is just to declare the name in the named colour
+% model.
+% \begin{macrocode}
+\let\c@lor@usename\@gobble
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareOption{usenames}{%
+ \def\c@lor@usename#1{%
+ \expandafter\color@named\csname\string\color @#1\endcsname{#1}}}
+% \end{macrocode}
+% \end{option}
+%
+% \section{Using Colours}
+%
+% \subsection{Declarative form}
+%
+% \begin{macro}{\color}
+% |\color{|\emph{declared-colour}|}| switches to the colour
+% \emph{declared-colour}, which must previously have been defined
+% using |\definecolor|. This colour will stay in effect until the end of
+% the current \TeX\ group.
+%
+% |\color[|\emph{model}|]{|\emph{colour-specification}|}| is similar
+% to the above, but uses a colour not declared by |\definecolor|. The
+% allowed \emph{model}'s vary depending on the driver. The syntax of
+% the \emph{colour-specification} argument depends on the model.
+%
+% \changes{v0.3a}{1994/07/20}
+% {Make \cs{color} robust}
+% \begin{macrocode}
+\DeclareRobustCommand\color{%
+ \@ifnextchar[\@undeclaredcolor\@declaredcolor}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@undeclaredcolor}
+% \changes{v0.2c}{1994/05/09}
+% {Improve error messages}
+% \changes{v0.3a}{1994/07/20}
+% {New internal implementation of colour commands}
+% Call the driver-dependent command |\color@|\meta{model} to define
+% |\current@color|, then call |\set@color| to change the current colour
+% accordingly.
+% \begin{macrocode}
+\def\@undeclaredcolor[#1]#2{%
+ \@ifundefined{color@#1}%
+ {\c@lor@error{model `#1'}}%
+ {\csname color@#1\endcsname\current@color{#2}%
+ \set@color}%
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@declaredcolor}%
+% \changes{v0.1c}{1994/04/01}
+% {Add \cs{ignorespaces}}
+% \changes{v0.1e}{1994/05/14}
+% {Minor change to error message}
+% \changes{v0.3a}{1994/07/20}
+% {New internal implementation of colour commands}
+% |\let| |\current@color| to the internal representation of the colour
+% if the colour has been declared, otherwise generate an error.
+% Finally call |\set@color| to effect the colour change.
+% \begin{macrocode}
+\def\@declaredcolor#1{%
+ \@ifundefined{\string\color @#1}%
+ {\c@lor@error{`#1'}}%
+ {\expandafter\let\expandafter\current@color
+ \csname\string\color @#1\endcsname
+ \set@color}%
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Command (Argument) Form}
+%
+% \begin{macro}{\textcolor}
+% |\textcolor{|\emph{declared-colour}|}{|\emph{text}|}| and
+% |\textcolor[|\emph{model}|]{|\emph{colour-spec}|}{|\emph{text}|}|
+% are just alternative syntax for |\color|, in
+% which the groups are added implicitly. Thus \emph{text} appears in the
+% specified colour, but then the colour reverts to its previous value.
+% The naming is by analogy with |\textrm| (as opposed to |\rm| and
+% |\rmfamily|) although it is slightly a misnomer as the command also
+% works in math-mode.
+%
+% Since December 95, in fact this command has one other difference
+% from |\color|. It calls |\leavevmode| to ensure the start of
+% horizontal mode. Specifically this means that a construction
+% such as
+%\begin{verbatim}
+% xxx\parbox[t]{1cm}{\textcolor{red}{a}.....
+%\end{verbatim}
+% now works as expected, with the |xxx| and the red |a| lining up
+% correctly.
+% \changes{v0.3a}{1994/07/20}
+% {Stop command being \cs{long}, and make robust.}
+% \changes{v0.3l}{1995/12/07}
+% {Add \cs{leavevmode}}
+% \begin{macrocode}
+\def\textcolor#1#{\@textcolor{#1}}
+\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Background (Page) Colour}
+%
+% \begin{macro}{\pagecolor}
+% |\pagecolor|, which has the same argument forms as |\color|, specifies
+% the background colour for the current, and all following, pages. It is
+% a global declaration which does not respect \TeX\ groups.
+%
+% \changes{v0.1c}{1994/04/01}
+% {end the group even if the colour command generates an error}
+% \changes{v0.3c}{1994/09/19}
+% {Use \cs{color} to parse arguments}
+% \begin{macrocode}
+\def\pagecolor{%
+ \begingroup
+ \let\ignorespaces\endgroup
+ \let\set@color\set@page@color
+ \color}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nopagecolor}
+% |\nopagecolor| (suggested by Heiko Oberdiek) removes any currently specified page colour
+% returning to the default transparent background. It is not yet supported by all driver options
+% and so generates a warning if there is no definition in the driver file.
+%
+% \changes{v1.1a}{2014/04/23}
+% {add \cs{nopagecolor} graphics/3873}
+% \begin{macrocode}
+\def\nopagecolor{%
+ \@ifundefined{no@page@color}{%
+ \PackageInfo{color}{\string\nopagecolor\space is not supported}%
+ }{%
+ \no@page@color
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Defining Colours}
+%
+% \begin{macro}{\definecolor}
+% |\definecolor{|\emph{name}|}{|\emph{model}|}{|\emph{colour-spec}|}|
+% defines the color \emph{name}, which may then be used in subsequent
+% |\color| or |\textcolor| commands to refer to a colour specified by
+% \emph{colour-spec} in the colour model \emph{model}.
+%
+% |\definecolor| associates the \emph{name} the to a colour in
+% \emph{model}. So |\color{|\emph{name}|}| would check \emph{name}
+% then issue a |\special| for the colour model \emph{model}.
+%
+% |\definecolor| just calls an internal macro that defines the colour
+% for a particular model. This macro must have been defined by the
+% driver file that supports the requested \emph{model}.
+%
+% \changes{v0.1b}{1994/03/15}
+% {change name from \cs{newcolor} to \cs{definecolor}}
+% \changes{v0.1e}{1994/05/14}
+% {Minor change to error message}
+% \changes{v0.3a}{1994/07/20}
+% {New internal implementation of colour commands}
+% \changes{v0.3f}{1994/10/04}
+% {Give info about redefinitions}
+% \begin{macrocode}
+\def\definecolor#1#2#3{%
+ \@ifundefined{color@#2}%
+ {\c@lor@error{model `#2'}}%
+ {\@ifundefined{\string\color @#1}{}%
+ {\PackageInfo{color}{Redefining color #1}}%
+ \csname color@#2\expandafter\endcsname
+ \csname\string\color @#1\endcsname{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\DefineNamedColor}
+% \changes{v0.3d}{1994/09/29}
+% {Macro added}
+% \changes{v0.3e}{1994/10/03}
+% {usenames option added}
+% \changes{v0.3f}{1994/10/04}
+% {Give info about redefinitions}
+%
+% Driver files may opt to define a `named' colour model.
+% Placing colour names rather than numeric specifications into the dvi
+% file has certain advantages, in that post processing software can
+% tune the colour specifications to the particular technology being
+% used, and more easily make colour separations for that colour.
+% The disadvantage is that the driver must `know' the colour
+% names.
+%
+% The `color1' drivers (dvips) currently ignore the specification of
+% the colour, and once a name is defined, just put the colour name in
+% the dvi file. For dvips, The header file \texttt{color.pro} is used to
+% give the cmyk equivalents of the names.
+%
+% The `color2' drivers (textures) use a special postscript operator
+% that takes both the name and the cmyk equivalent. so if the names are
+% not being used, `fall back' definitions in the cmyk model are available.
+% These drivers also allow a numeric value to affect the `density'
+% of the colour to use.
+%
+% Drivers based on `color3' do not support named colours at the dvi
+% level, but to ease document portability, the named model is still
+% defined, but the |\special|'s just put the colour specifications, not
+% the names, into the dvi file.
+%
+% Normally after a colour, say |JungleGreen|, has been declared with:\\
+% |\DefineNamedColor{named}{JungleGreen}{cmyk}{1,2,3,4}|\\
+% it is available in the `named' colour model, for
+% instance by\\
+% |\color[named]{JungleGreen}|\\
+% A user may give a more convenient name, using\\
+% |\definecolor{mygreen}{named}{JungleGreen}|\\
+% If however you are happy with the original names, and want to use
+% them directly, as in |\color{JungleGreen}| without specifying
+% |[named]| all the time, just give the package option |usenames|, which
+% will redefine |\DefineNamedColor|, so that the colour name is declared
+% as a user-colour as well as a name in the `named' model.
+% \begin{macrocode}
+\def\DefineNamedColor#1#2#3#4{%
+ \@ifundefined{define@color@#1}%
+ {\c@lor@error{model `#1'}}%
+ {\@ifundefined{color@#3}%
+ {\c@lor@error{model `#3'}}%
+ {\@ifundefined{c@lor@#1@#2}{}%
+ {\PackageInfo{color}{Redefining color #2 in named color model}}%
+ \csname color@#3\endcsname\@tempa{#4}%
+ \csname define@color@#1\endcsname{#2}\@tempa
+ \c@lor@usename{#2}}}}
+\@onlypreamble\DefineNamedColor
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Colour Switch}
+%
+% \begin{macro}{\ifcolors@}
+% This boolean can be tested by higher level macros that may want to
+% alter their behaviour if a monochrome driver is being used.
+% \begin{macrocode}
+\newif\ifcolors@
+\colors@true
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Whatsit\ldots}
+%
+% \begin{macro}{\c@lor@special}
+% Some drivers can not support all the features of this package. They
+% should always put a \meta{whatsit} in the current list though. The
+% following macro has most of the features of |\special|, but does not
+% put anything into the |dvi| file. It does write to the log file or the
+% terminal (depending on the value of |#1|).
+% \begin{macrocode}
+\def\c@lor@special#1#2{%
+ \edef\@tempa{\write#1{#2}}\@tempa}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Processing Options}
+%
+% A local configuration file may declare more options.
+% It should also make one driver option the default, by calling
+% |\ExecuteOptions| with the appropriate option.
+% \begin{macrocode}
+\InputIfFileExists{color.cfg}{}{}
+% \end{macrocode}
+%
+% After the options are processed, load the appropriate driver file.
+% If a site wants a default driver (eg |dvips|) it just needs to put
+% |\ExecuteOptions{dvips}| in a |color.cfg| file.
+% \changes{v0.3b}{1994/09/14}
+% {New style of loading driver files}
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+%
+% \begin{macrocode}
+\if!\Gin@driver!
+ \PackageError{color}
+ {No driver specified}
+ {You should make a default driver option in a file \MessageBreak
+ color.cfg\MessageBreak
+ eg: \protect\ExecuteOptions{dvips}%
+ }
+\else
+ \PackageInfo{color}{Driver file: \Gin@driver}
+ \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@ifundefined{c@lor@namefile}{}{\input{\c@lor@namefile}}
+% \end{macrocode}
+%
+% \section{Default Colour}
+%
+% \begin{macro}{\normalcolor}
+% Early versions of this package redefined |\reset@font| to reset the
+% color as well. Current versions do not do this (there are too many
+% |\reset@font| commands hidden in strange places) and so defines a
+% separate command, |\normalcolor| to reset the colour to the colour in
+% effect at the start of the document.
+%
+% |\normalcolor| is defined (to |\relax|) in the \LaTeX\ kernel, so it
+% is safe to use this in macros that may possibly be used in
+% conjunction with colour. It will have no effect until the |color|
+% package is also loaded.
+% \changes{v0.2b}{1994/04/18}
+% {Only reset the colour with \cmd{\reset@font} not
+% \cmd{\normalfont}}
+% \changes{v0.2d}{1994/05/13}
+% {Stop changing \cs{reset@font}. Use the new \cs{normalfont}
+% instead.}
+% \begin{macrocode}
+\def\normalcolor{\let\current@color\default@color\set@color}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\default@color}
+% Internal macro to store the `default' colour used by |\normalcolor|.
+% \begin{macrocode}
+\AtBeginDocument{\let\default@color\current@color}
+% \end{macrocode}
+% \end{macro}
+%
+% |\current@color| contains an internal representation of the colour
+% at this point in the document. (This can only be an approximation to
+% the truth as the `macro layer' of \TeX\ does not know where the output
+% routine is going to re-insert floats. This is why drivers must
+% maintain their own stack of colours in order to fully support these
+% commands.
+%
+% For dvips, the |\current@color| it is something like `|Black|' or
+% `|rgb 0 1 0|', but other packages should not rely on any particular
+% format for this macro.
+%
+% The driver file \emph{must} initialise |\current@color| to a
+% specification for Black. This initialisation can not occur here, as
+% the possible colour models (and thus the syntax for `black')
+% are not known at this point.
+%
+% \section{Higher Level Commands}
+%
+% With the basic colour primitives specified above we may define a few
+% higher level commands for coloured boxes etc. This is still quite a low
+% level and presumably packages and classes making use of colour will
+% define more appropriate document-level commands.
+%
+% \subsection{Colour Block}
+%
+% \begin{macro}{\color@block}
+% |\color@block{|\emph{width}|}{|\emph{height}|}{|\emph{depth}|}|\\
+% Should take up no space for \TeX, but produce a block in the current
+% colour of the specified size. It is mainly used for producing box
+% backgrounds.
+%
+% The definition here works by selecting a colour, and then drawing a
+% \TeX\ rule (unless |\ifcolors@false|). This allows the `driver
+% independent' colour specials to be used. However it is defined using
+% |\providecommand|, so that this file will not over-write any other
+% definition of this command. A graphics package may want to define it
+% using a special to produce (for example) a PostScript line. Producing
+% the line in the |\special| has the advantage that on a preview that
+% does not understand |\special|s, the line is automatically omited,
+% without needing to modify the source of the document (for instance by
+% adding the |monochrome| option).
+%
+% \begin{macrocode}
+\def\color@block#1#2#3{%
+ {\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Coloured Boxes}
+%
+% \begin{macro}{\colorbox}
+% |\colorbox| takes the same argument forms as |\textcolor|, but the
+% colour specifies the \emph{background} colour of the box.
+% \changes{v0.3b}{1994/09/14}
+% {New implementation}
+% \begin{macrocode}
+\def\colorbox#1#{\color@box{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v0.3i}{1995/04/27}
+% {Move \cs{leavevmode} for graphics/1521}
+% \begin{macro}{\color@box}
+% \begin{macrocode}
+\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fcolorbox}
+% |\fcolorbox| has an extra \emph{colour-spec} argument, and puts a
+% frame of the first colour around a box with a background specified by
+% the second colour. If an optional argument is given, it specifies the
+% colour model for both colours.
+% \changes{v0.3b}{1994/09/14}
+% {New implementation}
+% \begin{macro}{\fcolorbox}
+% \begin{macrocode}
+\def\fcolorbox#1#{\color@fbox{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\color@fbox#1#2#3{%
+ \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+
+% \begin{macro}{\color@b@x}
+% Internal macro for |\colorbox| and |\fcolorbox|.
+% \changes{v0.3b}{1994/09/14}
+% {Macro added.}
+% \changes{v0.3i}{1995/04/27}
+% {Add \cs{leavevmode} for graphics/1521}
+% \begin{macrocode}
+\long\def\color@b@x#1#2#3{%
+ \leavevmode
+ \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}%
+ \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
+ \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
+ {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}%
+ \box\z@}}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Extra Groups}
+% Turning on extra groups in the standard \LaTeX\ commands, so that
+% colour commands are scoped correctly.
+%
+% Like |\normalcolor|, the following five commands are defined in the
+% kernel, with empty definitions (|\relax|). This means that they can
+% be used to make macros in packages `colour safe'. The commands
+% will not have any effect unless a user also uses this colour
+% package, when the `active definitions' here will take effect and
+% keep colour commands correctly scoped.
+%
+% \begin{macro}{\color@setgroup}
+% This is to be used in contexts (eg `lrbox') where text is to be
+% saved and used after some other, unknown, text that may contain
+% colour commands. A matching |\color@endgroup| should be used at the
+% end of the text.
+% \changes{v0.2d}{1994/05/13}
+% {Macro added}
+% \begin{macrocode}
+\def\color@setgroup{\begingroup\set@color}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\color@begingroup}
+% This is to be used at the start of contexts that may contain colour
+% commands, but where it is not necessary to save the current colour.
+% Examples of this are in the box commands of |ltboxes.dtx| where
+% user-supplied text is saved internally in a box between
+% |\color@begingroup|, |\color@endgroup|, but the box is used before
+% any other colour commands could intervene. A matching
+% |\color@endgroup| should be used at the end of the text.
+% \changes{v0.2d}{1994/05/13}
+% {New definition, was previously like \cs{color@setgroup}}
+% \begin{macrocode}
+\let\color@begingroup\begingroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\color@endgroup}
+% To be used to close the `group' started by one of the above two
+% commands. The |\endgraf| in its definition is required in the case
+% of groups of text in vertical `par' mode, but doesn't do any harm in
+% horizontal `LR' contexts.
+% \changes{v0.2d}{1994/05/13}
+% {New definition, was previously just \cs{endgroup}}
+% \begin{macrocode}
+\def\color@endgroup{\endgraf\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\color@hbox}
+% To be used to open a `coloured hbox'
+% \changes{v0.3g}{1994/11/08}
+% {Macro added}
+% \begin{macrocode}
+\def\color@hbox{\hbox\bgroup\color@begingroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\color@vbox}
+% To be used to open a `coloured hbox'
+% \changes{v0.3h}{1994/11/22}
+% {Macro added}
+% \begin{macrocode}
+\def\color@vbox{\vbox\bgroup\color@begingroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\color@endbox}
+% To be used to close a `coloured hbox'
+% \changes{v0.3g}{1994/11/08}
+% {Macro added}
+% \begin{macrocode}
+\def\color@endbox{\color@endgroup\egroup}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \changes{v0.2d}{1994/05/13}
+% {tabbing support removed (now in kernel)}
+%
+% \changes{v0.3l}{1995/12/07}
+% {\cs{underbar} removed (now in kernel)}
+%
+% \changes{v0.3h}{1994/11/22}
+% {marginpar, phantom and smash now supported in kernel}
+%
+% \changes{v0.3l}{1995/12/07}
+% {\cs{showhyphens} removed (now in kernel)}
+%
+%
+% \section{Predefining Colours}
+%
+% As long as the driver file has defined sufficient colour models, we
+% define a few colours, just to get people started.
+%
+% \begin{macro}{black}
+% \begin{macro}{white}
+% Black and white `colours'.
+% \begin{macrocode}
+\ifx\color@gray\@undefined
+ \ifx\color@rgb\@undefined
+ \else
+ \definecolor{black}{rgb}{0,0,0}
+ \definecolor{white}{rgb}{1,1,1}
+ \fi
+\else
+ \definecolor{black}{gray}{0}
+ \definecolor{white}{gray}{1}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{red}
+% \begin{macro}{green}
+% \begin{macro}{blue}
+% Additive primaries.
+% \begin{macrocode}
+\ifx\color@rgb\@undefined\else
+ \definecolor{red}{rgb}{1,0,0}
+ \definecolor{green}{rgb}{0,1,0}
+ \definecolor{blue}{rgb}{0,0,1}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{cyan}
+% \begin{macro}{magenta}
+% \begin{macro}{yellow}
+% Subtractive primaries.
+% \begin{macrocode}
+\ifx\color@cmyk\@undefined\else
+ \definecolor{cyan}{cmyk}{1,0,0,0}
+ \definecolor{magenta}{cmyk}{0,1,0,0}
+ \definecolor{yellow}{cmyk}{0,0,1,0}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \section{And Finally}
+%
+% Restore Catcodes
+% \begin{macrocode}
+\Gin@codes
+\let\Gin@codes\relax
+% \end{macrocode}
+%
+% \Finale
+%
diff --git a/macros/latex-dev/required/graphics/color.pdf b/macros/latex-dev/required/graphics/color.pdf
new file mode 100644
index 0000000000..efdebda318
--- /dev/null
+++ b/macros/latex-dev/required/graphics/color.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/drivers.dtx b/macros/latex-dev/required/graphics/drivers.dtx
new file mode 100644
index 0000000000..07c201cf87
--- /dev/null
+++ b/macros/latex-dev/required/graphics/drivers.dtx
@@ -0,0 +1,1701 @@
+%
+% \iffalse
+%
+%% drivers.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz
+%% Copyright (C) 1995 1996 1997 1998 1999 David Carlisle
+%% Copyright (C) 2000--2016 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3 or, at your option, any later version.
+%%
+%<template, >\ProvidesFile{template.def}
+%<dvips, >\ProvidesFile{dvips.def}
+%<dvipsnames>\ProvidesFile{dvipsnam.def}
+%<dvipdf, >\ProvidesFile{dvipdf.def}
+%<emtex, >\ProvidesFile{emtex.def}
+%<dviwin, >\ProvidesFile{dviwin.def}
+%<dvipsone, >\ProvidesFile{dvipsone.def}
+%<pctexps, >\ProvidesFile{pctexps.def}
+%<pctex32, >\ProvidesFile{pctex32.def}
+%<pctexwin, >\ProvidesFile{pctexwin.def}
+%<pctexhp, >\ProvidesFile{pctexhp.def}
+%<truetex, >\ProvidesFile{truetex.def}
+%<tcidvi, >\ProvidesFile{tcidvi.def}
+%<oztex, >\ProvidesFile{oztex.def}
+%<textures, >\ProvidesFile{textures.def}
+%<dvialw, >\ProvidesFile{dvialw.def}
+%<dvilaser, >\ProvidesFile{dvilaser.def}
+%<psprint, >\ProvidesFile{psprint.def}
+%<dvi2ps, >\ProvidesFile{dvi2ps.def}
+%<pubps, >\ProvidesFile{pubps.def}
+%<dvitops, >\ProvidesFile{dvitops.def}
+%<ln, >\ProvidesFile{ln.def}
+%
+%<*driver>
+ \NeedsTeXFormat{LaTeX2e}
+ \ProvidesFile{drivers.dtx}
+%</driver>
+ [2016/06/17 v3.0m Driver-dependent file (DPC,SPQR)]
+%
+%<*driver>
+ \documentclass{ltxdoc}
+ \GetFileInfo{drivers.dtx}
+ \begin{document}
+ \title{Graphics drivers for \LaTeXe\thanks
+ {Version \fileversion, revised \filedate}}
+ \author{Sebastian Rahtz and David Carlisle}
+ \date{\filedate}
+ \MaintainedByLaTeXTeam{graphics}
+ \maketitle
+ \DocInput{drivers.dtx}
+ \end{document}
+%</driver>
+% \fi
+%
+%
+%
+% \providecommand\OzTeX{O\kern-.03em z\kern-.15em\TeX}
+%
+% \section{Driver files}
+%
+% This file implements some of the currently supported drivers.
+% If the driver you use is not in this list then a `.def' file
+% may be distributed with This graphics bundle,
+% or may be distributed with your driver.
+%
+% If not, send us some details of the driver's |\special| syntax, and
+% we will try to produce a suitable file.
+%
+% Note that some of these files are for drivers to which we have no
+% access, so they are untested. Please send any corrections to the
+% latexbugs address.
+%
+%
+%
+%
+% \StopEventually{}
+%
+%
+% \section{Colour}
+%
+% Most of the drivers that support colour use one of three methods.
+% \begin{itemize}
+% \item color1: `dvips' style colour specials.
+% \item color2: `textures' style colour specials.
+% \item color3: Colour implemented via literal PostScript specials.
+% \item color4: Colour implemented by specials that only support RGB,
+% i.e., Red Green Blue specified as integers in the range
+% 0--255. Other models converted to this within \TeX.
+% \end{itemize}
+% Some drivers do not use any of these modules and have their own code.
+% Note that drivers using the `color3' code can not fully support the
+% \LaTeX\ colour commands.
+% \begin{macrocode}
+%<*color1|color2|color3|color4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\c@lor@arg#1{%
+ \dimen@#1\p@
+ \ifdim\dimen@<\z@\dimen@\maxdimen\fi
+ \ifdim\dimen@>\p@
+ \PackageError{color}{Argument `#1' not in range [0,1]}\@ehd
+ \fi}
+% \end{macrocode}
+%
+% Need to make sure of a trailing .0 for textures. Apparently it
+% is OK to always add a . as 1.3. is accepted by textures.
+% textures gray special is reversed, so just use rgb instead.
+%
+% \begin{macrocode}
+\def\color@gray#1#2{%
+ \c@lor@arg{#2}%
+%<color4> \c@lor@rgb@RGB\@tempa
+%<color1> \edef#1{gray #2}%
+%<color2> \edef#1{rgb #2. #2. #2.}%
+%<color3> \edef#1{#2 setgray}%
+%<color4> \edef#1{\@tempa\@tempa\@tempa}%
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1}
+\def\c@lor@@cmyk#1,#2,#3,#4\@@#5{%
+ \c@lor@arg{#4}%
+%<color4> \dimen@ii#4\p@
+ \c@lor@arg{#1}%
+%<color4> \c@lor@cmyk@RGB\@tempa
+ \c@lor@arg{#2}%
+%<color4> \c@lor@cmyk@RGB\@tempb
+ \c@lor@arg{#3}%
+%<color4> \c@lor@cmyk@RGB\@tempc
+%<color1> \edef#5{cmyk #1 #2 #3 #4}%
+%<color2> \edef#5{cmyk #1. #2. #3. #4.}%
+%<color3> \edef#5{#1 #2 #3 #4 setcmykcolor}%
+%<color4> \edef#5{\@tempa\@tempb\@tempc}%
+ }
+% \end{macrocode}
+%
+% A 0--1 range value will have been left in |\dimen@| by |\c@lor@arg|.
+% The black value (0--1) will be stored in |\dimen@ii|.
+% Covert to 0--255 integer, and leave in |#1|.
+% \begin{macrocode}
+%<*color4>
+\def\c@lor@cmyk@RGB#1{%
+ \advance\dimen@-\p@
+ \advance\dimen@\dimen@ii
+ \dimen@-\@cclv\dimen@
+ \divide\dimen@\p@
+ \count@\ifdim\dimen@<\z@\z@\else\dimen@\fi
+ \edef#1{\the\count@\space}}
+%</color4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\color@rgb#1#2{\c@lor@@rgb#2\@@#1}
+\def\c@lor@@rgb#1,#2,#3\@@#4{%
+ \c@lor@arg{#1}%
+%<color4> \c@lor@rgb@RGB\@tempa
+ \c@lor@arg{#2}%
+%<color4> \c@lor@rgb@RGB\@tempb
+ \c@lor@arg{#3}%
+%<color4> \c@lor@rgb@RGB\@tempc
+%<color1> \edef#4{rgb #1 #2 #3}%
+%<color2> \edef#4{rgb #1. #2. #3.}%
+%<color3> \edef#4{#1 #2 #3 setrgbcolor}%
+%<color4> \edef#4{\@tempa\@tempb\@tempc}%
+ }
+% \end{macrocode}
+%
+% A 0--1 range value will have been left in |\dimen@| by |\c@lor@arg|.
+% Convert to 0--255 integer, and leave in |#1|.
+% \begin{macrocode}
+%<*color4>
+\def\c@lor@rgb@RGB#1{%
+ \dimen@\@cclv\dimen@
+ \count@\dimen@
+ \divide\count@\p@
+ \edef#1{\the\count@\space}}
+%</color4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\color@RGB#1#2{\c@lor@@RGB#2\@@#1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\c@lor@@RGB#1,#2,#3\@@#4{%
+%<!color4> \c@lor@RGB@rgb{#1}\@tempa
+%<!color4> \c@lor@RGB@rgb{#2}\@tempb
+%<!color4> \c@lor@RGB@rgb{#3}\@tempc
+%<!color4> \c@lor@@rgb\@tempa,\@tempb,\@tempc\@@#4%
+%<color4> \edef#4{#1 #2 #3}%
+ }
+% \end{macrocode}
+% % Convert 0--255 integer, |#1|, to 0--1 real, and leave in |#2|.
+% \begin{macrocode}
+%<*!color4>
+\def\c@lor@RGB@rgb#1#2{%
+ \dimen@#1\p@
+ \divide\dimen@\@cclv
+ \edef#2{\strip@pt\dimen@}}
+%</!color4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*color1|color3>
+\def\color@hsb#1#2{\c@lor@@hsb#2\@@#1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\c@lor@@hsb#1,#2,#3\@@#4{%
+ \c@lor@arg{#1}%
+ \c@lor@arg{#2}%
+ \c@lor@arg{#3}%
+%<color1> \edef#4{hsb #1 #2 #3}%
+%<color3> \edef#4{#1 #2 #3 sethsbcolor}%
+ }
+%</color1|color3>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\color@named#1#2{\c@lor@@named#2,,\@@#1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\c@lor@@named#1,#2,#3\@@#4{%
+ \@ifundefined{col@#1}%
+ {\PackageError{color}{Undefined color `#1'}\@ehd}%
+%<color1&!dvipsone> {\edef#4{ #1}}%
+%<color2> {\edef#4{ #1 \if!#2!\else #2.\fi}}%
+%<color3|dvipsone|color4> {\edef#4{\csname col@#1\endcsname}}%
+ }
+% \end{macrocode}
+%
+% Conversion from |\special| syntax to PostScript (for PSTricks).
+% \begin{macrocode}
+%<*color1|color2>
+\def\c@lor@to@ps#1 #2\@@{\csname c@lor@ps@#1\endcsname#2 \@@}
+%</color1|color2>
+%<*color3>
+\def\c@lor@to@ps#1\@@{#1}
+%</color3>
+%<*color4>
+\def\c@lor@to@ps#1#2 #3 #4\@@{%
+ #1#2 255 div #3 255 div #4 255 div setrgbcolor}
+%</color4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*color1>
+\def\c@lor@ps@#1 #2\@@{TeXDict begin #1 end}
+\def\c@lor@ps@rgb#1\@@{#1 setrgbcolor}
+\def\c@lor@ps@hsb#1\@@{#1 sethsbcolor}
+\def\c@lor@ps@cmyk#1\@@{#1 setcmykcolor}
+\def\c@lor@ps@gray#1\@@{#1 setgray}
+%</color1>
+%<*color2>
+\def\c@lor@to@ps@#1 #2\@@{\csname c@lor@ps@#1@\endcsname#2 \@@}
+\def\c@lor@ps@#1 #2\@@{%
+ \expandafter\expandafter\expandafter
+ \c@lor@to@ps@\csname col@#1\expandafter\endcsname\space#2. \@@{#1}}
+\def\c@lor@ps@rgb#1. #2. #3. #4\@@{#1 #2 #3 setrgbcolor}
+\def\c@lor@ps@rgb@#1. #2. #3. #4. #5\@@#6{#1 #2 #3 setrgbcolor}
+\def\c@lor@ps@cmyk#1. #2. #3. #4. #5. #6\@@{#1 #2 #3 #4 setcmykcolor}
+\def\c@lor@ps@cmyk@#1. #2. #3. #4. #5. #6\@@#7{%
+ #1 #2 #3 #4 (#7) findcustomcmykcolor
+ \if!\@firstofone#5!1 \else#5 \fi setcustomcolor}
+%</color2>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<color1&!dvipsone>\def\current@color{ Black}
+%<color1&dvipsone>\def\current@color{gray 0}
+%<color2>\def\current@color{rgb 0. 0. 0.}
+%<color3>\def\current@color{0 setgray}
+%<color4>\def\current@color{0 0 0}
+% \end{macrocode}
+%
+% \changes{v3.0j}{2014/04/23}
+% {add \cs{nopagecolor} for dvips graphics/3873}
+% \begin{macrocode}
+%<*color1>
+\def\set@color{%
+%<!dvipsone&!dvipdf> \special{color push \current@color
+%<dvipsone> \special{color push}\special{color \current@color
+%<dvipdf> \special{pdf: /C \current@color\space<<
+ }\aftergroup\reset@color}
+\def\reset@color{\special{%
+%<!dvipdf> color pop}}
+%<dvipdf> pdf: /C >> }}
+\def\set@page@color{\special{%
+%<!dvipdf> background \current@color}}
+%<dvipdf> pdf: /BG \current@color}}
+\def\define@color@named#1#2{%
+%<!dvipsone> \expandafter\let\csname col@#1\endcsname\@nnil}
+%<dvipsone> \expandafter\edef\csname col@#1\endcsname{#2}}
+%<dvips> \def\no@page@color{\special{background \string"newpath clip}}
+%</color1>
+%<*color2>
+\def\set@color{%
+ \special{color push}%
+ \special{color \current@color}%
+ \aftergroup\reset@color}
+\def\reset@color{\special{color pop}}
+\def\set@page@color{\c@lor@special\sixt@@n{background \current@color}}
+\def\define@color@named#1#2{%
+ \AtBeginDvi{\special{color define #1 #2}}%
+ \expandafter\edef\csname col@#1\endcsname{#2}}
+%</color2>
+%<*color3>
+\def\set@color{%
+ \Gin@PS@raw{\current@color}\aftergroup\reset@color}
+\def\reset@color{\Gin@PS@raw{\current@color}}
+%</color3>
+%<*color4>
+\def\set@color{%
+ \special{textcolor: \current@color}\aftergroup\reset@color}
+\def\reset@color{\special{textcolor: \current@color}}
+%</color4>
+%<*color3|color4>
+\def\set@page@color{%
+ \c@lor@special\sixt@@n{background color ignored: \current@color}}
+\def\define@color@named#1#2{%
+ \expandafter\edef\csname col@#1\endcsname{#2}}
+%</color3|color4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</color1|color2|color3|color4>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*colorfix>
+\AtBeginDocument{%
+ \let\@ldc@l@r\color
+ \def\color{\if@inlabel\leavevmode\fi\@ldc@l@r}%
+ \let\@lduseb@x\usebox
+ \def\usebox#1{\@lduseb@x{#1}\set@color}}
+%</colorfix>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*dvipsnames>
+\DefineNamedColor{named}{GreenYellow} {cmyk}{0.15,0,0.69,0}
+\DefineNamedColor{named}{Yellow} {cmyk}{0,0,1,0}
+\DefineNamedColor{named}{Goldenrod} {cmyk}{0,0.10,0.84,0}
+\DefineNamedColor{named}{Dandelion} {cmyk}{0,0.29,0.84,0}
+\DefineNamedColor{named}{Apricot} {cmyk}{0,0.32,0.52,0}
+\DefineNamedColor{named}{Peach} {cmyk}{0,0.50,0.70,0}
+\DefineNamedColor{named}{Melon} {cmyk}{0,0.46,0.50,0}
+\DefineNamedColor{named}{YellowOrange} {cmyk}{0,0.42,1,0}
+\DefineNamedColor{named}{Orange} {cmyk}{0,0.61,0.87,0}
+\DefineNamedColor{named}{BurntOrange} {cmyk}{0,0.51,1,0}
+\DefineNamedColor{named}{Bittersweet} {cmyk}{0,0.75,1,0.24}
+\DefineNamedColor{named}{RedOrange} {cmyk}{0,0.77,0.87,0}
+\DefineNamedColor{named}{Mahogany} {cmyk}{0,0.85,0.87,0.35}
+\DefineNamedColor{named}{Maroon} {cmyk}{0,0.87,0.68,0.32}
+\DefineNamedColor{named}{BrickRed} {cmyk}{0,0.89,0.94,0.28}
+\DefineNamedColor{named}{Red} {cmyk}{0,1,1,0}
+\DefineNamedColor{named}{OrangeRed} {cmyk}{0,1,0.50,0}
+\DefineNamedColor{named}{RubineRed} {cmyk}{0,1,0.13,0}
+\DefineNamedColor{named}{WildStrawberry}{cmyk}{0,0.96,0.39,0}
+\DefineNamedColor{named}{Salmon} {cmyk}{0,0.53,0.38,0}
+\DefineNamedColor{named}{CarnationPink} {cmyk}{0,0.63,0,0}
+\DefineNamedColor{named}{Magenta} {cmyk}{0,1,0,0}
+\DefineNamedColor{named}{VioletRed} {cmyk}{0,0.81,0,0}
+\DefineNamedColor{named}{Rhodamine} {cmyk}{0,0.82,0,0}
+\DefineNamedColor{named}{Mulberry} {cmyk}{0.34,0.90,0,0.02}
+\DefineNamedColor{named}{RedViolet} {cmyk}{0.07,0.90,0,0.34}
+\DefineNamedColor{named}{Fuchsia} {cmyk}{0.47,0.91,0,0.08}
+\DefineNamedColor{named}{Lavender} {cmyk}{0,0.48,0,0}
+\DefineNamedColor{named}{Thistle} {cmyk}{0.12,0.59,0,0}
+\DefineNamedColor{named}{Orchid} {cmyk}{0.32,0.64,0,0}
+\DefineNamedColor{named}{DarkOrchid} {cmyk}{0.40,0.80,0.20,0}
+\DefineNamedColor{named}{Purple} {cmyk}{0.45,0.86,0,0}
+\DefineNamedColor{named}{Plum} {cmyk}{0.50,1,0,0}
+\DefineNamedColor{named}{Violet} {cmyk}{0.79,0.88,0,0}
+\DefineNamedColor{named}{RoyalPurple} {cmyk}{0.75,0.90,0,0}
+\DefineNamedColor{named}{BlueViolet} {cmyk}{0.86,0.91,0,0.04}
+\DefineNamedColor{named}{Periwinkle} {cmyk}{0.57,0.55,0,0}
+\DefineNamedColor{named}{CadetBlue} {cmyk}{0.62,0.57,0.23,0}
+\DefineNamedColor{named}{CornflowerBlue}{cmyk}{0.65,0.13,0,0}
+\DefineNamedColor{named}{MidnightBlue} {cmyk}{0.98,0.13,0,0.43}
+\DefineNamedColor{named}{NavyBlue} {cmyk}{0.94,0.54,0,0}
+\DefineNamedColor{named}{RoyalBlue} {cmyk}{1,0.50,0,0}
+\DefineNamedColor{named}{Blue} {cmyk}{1,1,0,0}
+\DefineNamedColor{named}{Cerulean} {cmyk}{0.94,0.11,0,0}
+\DefineNamedColor{named}{Cyan} {cmyk}{1,0,0,0}
+\DefineNamedColor{named}{ProcessBlue} {cmyk}{0.96,0,0,0}
+\DefineNamedColor{named}{SkyBlue} {cmyk}{0.62,0,0.12,0}
+\DefineNamedColor{named}{Turquoise} {cmyk}{0.85,0,0.20,0}
+\DefineNamedColor{named}{TealBlue} {cmyk}{0.86,0,0.34,0.02}
+\DefineNamedColor{named}{Aquamarine} {cmyk}{0.82,0,0.30,0}
+\DefineNamedColor{named}{BlueGreen} {cmyk}{0.85,0,0.33,0}
+\DefineNamedColor{named}{Emerald} {cmyk}{1,0,0.50,0}
+\DefineNamedColor{named}{JungleGreen} {cmyk}{0.99,0,0.52,0}
+\DefineNamedColor{named}{SeaGreen} {cmyk}{0.69,0,0.50,0}
+\DefineNamedColor{named}{Green} {cmyk}{1,0,1,0}
+\DefineNamedColor{named}{ForestGreen} {cmyk}{0.91,0,0.88,0.12}
+\DefineNamedColor{named}{PineGreen} {cmyk}{0.92,0,0.59,0.25}
+\DefineNamedColor{named}{LimeGreen} {cmyk}{0.50,0,1,0}
+\DefineNamedColor{named}{YellowGreen} {cmyk}{0.44,0,0.74,0}
+\DefineNamedColor{named}{SpringGreen} {cmyk}{0.26,0,0.76,0}
+\DefineNamedColor{named}{OliveGreen} {cmyk}{0.64,0,0.95,0.40}
+\DefineNamedColor{named}{RawSienna} {cmyk}{0,0.72,1,0.45}
+\DefineNamedColor{named}{Sepia} {cmyk}{0,0.83,1,0.70}
+\DefineNamedColor{named}{Brown} {cmyk}{0,0.81,1,0.60}
+\DefineNamedColor{named}{Tan} {cmyk}{0.14,0.42,0.56,0}
+\DefineNamedColor{named}{Gray} {cmyk}{0,0,0,0.50}
+\DefineNamedColor{named}{Black} {cmyk}{0,0,0,1}
+\DefineNamedColor{named}{White} {cmyk}{0,0,0,0}
+%</dvipsnames>
+% \end{macrocode}
+%
+% \section{dvips}
+% A \LaTeXe\ graphics driver file for Tom Rokicki's \emph{dvips}
+% driver; tested with version 5.58f.
+%
+% \begin{macrocode}
+%<*dvips>
+% \end{macrocode}
+%
+% \subsection{Colour}
+% Uses the generic `color1' code.
+%
+% \subsection{File inclusion}
+%
+% \begin{macro}{\Ginclude@eps}
+% |#1| input file (or command)
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \bgroup
+% \end{macrocode}
+% \emph{dvips} likes to work with its own pixel resolution, so
+% mangle the sizes slightly.
+% \begin{macrocode}
+ \def\@tempa{!}%
+ \dimen@\Gin@req@width
+ \dimen@ii.1bp%
+ \divide\dimen@\dimen@ii
+ \@tempdima\Gin@req@height
+ \divide\@tempdima\dimen@ii
+ \special{PSfile="#1"\space
+ llx=\Gin@llx\space
+ lly=\Gin@lly\space
+ urx=\Gin@urx\space
+ ury=\Gin@ury\space
+ \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
+ \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
+ \ifGin@clip clip\fi}%
+ \egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Ginclude@bmp}
+% |#1| input file; if zero size is requested, the graphic will
+% come at `natural' size.
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+ \message{<#1>}%
+ \dimen@\Gin@req@height
+ \advance\dimen@ by-\Gin@lly bp
+ \kern-\Gin@llx bp\raise\Gin@req@height\hbox{%
+ \ifdim\Gin@urx bp=\z@
+ \ifdim\Gin@ury bp=\z@
+ \special{em: graph #1}%
+ \else
+ \special{em: graph #1,\Gin@urx bp}%
+ \fi
+ \else
+ \special{em: graph #1,\Gin@urx bp,\Gin@ury bp}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Ginclude@pict}
+% \begin{macro}{\Ginclude@pntg}
+% \begin{macro}{\oztex@include}
+% PICT/PNTG format from the Mac. Actually only currently supported by
+% the version of dvips distributed with \OzTeX, and with the built in
+% \OzTeX\ drivers, but put here anyway as it is not much code and
+% increases portability between the systems as now |[dvips]| and
+% |[oztex]| share the same back end.
+% \begin{macrocode}
+\def\oztex@include#1#2{%
+ \dimen@1bp%
+ \divide\Gin@req@width\dimen@
+ \divide\Gin@req@height\dimen@
+ \special{#1=#2\space
+ \@width=\number\Gin@req@width \space
+ \@height=\number\Gin@req@height}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Ginclude@pntg{\oztex@include{pntg}}
+\def\Ginclude@pict{\oztex@include{pict}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Rotation}
+% \begin{macrocode}
+\def\Grot@start{%
+ \special{ps: gsave currentpoint
+ currentpoint translate \Grot@angle\space neg
+ rotate neg exch neg exch translate}}
+\def\Grot@end{\special{ps: currentpoint grestore moveto}}
+% \end{macrocode}
+% \subsection{Scaling}
+% \begin{macrocode}
+\def\Gscale@start{\special{ps: currentpoint currentpoint translate
+ \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
+\def\Gscale@end{\special{ps: currentpoint currentpoint translate
+ 1 \Gscale@x\space div 1 \Gscale@y\space div scale
+ neg exch neg exch translate}}
+% \end{macrocode}
+%
+% \section{Literal Postscript}
+%
+% Raw PostScript code, no save/restore.
+% \begin{macrocode}
+\def\Gin@PS@raw#1{\special{ps: #1}}
+% \end{macrocode}
+%
+% PostScript code, to be surrounded by save/restore by the driver.
+% Coordinate system standard PostScript, but with origin
+% at current (\TeX) position.
+% \begin{macrocode}
+\def\Gin@PS@restored#1{\special{" #1}}
+% \end{macrocode}
+%
+% PostScript code to be inserted in the Header section of the final
+% PostScript. Must be issued on the first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}
+% \end{macrocode}
+%
+% Name of external file, the contents of which are to be inserted in
+% the Header section of the final PostScript. Must be issued on the
+% first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
+% \end{macrocode}
+%
+% \section{Page Size}
+%
+% \changes{v3.0l}{2016/06/02}{page size special added to patch pdftex.def}
+% \changes{v3.0m}{2016/06/17}{guards for contributed packages and plain TeX}
+% \begin{macrocode}
+\@ifundefined{ifGin@setpagesize}
+ {\expandafter\let\csname ifGin@setpagesize\expandafter\endcsname
+ \csname iftrue\endcsname}
+ {}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ifGin@setpagesize
+\ifx\paperwidth\@undefined\else
+ \AtBeginDocument{\AtBeginDvi{%
+ \begingroup
+ \ifx\stockwidth\@undefined\else
+ \paperwidth\stockwidth
+ \paperheight\stockheight
+ \fi
+ \ifdim\paperwidth>\z@
+ \ifdim\paperheight>\z@
+ \special{papersize=\the\paperwidth,\the\paperheight}%
+ \fi
+ \fi
+ \endgroup}}
+\fi
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</dvips>
+% \end{macrocode}
+%
+%
+% \section{dvipdf}
+% A \LaTeXe\ graphics driver file for \emph{dvipdf} driver.
+%
+% \begin{macrocode}
+%<*dvipdf>
+% \end{macrocode}
+%
+% \subsection{Colour}
+% Uses the generic `color1' code.
+%
+% \subsection{File inclusion}
+%
+% \begin{macro}{\Ginclude@eps}
+% |#1| input file (or command)
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \bgroup
+% \end{macrocode}
+% \emph{dvips} likes to work with its own pixel resolution, so
+% mangle the sizes slightly.
+% \begin{macrocode}
+ \def\@tempa{!}%
+ \dimen@\Gin@req@width
+ \dimen@ii.1bp%
+ \divide\dimen@\dimen@ii
+ \@tempdima\Gin@req@height
+ \divide\@tempdima\dimen@ii
+ \special{PSfile="#1"\space
+ llx=\Gin@llx\space
+ lly=\Gin@lly\space
+ urx=\Gin@urx\space
+ ury=\Gin@ury\space
+ \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
+ \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
+ \ifGin@clip clip\fi}%
+ \egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Ginclude@bmp}
+% |#1| input file; if zero size is requested, the graphic will
+% come at `natural' size.
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+ \message{<#1>}%
+ \dimen@\Gin@req@height
+ \advance\dimen@ by-\Gin@lly bp
+ \kern-\Gin@llx bp\raise\Gin@req@height\hbox{%
+ \ifdim\Gin@urx bp=\z@
+ \ifdim\Gin@ury bp=\z@
+ \special{pdf: /GRAPH #1}%
+ \else
+ \special{pdf: /GRAPH #1 \number\Gin@req@width sp}%
+ \fi
+ \else
+ \special{pdf: /GRAPH #1 \number\Gin@req@width sp
+ \number\Gin@req@height sp}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Rotation}
+% \begin{macrocode}
+\def\Grot@start{%
+\special{pdf: /ROT \Grot@angle\space << }}
+\def\Grot@end{\special{pdf: /ROT >> }}
+% \end{macrocode}
+%
+% \subsection{Scaling}
+% \begin{macrocode}
+\def\Gscale@start{\special{pdf: /S \Gscale@x\space \Gscale@y\space << }}
+\def\Gscale@end{\special{pdf: /S \space >> }}
+% \end{macrocode}
+%
+% \section{Literal Postscript}
+%
+% Raw PostScript code, no save/restore.
+% \begin{macrocode}
+\def\Gin@PS@raw#1{\special{ps: #1}}
+% \end{macrocode}
+%
+% PostScript code, to be surrounded by save/restore by the driver.
+% Coordinate system standard PostScript, but with origin
+% at current (\TeX) position.
+% \begin{macrocode}
+\def\Gin@PS@restored#1{\special{" #1}}
+% \end{macrocode}
+%
+% PostScript code to be inserted in the Header section of the final
+% PostScript. Must be issued on the first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}
+% \end{macrocode}
+%
+% Name of external file, the contents of which are to be inserted in
+% the Header section of the final PostScript. Must be issued on the
+% first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
+% \end{macrocode}
+%
+% \subsection{File extensions}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@.msp}#1{{bmp}{.bb}{#1}}
+\@namedef{Gin@rule@.jpg}#1{{bmp}{.bb}{#1}}
+\@namedef{Gin@rule@.bmp}#1{{bmp}{.bb}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</dvipdf>
+% \end{macrocode}
+%
+% \section{\OzTeX}
+%
+% A \LaTeXe\ graphics driver file for \OzTeX\
+% (versions 1.42 and later),
+% by Andrew Trevorrow.
+% \begin{macrocode}
+%<*oztex>
+% \end{macrocode}
+%\subsection{Graphics inclusion}
+% \begin{macrocode}
+\def\Ginclude@eps{\Oztex@Include{epsf}}
+\def\Ginclude@pntg{\Oztex@Include{pntg}}
+\def\Ginclude@pict{\Oztex@Include{pict}}
+\def\Oztex@Include#1#2{%
+ \ifGin@clip
+ \typeout{No clipping support in OzTeX}%
+ \fi
+ \divide\Gin@req@width by 65781% convert sp to bp
+ \divide\Gin@req@height by 65781%
+ \special{#1=#2\space
+ width=\number\Gin@req@width \space
+ height=\number\Gin@req@height
+ }%
+}
+%</oztex>
+% \end{macrocode}
+%\section{Textures}
+% A \LaTeXe\ graphics driver file for Blue Sky's Textures
+%
+% \textbf{WARNING! There is ongoing work to produce a new version of
+% the textures support. Do not rely on anything in this file being in
+% the next version!}
+%
+%
+% \begin{macrocode}
+%<*textures>
+% \end{macrocode}
+% \subsection{Graphics inclusion}
+%
+%
+% \begin{macrocode}
+\PackageInfo{graphics/color}
+ {This file uses the advanced color support\MessageBreak
+ available in textures1.7\MessageBreak
+ If you are using color with an earlier version\MessageBreak
+ of textures, edit graphics.ins where marked,\MessageBreak
+ and re-latex graphics.ins.\MessageBreak\MessageBreak
+ If you are using textures1.7\MessageBreak
+ you may want to delete this warning\MessageBreak
+ from textures.def.\MessageBreak\MessageBreak
+ The code for scaling/rotation and file inclusion\MessageBreak
+ in this file is still rudimentary, and does not\MessageBreak
+ use textures' full capabilities.\MessageBreak\MessageBreak
+ A new textures.def is currently being developed\@gobble}
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\def\Ginclude@eps{\Textures@Include{illustration}}
+\def\Ginclude@pict{\Textures@Include{pictfile}}
+\def\Textures@Include#1#2{%
+ \def\@tempa{!}%
+ \ifx\Gin@scaley\@tempa
+ \let\Gin@scaley\Gin@scalex
+ \else
+ \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
+ \fi
+ \setlength\@tempdima{\Gin@scalex pt}%
+ \setlength\@tempdimb{\Gin@scaley pt}%
+ \ifdim\@tempdima>\@tempdimb
+ \let\Gin@scalex\Gin@scaley
+ \fi
+ \ifGin@clip
+ \typeout{no clipping support in Textures}%
+ \fi
+ \@tempdimb=1000sp%
+ \setlength\@tempdima{\Gin@scalex\@tempdimb}%
+ \special{#1 #2\space scaled \number\@tempdima}%
+}
+% \end{macrocode}
+% \subsection{Rotation}
+% This code was written when no unprotected postscript code was allowed;
+% it could almost certainly be rewritten now with `rawpostscript'.
+% \begin{macrocode}
+\def\Grot@start{\special{postscript
+ 0 0 transform
+ grestore
+ matrix currentmatrix
+ 3 1 roll
+ itransform
+ dup 3 -1 roll
+ dup 4 1 roll exch
+ translate
+ \Grot@angle\space neg rotate
+ neg exch neg exch translate
+ gsave}}
+\def\Grot@end{\special{postscript grestore setmatrix gsave}}
+% \end{macrocode}
+% \subsection{Colour}
+% This will only work for versions 1.6 and Version 1.7 uses `color2'.
+% \begin{macrocode}
+%<color3>\def\Gin@PS@raw#1{\special{rawpostscript #1}}
+%</textures>
+% \end{macrocode}
+%
+% \section{dvialw}
+% A \LaTeXe\ graphics driver file for dvialw, by Nelson Beebe
+% \begin{macrocode}
+%<*dvialw>
+% \end{macrocode}
+% \subsection{Rotation}
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \def\@tempa{!}%
+ \ifx\Gin@scaley\@tempa
+ \let\Gin@scaley\Gin@scalex
+ \else
+ \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
+ \fi
+ \ifGin@clip
+ \typeout{no clipping support in dvialw}%
+ \fi
+ \special{language "PS",
+ literal "\Gin@scalex\space
+ \Gin@scaley\space scale",
+ position = "bottom left",
+ include "#1\space"}%
+}
+%</dvialw>
+% \end{macrocode}
+% \section{emtex}
+% A \LaTeXe\ graphics driver file for Eberhard Mattes' emTeX
+% \begin{macrocode}
+%<*emtex>
+% \end{macrocode}
+% \subsection{Graphics file inclusion}
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+ \raise\Gin@req@height\hbox{\special{em:graph #1}}%
+\typeout{WARNING: emtex does not permit graphics to be scaled}%
+}
+%</emtex>
+% \end{macrocode}
+% \section{dvilaser/ps}
+% A \LaTeXe\ graphics driver file for Arbortext's dvilaser/ps
+% \begin{macrocode}
+%<*dvilaser>
+% \end{macrocode}
+%\subsection{Graphic file inclusion}
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+\ifGin@clip
+ \typeout{no clipping support in dvilaser/ps}%
+\fi
+\special{ps: epsfile #1\space \the\Gin@req@width}%
+}
+%</dvilaser>
+% \end{macrocode}
+% \section{psprint}
+% A \LaTeXe\ graphics driver file for Trevorrow's psprint
+% \begin{macrocode}
+%<*psprint>
+% \end{macrocode}
+%\subsection{Graphic file inclusion}
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \def\@tempa{!}%
+ \ifx\Gin@scaley\@tempa
+ \let\Gin@scaley\Gin@scalex
+ \else
+ \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
+ \fi
+ \ifGin@clip
+ \typeout{no clipping support in psprint}%
+ \fi
+ \special{#1\space
+ \Gin@scalex\space \Gin@scaley\space scale
+ \Gin@llx\space neg
+ \Gin@lly \space neg translate
+}%
+}
+%</psprint>
+% \end{macrocode}
+% \section{dvipsone}
+%
+% A \LaTeXe\ graphics driver file for Y\&Y's dvipsone
+% \begin{macrocode}
+%<*dvipsone>
+% \end{macrocode}
+%
+% \subsection{Graphic file inclusion}
+%
+% PostScript Files.
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \bgroup
+ \def\@tempa{!}%
+ \dimen@\Gin@req@width
+ \dimen@ii.1bp%
+ \divide\dimen@\dimen@ii
+ \@tempdima\Gin@req@height
+ \divide\@tempdima\dimen@ii
+ \special{PSfile="#1"\space
+ llx=\Gin@llx\space
+ lly=\Gin@lly\space
+ urx=\Gin@urx\space
+ ury=\Gin@ury\space
+ \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
+ \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
+ \ifGin@clip clip\fi}%
+ \egroup}
+% \end{macrocode}
+%
+% Tiff files.
+% \begin{macrocode}
+\def\Ginclude@tiff#1{%
+\message{<#1>}%
+ \special{insertimage: #1 \number\Gin@req@width\space
+ \number\Gin@req@height}}
+% \end{macrocode}
+%
+% Windows Metafiles.
+% \begin{macrocode}
+\def\Ginclude@wmf#1{%
+ \message{<#1>}%
+ \special{insertmf: #1 0 0 \number\Gin@req@width\space
+ \number\Gin@req@height}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gin@PS@raw#1{\special{ps: #1}}
+% \end{macrocode}
+%
+% \subsection{Rotation}
+% \begin{macrocode}
+\def\Grot@start{%
+ \special{ps: gsave currentpoint
+ currentpoint translate \Grot@angle\space
+ rotate neg exch neg exch translate}}
+\def\Grot@end{%
+ \special{ps: currentfont currentpoint grestore moveto setfont}}
+% \end{macrocode}
+%
+% \subsection{Scaling}
+% \begin{macrocode}
+\def\Gscale@start{\special{ps: currentpoint currentpoint translate
+ \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
+\def\Gscale@end{\special{ps: currentpoint currentpoint translate
+ 1 \Gscale@x\space div 1 \Gscale@y\space div scale
+ neg exch neg exch translate}}
+% \end{macrocode}
+%
+% \subsection{File Extensions}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
+\@namedef{Gin@rule@.clp}#1{{wmf}{}{#1}}
+% \end{macrocode}
+%
+% \section{Literal Postscript}
+%
+% Raw PostScript code, no save/restore.
+% \begin{macrocode}
+\def\Gin@PS@raw#1{\special{ps: #1}}
+% \end{macrocode}
+%
+% PostScript code, to be surrounded by save/restore by the driver.
+% Coordinate system standard PostScript, but with origin
+% at current (\TeX) position.
+% \begin{macrocode}
+\def\Gin@PS@restored#1{\special{" #1}}
+% \end{macrocode}
+%
+% PostScript code to be inserted in the Header section of the final
+% PostScript. Must be issued on the first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@literal@header#1{\AtBeginDvi{\special{headertext=#1}}}
+% \end{macrocode}
+%
+% Name of external file, the contents of which are to be inserted in
+% the Header section of the final PostScript. Must be issued on the
+% first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</dvipsone>
+% \end{macrocode}
+%
+% \section{dviwindo}
+% A \LaTeXe\ graphics driver file for Y\&Y's dviwindo.
+%
+% This driver now uses the same file as |dvipsone|.
+%
+% \section{dvitops}
+% A \LaTeXe\ graphics driver file for James Clark's dvitops
+% \begin{macrocode}
+%<*dvitops>
+% \end{macrocode}
+% \subsection{Rotation}
+% \begin{macrocode}
+\newcount\Grot@count
+\Grot@count=\@ne
+\def\Grot@start{\special{dvitops: origin
+ rot\the\@tempdima}%
+\special{dvitops: begin rot\the\Grot@count}}%
+\def\Grot@end{\special{dvitops: end}%
+\special{dvitops: rotate rot\the\Grot@count \space
+ \Grot@angle}%
+\global\advance\Grot@count by\@ne}%
+% \end{macrocode}
+% \subsection{Graphic file inclusion}
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+% These cause an arithmetic overflow, so I've commented them
+% out. Presumably they were there for some reason.
+% Any dvitops users out there??
+% \multiply\Gin@req@width by \@m
+% \multiply\Gin@req@height by \@m
+\ifGin@clip
+ \typeout{no clipping support in dvitops}%
+\fi
+\special{import #1\space \the\Gin@req@width\space
+ \the\Gin@req@height\space fill}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</dvitops>
+% \end{macrocode}
+%
+%\section{dvi2ps}
+% A \LaTeXe\ graphics driver file for original dvi2ps
+% \begin{macrocode}
+%<*dvi2ps>
+% \end{macrocode}
+%
+% \subsection{Graphic file inclusion}
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \def\@tempa{!}%
+ \ifx\Gin@scaley\@tempa
+ \let\Gin@scaley\Gin@scalex
+ \else
+ \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
+ \fi
+ \ifGin@clip
+ \typeout{no clipping support in dvi2ps}%
+ \fi
+ \special{psfile=#1\space
+ hscale=\Gin@scalex\space 1000 mul
+ vscale=\Gin@scaley\space 1000 mul}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</dvi2ps>
+% \end{macrocode}
+%
+% \section{pctexps}
+% A \LaTeXe\ graphics driver file for Personal TeX's PTI Laser/PS;
+% from information supplied by Lance Carnes and Tao Wang
+% |<pti@crl.com>|.
+% \begin{macrocode}
+%<*pctexps>
+% \end{macrocode}
+%
+% \subsection{Graphic file inclusion}
+%
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support in pctexps}%
+ \fi
+ \Gin@req@width.03515\Gin@req@width
+ \Gin@req@height.03515\Gin@req@height
+ \special{ps:#1\space x=\strip@pt\Gin@req@width cm,
+ y=\strip@pt\Gin@req@height cm}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Ginclude@ps#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support in pctexps}%
+ \fi
+ \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{ps:#1}}}%
+ \typeout{^^J%
+---------------------------------------------------------^^J%
+.ps graphics without bounding box information cannot be^^J%
+scaled. If the file actually contains the information,^^J%
+please rename the file to .eps file extension.^^J%
+---------------------------------------------------------^^J}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gin@extensions{.eps,.ps}
+\@namedef{Gin@rule@.ps}#1{{ps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gin@PS@raw#1{\special{ps::#1}}
+\def\Grot@start{%
+ \special{ps::gsave currentpoint
+ currentpoint translate \Grot@angle\space
+ rotate neg exch neg exch translate}}
+\def\Grot@end{\special{ps:: currentpoint grestore moveto}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gscale@start{\special{ps:: currentpoint currentpoint translate
+ \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
+\def\Gscale@end{\special{ps:: currentpoint currentpoint translate
+ 1 \Gscale@x\space div 1 \Gscale@y\space div scale
+ neg exch neg exch translate}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pctexps>
+% \end{macrocode}
+%
+% \section{pctex32}
+% A \LaTeXe\ graphics driver file for Personal TeX's PC TeX for 32 bit
+% Windows; Code supplied by Tao Wang |<pti@crl.com>|.
+%
+% \subsection{Colour}
+% Uses the generic `color1' code.
+%
+% \begin{macrocode}
+%<*pctex32>
+% \end{macrocode}
+%
+% \subsection{Graphic file inclusion}%
+% \begin{macrocode}
+% including PostScript graphics
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \bgroup
+ \def\@tempa{!}%
+ \dimen@\Gin@req@width
+ \dimen@ii.1bp%
+ \divide\dimen@\dimen@ii
+ \@tempdima\Gin@req@height
+ \divide\@tempdima\dimen@ii
+ \special{PSfile="#1"\space
+ llx=\Gin@llx\space
+ lly=\Gin@lly\space
+ urx=\Gin@urx\space
+ ury=\Gin@ury\space
+ \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
+ \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
+ \ifGin@clip clip\fi}%
+ \egroup}
+% \end{macrocode}
+%
+% including BMP graphics
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support for BMP graphics in PCTeX32}%
+ \fi
+ \Gin@req@width.03515\Gin@req@width
+ \Gin@req@height.03515\Gin@req@height
+ \special{bmp:#1\space x=\strip@pt\Gin@req@width cm,
+ y=\strip@pt\Gin@req@height cm}}
+% \end{macrocode}
+%
+% including WMF graphics
+% \begin{macrocode}
+\def\Ginclude@wmf#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support for WMF graphics in PCTeX32}%
+ \fi
+ \Gin@req@width.03515\Gin@req@width
+ \Gin@req@height.03515\Gin@req@height
+ \special{wmf:#1\space x=\strip@pt\Gin@req@width cm,
+ y=\strip@pt\Gin@req@height cm}}
+% \end{macrocode}
+%
+% \subsection{Scaling and Rotating}
+% PostScript rotation and scaling
+% \begin{macrocode}
+\def\Grot@start{%
+ \special{ps:: gsave currentpoint
+ currentpoint translate \Grot@angle\space neg
+ rotate neg exch neg exch translate}}
+\def\Grot@end{\special{ps:: currentpoint grestore moveto}}
+\def\Gscale@start{\special{ps:: currentpoint currentpoint translate
+ \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
+\def\Gscale@end{\special{ps:: currentpoint currentpoint translate
+ 1 \Gscale@x\space div 1 \Gscale@y\space div scale
+ neg exch neg exch translate}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gin@PS@raw#1{\special{ps:: #1}}
+\def\Gin@PS@restored#1{\special{" #1}}
+% \end{macrocode}
+%
+% \subsection{Default Extensions}
+%
+% \begin{macrocode}
+\def\Gin@extensions{.eps,.ps,.wmf,.bmp}
+\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+\@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
+\@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pctex32>
+% \end{macrocode}
+%
+% \section{pctexwin}
+% A \LaTeXe\ graphics driver file for Personal TeX's PC TeX for Windows;
+% from information supplied by Lance Carnes and Tao Wang
+% |<pti@crl.com>|.
+% \begin{macrocode}
+%<*pctexwin>
+% \end{macrocode}
+%
+% \subsection{Graphic file inclusion}
+%
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support in pctexwin}%
+ \fi
+ \Gin@req@width.03515\Gin@req@width
+ \Gin@req@height.03515\Gin@req@height
+ \special{eps:#1\space x=\strip@pt\Gin@req@width cm,
+ y=\strip@pt\Gin@req@height cm}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Ginclude@ps#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support in pctexwin}%
+ \fi
+ \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{ps:#1}}}%
+ \typeout{^^J%
+---------------------------------------------------------^^J%
+.ps graphics without bounding box information cannot be^^J%
+scaled. If the file actually contains the information,^^J%
+please rename the file to .eps file extension.^^J%
+---------------------------------------------------------^^J%
+}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support in pctexwin}%
+ \fi
+ \Gin@req@width.03515\Gin@req@width
+ \Gin@req@height.03515\Gin@req@height
+ \special{bmp:#1\space x=\strip@pt\Gin@req@width cm,
+ y=\strip@pt\Gin@req@height cm}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Ginclude@wmf#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support in pctexwin}%
+ \fi
+ \Gin@req@width.03515\Gin@req@width
+ \Gin@req@height.03515\Gin@req@height
+ \special{wmf:#1\space x=\strip@pt\Gin@req@width cm,
+ y=\strip@pt\Gin@req@height cm}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gin@extensions{.eps,.ps,.wmf,.bmp}
+\@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
+\@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
+\@namedef{Gin@rule@.ps}#1{{ps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pctexwin>
+% \end{macrocode}
+%
+% \section{pctexhp}
+% A \LaTeXe\ graphics driver file for Personal TeX's PTI Laser/HP;
+% from information supplied by Lance Carnes and Tao Wang
+% |<pti@crl.com>|.
+% \begin{macrocode}
+%<*pctexhp>
+% \end{macrocode}
+% \subsection{Graphic file inclusion}
+% \begin{macrocode}
+\def\Ginclude@pcl#1{%
+\message{<#1>}%
+ \ifGin@clip
+ \typeout{no clipping support in pctexhp}%
+ \fi
+ \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{pcl:#1}}}%
+ \typeout{WARNING: pctexhp does not permit graphics to be scaled}}
+\@namedef{Gin@rule@.pcl}#1{{pcl}{}{#1}}
+\def\Gin@extensions{.pcl}
+%</pctexhp>
+% \end{macrocode}
+%
+% \section{pubps}
+% A \LaTeXe\ graphics driver file for Arbortext's PUBps;
+% information from Peter R Wilson |pwilson@rdrc.rpi.edu|.
+% \begin{macrocode}
+%<*pubps>
+% \end{macrocode}
+% \subsection{Rotation}
+% \begin{macrocode}
+\def\Grot@start{\special{ps: gsave currentpoint
+ currentpoint translate \Grot@angle\space
+ rotate neg exch neg exch translate}}
+\def\Grot@end{\special{ps: currentpoint grestore moveto}}
+%</pubps>
+% \end{macrocode}
+%
+% \section{dviwin}
+% A \LaTeXe\ graphics driver file for Hippocrates Sendoukas' dviwin
+% \begin{macrocode}
+%<*dviwin>
+% \end{macrocode}
+% \subsection{Graphic file inclusion}
+% Dviwin sorts out the graphics type itself based on extension.
+% They all use the same |\special|, so as far as graphics.sty is
+% concerned they are all the same `type'. Use `bmp' for the type
+% as that is as good a name as any. Make this the default.
+% \begin{macrocode}
+\@namedef{Gin@rule@*}#1{{bmp}{}{#1}}
+\def\Ginclude@bmp#1{%
+ \raise\Gin@req@height\hbox{%
+ \special{anisoscale #1,
+ \the\Gin@req@width\space \the\Gin@req@height}}}
+% \end{macrocode}
+% The only exception is EPS files, as they may be read for BoundingBox
+% \begin{macrocode}
+\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+\let\Ginclude@eps\Ginclude@bmp
+% \end{macrocode}
+% Add a few default extensions so |\includegraphics{a}|
+% will pick up |a.eps| or |a.wmf|.
+% This list can be reset with |\DeclareGraphicsExtensions|.
+% Other extensions not in the list may be used explicitly, eg
+% |\includegraphics{a.gif}| should work as long as dviwin has access
+% to a gif filter. If |.gif| is added using |\DeclareGraphicsExtensions|
+% then |\includegraphics{a}| would also find |a.gif|.
+% \begin{macrocode}
+\def\Gin@extensions{.eps,.ps,.wmf,.tif}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</dviwin>
+% \end{macrocode}
+%
+% \section{ln}
+% A \LaTeXe\ graphics driver file for B Hamilton Kelly's ln03 driver.
+% Untested, but based on the graphics macros distributed with the
+% driver.
+% \begin{macrocode}
+%<*ln>
+% \end{macrocode}
+% \subsection{Graphic file inclusion}
+% \begin{macrocode}
+\def\Ginclude@sixel#1{\special{ln03:sixel #1}}
+%</ln>
+% \end{macrocode}
+%
+% \section{truetex}
+% A \LaTeXe\ graphics driver file for Kinch `truetex' driver.
+% \begin{macrocode}
+%<*truetex>
+% \end{macrocode}
+%
+% \subsection{Colour}
+% Uses the `color4' colour code.
+%
+% \subsection{Graphic file inclusion}
+%
+% EPS File inclusion: DVIPS style.
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \bgroup
+ \def\@tempa{!}%
+ \dimen@\Gin@req@width
+ \dimen@ii.1bp%
+ \divide\dimen@\dimen@ii
+ \@tempdima\Gin@req@height
+ \divide\@tempdima\dimen@ii
+ \special{PSfile="#1"\space
+ llx=\Gin@llx\space
+ lly=\Gin@lly\space
+ urx=\Gin@urx\space
+ ury=\Gin@ury\space
+ \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
+ \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
+ \ifGin@clip clip\fi}%
+ \egroup}
+% \end{macrocode}
+%
+% bmp File Inclusion.
+% \begin{macrocode}
+\def\Ginclude@bmp#1{%
+ \message{<#1>}%
+ \special{bmpfile #1}}
+% \end{macrocode}
+%
+% tif(f) File inclusion
+% \begin{macrocode}
+\def\Ginclude@tiff#1{%
+ \message{<#1>}%
+ \special{tifffile #1}}
+% \end{macrocode}
+%
+% \subsection{Literal PostScript}
+% This is not supported, so uses `nops' code.
+%
+% \subsection{Default Rules}
+% Support (e)ps, tif and bmp, default to eps.
+% \begin{macrocode}
+\def\Gin@extensions{.eps,.ps}
+\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+\@namedef{Gin@rule@.tif}#1{{tiff}{}{#1}}
+\@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</truetex>
+% \end{macrocode}
+%
+% \section{tcidvi}
+% A \LaTeXe\ graphics driver file for Scientific Word/Workplace.
+% Actually for the Kinch truetex driver, augmented with extra
+% |\special| handling with the DLL supplied with SW.
+% \begin{macrocode}
+%<*tcidvi>
+% \end{macrocode}
+%
+% \subsection{Colour}
+% Uses the `color4' colour code.
+%
+% The above colours are handled by the Kinch-supplied dll
+% The TCI dll adds support for |\colorbox|, but only grey scale
+% The code below accepts any color model, but only the red
+% component is used.
+% \begin{macrocode}
+\AtBeginDocument{\def\color@block#1#2#3{%
+ {\rlap{\ifcolors@
+ \@defaultunits\count@\current@color\@nnil
+ \dimen@\count@\p@
+ \divide\dimen@\@cclv
+ \dimen@ii#2%
+ \advance\dimen@ii#3%
+ \lower#3\hbox{%
+ \special{language "Scientific Word";%
+ type "greybox";%
+ greyscale \strip@pt\dimen@;%
+ height \the\dimen@ii;%
+ width \the#1;%
+ depth 0pt;}}%
+ \fi}}}}
+% \end{macrocode}
+%
+% \subsection{Graphic file inclusion}
+%
+% EPS File inclusion.
+% \begin{macrocode}
+\def\Ginclude@eps#1{%
+ \message{<#1>}%
+ \raise\Gin@req@height\hbox{%
+% \end{macrocode}
+%
+% If the bounding box has been changed by a trim or viewport
+% key then need to calculate the crop ratios based on the original
+% bb coordinates. (This assumes that clip key is also used).
+% \begin{macrocode}
+ \ifx\Gin@ollx\@undefined
+ \else
+ \@tempdimb \Gin@ourx bp%
+ \advance\@tempdimb-\Gin@ollx bp%
+ \@tempdima\Gin@llx bp%
+ \advance\@tempdima-\Gin@ollx bp%
+ \Gscale@div\TCI@cropleft\@tempdima\@tempdimb
+ \@tempdima\Gin@urx bp%
+ \advance\@tempdima-\Gin@ollx bp%
+ \Gscale@div\TCI@cropright\@tempdima\@tempdimb
+ \@tempdimb \Gin@oury bp%
+ \advance\@tempdimb-\Gin@olly bp%
+ \@tempdima\Gin@lly bp%
+ \advance\@tempdima-\Gin@olly bp%
+ \Gscale@div\TCI@cropbottom\@tempdima\@tempdimb
+ \@tempdima\Gin@ury bp%
+ \advance\@tempdima-\Gin@olly bp%
+ \Gscale@div\TCI@croptop\@tempdima\@tempdimb
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \special{%
+ language \TCI@language;%
+ type \TCI@type;%
+ valid_file \TCI@validfile;%
+ width \the\Gin@req@width;%
+ height \the\Gin@req@height;%
+ depth 0pt;%
+ original-width \the\Gin@nat@width;%
+ original-height \the\Gin@nat@height;%
+ cropleft "\TCI@cropleft";%
+ croptop "\TCI@croptop";%
+ cropright "\TCI@cropright";%
+ cropbottom "\TCI@cropbottom";%
+ filename '#1';%
+ \ifx\TCI@temp\@empty\else tempfilename \TCI@temp;\fi
+ }}}
+% \end{macrocode}
+%
+% Default values so documents produced elsewhere should work
+% \begin{macrocode}
+\def\TCI@language{"Scientific Word"}
+\def\TCI@type{"GRAPHIC"}
+\def\TCI@validfile{'F'}
+\def\TCI@cropleft{0}
+\def\TCI@croptop{1}
+\def\TCI@cropright{1}
+\def\TCI@cropbottom{0}
+\let\TCI@temp\@empty
+% \end{macrocode}
+%
+% Non PS Graphic files.
+%
+% File inclusion macro is always the same. Use a different name though
+% as LaTeX thinks it can read eps files for BoundingBox.
+% \begin{macrocode}
+\let\Ginclude@bmp\Ginclude@eps
+% \end{macrocode}
+%
+% \subsection{Literal PostScript}
+% This is not supported, so uses `nops' code.
+%
+% \subsection{Default Rules}
+% SW always gives the full name with extension.
+% So leave this list empty.
+% \begin{macrocode}
+\def\Gin@extensions{}
+% \end{macrocode}
+%
+% .ps .PS .eps .EPS are (E)PS
+% rest are `bmp' which is a catch all type for anything
+% that the import filter can handle.
+% \begin{macrocode}
+\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+\@namedef{Gin@rule@.PS}#1{{eps}{.PS}{#1}}
+\@namedef{Gin@rule@.EPS}#1{{eps}{.EPS}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@*}#1{{bmp}{\Gin@ext}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</tcidvi>
+% \end{macrocode}
+%
+% \section{Literal Postscript}
+% Most drivers writing to PostScript allow some form of `literal'
+% PostScript |\special| that inserts code into the final PostScript
+% output. However Non-PS drivers can not support this (and some PS
+% one's can't either). The code here makes all these commands no ops.
+% Individual driver sections may define the commands to do something
+% useful.
+%
+% \begin{macrocode}
+%<*nops>
+% \end{macrocode}
+%
+% Raw PostScript code, no save/restore. Coordinate system unspecified.
+% \begin{macrocode}
+\def\Gin@PS@raw#1{}
+% \end{macrocode}
+%
+% PostScript code, to be surrounded by save/restore by the driver.
+% Coordinate system standard PostScript, but with origin
+% at current (\TeX) position.
+% \begin{macrocode}
+\def\Gin@PS@restored#1{}
+% \end{macrocode}
+%
+% PostScript code to be inserted in the Header section of the final
+% PostScript. Must be issued on the first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@literal@header#1{}
+% \end{macrocode}
+%
+% Name of external file, the contents of which are to be inserted in
+% the Header section of the final PostScript. Must be issued on the
+% first page of a document.
+% \begin{macrocode}
+\def\Gin@PS@file@header#1{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</nops>
+% \end{macrocode}
+%
+% \section{Graphics Inclusion Rules}
+% \begin{macrocode}
+%<*psrules>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gin@extensions{.eps,.ps}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</psrules>
+%<*psrulesZ>
+% \end{macrocode}
+%
+% \changes{v3.0j}{2014/04/23}
+% {add .mps for metapost generated postscript to match pdftex graphics/4050}
+% \begin{macrocode}
+\def\Gin@extensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z,.mps}
+% \end{macrocode}
+%
+% \changes{v3.0k}{2015/12/30}
+% {compressed files don't require gunzip for dvips/xdvi}
+% \begin{macrocode}
+\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
+\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+\@namedef{Gin@rule@.mps}#1{{eps}{.mps}{#1}}
+\@namedef{Gin@rule@.pz}#1{{eps}{.bb}{#1}}
+\@namedef{Gin@rule@.eps.Z}#1{{eps}{.eps.bb}{#1}}
+\@namedef{Gin@rule@.ps.Z}#1{{eps}{.ps.bb}{#1}}
+\@namedef{Gin@rule@.ps.gz}#1{{eps}{.ps.bb}{#1}}
+\@namedef{Gin@rule@.eps.gz}#1{{eps}{.eps.bb}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</psrulesZ>
+%<*dosrules>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<!psrulesZ>\def\Gin@extensions{.eps,.ps,.pcx,.bmp}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@namedef{Gin@rule@.pcx}#1{{bmp}{}{#1}}
+\@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
+\@namedef{Gin@rule@.msp}#1{{bmp}{}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</dosrules>
+%<*macrules>
+%\def\Gin@extensions{{},.ps,.eps,.pict}
+%\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
+%\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
+\@namedef{Gin@rule@.pict}#1{{pict}{}{#1}}
+\@namedef{Gin@rule@.pntg}#1{{pntg}{}{#1}}
+%\@namedef{Gin@rule@}#1{{pict}{\relax}{#1}}
+%</macrules>
+%<*tiffrules>
+\@namedef{Gin@rule@.tif}#1{{tiff}{}{#1}}
+%</tiffrules>
+% \end{macrocode}
+%
+% \Finale
+%
diff --git a/macros/latex-dev/required/graphics/drivers.pdf b/macros/latex-dev/required/graphics/drivers.pdf
new file mode 100644
index 0000000000..ef6a372bf5
--- /dev/null
+++ b/macros/latex-dev/required/graphics/drivers.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/epsfig.dtx b/macros/latex-dev/required/graphics/epsfig.dtx
new file mode 100644
index 0000000000..ba37d771cc
--- /dev/null
+++ b/macros/latex-dev/required/graphics/epsfig.dtx
@@ -0,0 +1,142 @@
+%
+% \iffalse
+%
+%% epsfig.dtx Copyright (C) 1994-1996 1999 Sebastian Rahtz
+%% Copyright (C) 2000--2015,2017 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3 or, at your option, any later version.
+%%
+%<*dtx>
+ \ProvidesFile{epsfig.dtx}
+%</dtx>
+%<package>\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+%<package>\ProvidesPackage{epsfig}
+%<driver> \ProvidesFile{epsfig.drv}
+% \fi
+% \ProvidesFile{epsfig.dtx}
+ [2017/06/25 v1.7b (e)psfig emulation (SPQR)]
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\begin{document}
+ \DocInput{epsfig.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{epsfig.dtx}
+%
+% \title{The \textsf{epsfig} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{Sebastian Rahtz\\latex-team@latex-project.org}
+% \date{\filedate}
+% \MaintainedByLaTeXTeam{graphics}
+% \maketitle
+%
+%
+% \StopEventually{}
+%
+% \section{Preface}
+% \begin{macrocode}
+%<*package>
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
+\ProcessOptions
+\RequirePackage{graphicx}
+% \end{macrocode}
+% \subsection{Emulation of `psfig' syntax}
+% Emulate "epsfig.sty", and most varieties of psfig
+% \begin{macro}{\psfig,\epsfig}
+% \begin{macrocode}
+\def\psfig#1{%
+ \let\Gin@ewidth\Gin@exclamation\let\Gin@eheight\Gin@ewidth
+ \def\Gin@req@sizes{%
+ \def\Gin@scalex{1}\let\Gin@scaley\Gin@exclamation
+ \Gin@req@height\Gin@nat@height
+ \Gin@req@width\Gin@nat@width}%
+ \begingroup
+ \let\Gfigname\relax
+ \@tempswafalse
+ \toks@{\Ginclude@graphics{\Gfigname}}%
+ \setkeys{Gin}{#1}%
+ \Gin@esetsize
+ \ifx\Gfigname\relax\ErrorNoFile\else
+ \the\toks@
+ \fi
+ \endgroup}
+\define@key{Gin}{figure}{\def\Gfigname{#1}}
+\define@key{Gin}{file}{\def\Gfigname{#1}}
+\define@key{Gin}{prolog}{\typeout{epsfig: header files are not needed}}
+\define@key{Gin}{silent}[]{}
+\def\psdraft{\Gin@drafttrue}
+\def\psfull{\Gin@draftfalse}
+\def\pssilent{\typeout{epsfig option `silent' ignored}}
+\def\psnoisy{\typeout{epsfig option `noisy' ignored}}
+\let\epsfig\psfig
+\def\psfigdriver#1{\makeatletter\input{#1.def}\makeatother}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Emulation of `epsf' syntax}
+% Emulate Rokicki's "epsf.tex" supplied with the ever-popular dvips.
+% \begin{macro}{\epsfbox,\epsffile}
+% \begin{macrocode}
+\newdimen\epsfxsize
+\newdimen\epsfysize
+\epsfysize\z@
+\epsfxsize\z@
+\def\epsfsize#1#2{\epsfxsize}
+\def\epsfbox{%
+ \@ifnextchar[%
+ {\Gin@bboxtrue\epsf@bb@box}%
+ {\Gin@bboxfalse\epsf@box}%
+}
+\def\epsf@bb@box[#1#2]{%
+ \expandafter\Gread@parse@bb#1#2 \\
+ \epsf@box}
+\def\epsf@box#1{%
+ \bgroup
+ \def\Gin@req@sizes{%
+ \epsfxsize\epsfsize{\Gin@nat@width}{\Gin@nat@height}%
+ \ifdim\epsfxsize=\z@
+ \ifdim\epsfysize=\z@
+ \Gin@req@height\Gin@nat@height
+ \Gin@req@width\Gin@nat@width
+ \else
+ \let\Gin@scalex\Gin@exclamation
+ \Gin@req@height\epsfysize
+ \Gscale@div\Gin@scaley\Gin@req@height\Gin@nat@height
+ \Gin@req@width\Gin@scaley\Gin@nat@width
+ \fi
+ \else
+ \Gin@req@width\epsfxsize
+ \Gscale@div\Gin@scalex\Gin@req@width\Gin@nat@width
+ \ifdim\epsfysize=\z@
+ \let\Gin@scaley\Gin@exclamation
+ \Gin@req@height\Gin@scalex\Gin@nat@height
+ \else
+ \Gin@req@height\epsfysize
+ \Gscale@div\Gin@scaley\Gin@req@height\Gin@nat@height
+ \fi
+ \fi
+ }%
+ \Ginclude@graphics{#1}%
+ \egroup
+ \epsfysize\z@
+ \epsfxsize\z@
+}
+\let\epsffile\epsfbox
+\def\epsfclipon{\Gin@cliptrue}
+\def\epsfclipoff{\Gin@clipfalse}
+\def\epsfverbosetrue{\typeout{epsf verbose option ignored}}
+\def\epsfverbosefalse{\typeout{epsf verbose option ignored}}
+%</package>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%
+
diff --git a/macros/latex-dev/required/graphics/epsfig.pdf b/macros/latex-dev/required/graphics/epsfig.pdf
new file mode 100644
index 0000000000..3aa7fcff62
--- /dev/null
+++ b/macros/latex-dev/required/graphics/epsfig.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/graphics-2017-06-25.sty b/macros/latex-dev/required/graphics/graphics-2017-06-25.sty
new file mode 100644
index 0000000000..361193cf32
--- /dev/null
+++ b/macros/latex-dev/required/graphics/graphics-2017-06-25.sty
@@ -0,0 +1,526 @@
+%%
+%% This is file `graphics.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% graphics.dtx (with options: `package')
+%%
+%% The source is maintained by the LaTeX Project team and bug
+%% reports for it can be opened at https://latex-project.org/bugs/
+%% (but please observe conditions on bug reports sent to that address!)
+%%
+%%
+%% graphics.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz
+%% Copyright (C) 1995--2017 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesPackage{graphics}
+ [2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)]
+\edef\Gin@codes{%
+ \catcode`\noexpand\^^A\the\catcode`\^^A\relax
+ \catcode`\noexpand\"\the\catcode`\"\relax
+ \catcode`\noexpand\*\the\catcode`\*\relax
+ \catcode`\noexpand\!\the\catcode`\!\relax
+ \catcode`\noexpand\:\the\catcode`\:\relax}
+\catcode`\^^A=\catcode`\%
+\@makeother\"%
+\catcode`\*=11
+\@makeother\!%
+\@makeother\:%
+\RequirePackage{trig}
+\providecommand\Grot@start{\@latex@error{Rotation not supported}\@ehc
+ \global\let\Grot@start\relax}
+\providecommand\Grot@end{}
+\providecommand\Gscale@start{\@latex@error{Scaling not supported}\@ehc
+ \global\let\Gscale@start\relax}
+\providecommand\Gscale@end{}
+\edef\Gread@BBox{\@percentchar\@percentchar BoundingBox}
+\DeclareOption{draft}{\Gin@drafttrue}
+\DeclareOption{final}{\Gin@draftfalse}
+\newif\ifGin@draft
+\DeclareOption{hiresbb}{%
+ \edef\Gread@BBox{\@percentchar\@percentchar HiResBoundingBox}}
+\DeclareOption{demo}{%
+ \AtBeginDocument{%
+ \def\Ginclude@graphics#1{%
+ \rule{\@ifundefined{Gin@@ewidth}{150pt}{\Gin@@ewidth}}%
+ {\@ifundefined{Gin@@eheight}{100pt}{\Gin@@eheight}}}}}
+\newif\ifGin@setpagesize\Gin@setpagesizetrue
+\DeclareOption{setpagesize}{\Gin@setpagesizetrue}
+\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse}
+\providecommand\Gin@driver{}
+\DeclareOption{dvips}{\def\Gin@driver{dvips.def}}
+\DeclareOption{xdvi}{\ExecuteOptions{dvips}}
+\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
+\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfmx.def}}
+\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
+\DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
+\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
+\DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
+\DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}}
+\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
+\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
+\DeclareOption{emtex}{\def\Gin@driver{emtex.def}}
+\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}}
+\DeclareOption{oztex}{\ExecuteOptions{dvips}}
+\DeclareOption{textures}{\def\Gin@driver{textures.def}}
+\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
+\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}}
+\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}}
+\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
+\DeclareOption{truetex}{\def\Gin@driver{truetex.def}}
+\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}}
+\DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
+\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout}
+\InputIfFileExists{graphics.cfg}{}{}
+\DeclareOption{hiderotate}{%
+ \def\Grot@start{\begingroup\setbox\z@\hbox\bgroup}
+ \def\Grot@end{\egroup\endgroup}}
+\DeclareOption{hidescale}{%
+ \def\Gscale@start{\begingroup\setbox\z@\hbox\bgroup}
+ \def\Gscale@end{\egroup\endgroup}}
+\ProcessOptions
+\if!\Gin@driver!
+ \PackageError{graphics}
+ {No driver specified}
+ {You should make a default driver option in a file \MessageBreak
+ graphics.cfg\MessageBreak
+ eg: \protect\ExecuteOptions{textures}%
+ }
+\else
+ \PackageInfo{graphics}{Driver file: \Gin@driver}
+ \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
+\fi
+\def\Gin@llx{0}
+\let\Gin@lly\Gin@llx
+\let\Gin@urx\Gin@llx
+\let\Gin@ury\Gin@llx
+\let\Gin@nat@width\leftmarginv
+\let\Gin@nat@height\leftmarginvi
+\newif\ifGin@clip
+\newcommand\DeclareGraphicsExtensions[1]{%
+ \edef\Gin@extensions{\zap@space#1 \@empty}}
+\providecommand\Gin@extensions{}
+\def\includegraphics{%
+ \leavevmode
+ \@ifstar
+ {\Gin@cliptrue\Gin@i}%
+ {\Gin@clipfalse\Gin@i}}
+\def\Gin@i{%
+ \@ifnextchar[%]
+ \Gin@ii
+ {\Gin@bboxfalse\Ginclude@graphics}}
+\def\Gin@ii[#1]{%
+ \@ifnextchar[%]
+ {\Gin@iii[#1]}
+ {\Gin@iii[0,0][#1]}}
+\def\Gin@iii[#1,#2][#3,#4]#5{%
+ \begingroup
+ \Gin@bboxtrue
+ \Gin@defaultbp\Gin@llx{#1}%
+ \Gin@defaultbp\Gin@lly{#2}%
+ \Gin@defaultbp\Gin@urx{#3}%
+ \Gin@defaultbp\Gin@ury{#4}%
+ \Ginclude@graphics{#5}%
+ \endgroup}
+\def\Gin@defaultbp#1#2{%
+ \afterassignment\Gin@def@bp\dimen@#2bp\relax{#1}{#2}}
+\def\Gin@def@bp#1\relax#2#3{%
+ \if!#1!%
+ \def#2{#3}%
+ \else
+ \dimen@.99626\dimen@
+ \edef#2{\strip@pt\dimen@}%
+ \fi}
+\def\DeclareGraphicsRule#1#2#3#4{%
+ \edef\@tempa{\string *}\def\@tempb{#3}%
+ \expandafter\edef\csname Gin@rule@#1\endcsname##1%
+ {{#2}%
+ {\ifx\@tempa\@tempb\noexpand\Gin@ext\else#3\fi}%
+ {\ifx\indent#4\indent##1\else#4\fi}}}
+\def\graphicspath#1{\def\Ginput@path{#1}}
+\ifx\Ginput@path\@undefined
+ \let\Ginput@path\input@path
+\fi
+\def\Gin@getbase#1{%
+ \edef\Gin@tempa{%
+ \def\noexpand\@tempa####1#1\space{%
+ \def\noexpand\Gin@base{####1}}}%
+ \IfFileExists{\filename@area\filename@base#1}%
+ {\Gin@tempa
+ \expandafter\@tempa\@filef@und
+ \edef\Gin@ext{#1}}{}}%
+\let\Gin@ext\relax
+\def\Gin@sepdefault{.}
+\def\Ginclude@graphics#1{%
+ \begingroup
+ \let\input@path\Ginput@path
+ \filename@parse{#1}%
+ \ifx\filename@ext\relax
+ \@for\Gin@temp:=\Gin@extensions\do{%
+ \ifx\Gin@ext\relax
+ \Gin@getbase\Gin@temp
+ \fi}%
+ \else
+ \Gin@getbase{\Gin@sepdefault\filename@ext}%
+ \ifx\Gin@ext\relax
+ \@warning{File `#1' not found}%
+ \def\Gin@base{\filename@area\filename@base}%
+ \edef\Gin@ext{\Gin@sepdefault\filename@ext}%
+ \fi
+ \fi
+ \ifx\Gin@ext\relax
+ \@latex@error{File `#1' not found}%
+ {I could not locate the file with any of these extensions:^^J%
+ \Gin@extensions^^J\@ehc}%
+ \else
+ \@ifundefined{Gin@rule@\Gin@ext}%
+ {\ifx\Gin@rule@*\@undefined
+ \@latex@error{Unknown graphics extension: \Gin@ext}\@ehc
+ \else
+ \expandafter\Gin@setfile\Gin@rule@*{\Gin@base\Gin@ext}%
+ \fi}%
+ {\expandafter\expandafter\expandafter\Gin@setfile
+ \csname Gin@rule@\Gin@ext\endcsname{\Gin@base\Gin@ext}}%
+ \fi
+ \endgroup}
+\newif\ifGread@\Gread@true
+\def\Gin@setfile#1#2#3{%
+ \ifx\\#2\\\Gread@false\fi
+ \ifGin@bbox\else
+ \ifGread@
+ \csname Gread@%
+ \expandafter\ifx\csname Gread@#1\endcsname\relax
+ eps%
+ \else
+ #1%
+ \fi
+ \endcsname{\Gin@base#2}%
+ \else
+ \Gin@nosize{#3}%
+ \fi
+ \fi
+ \Gin@viewport@code
+ \Gin@nat@height\Gin@ury bp%
+ \advance\Gin@nat@height-\Gin@lly bp%
+ \Gin@nat@width\Gin@urx bp%
+ \advance\Gin@nat@width-\Gin@llx bp%
+ \Gin@req@sizes
+ \expandafter\ifx\csname Ginclude@#1\endcsname\relax
+ \Gin@drafttrue
+ \expandafter\ifx\csname Gread@#1\endcsname\relax
+ \@latex@error{Can not include graphics of type: #1}\@ehc
+ \global\expandafter\let\csname Gread@#1\endcsname\@empty
+ \fi
+ \fi
+ \leavevmode
+ \ifGin@draft
+ \hb@xt@\Gin@req@width{%
+ \vrule\hss
+ \vbox to \Gin@req@height{%
+ \hrule \@width \Gin@req@width
+ \vss
+ \edef\@tempa{#3}%
+ \rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}%
+ \vss
+ \hrule}%
+ \hss\vrule}%
+ \else
+ \@addtofilelist{#3}%
+ \ProvidesFile{#3}[Graphic file (type #1)]%
+ \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}%
+ \dp\z@\z@
+ \ht\z@\Gin@req@height
+ \wd\z@\Gin@req@width
+ \box\z@
+ \fi}
+\let\Gin@decode\@empty
+\def\Gin@exclamation{!}
+\let\Gin@page\@empty
+\def\Gin@pagebox{cropbox}
+\newif\ifGin@interpolate
+\let\Gin@log\wlog
+\let\Gin@req@sizes\relax
+\def\Gin@scalex{1}%
+\let\Gin@scaley\Gin@exclamation
+\let\Gin@req@height\Gin@nat@height
+\let\Gin@req@width\Gin@nat@width
+\let\Gin@viewport@code\relax
+\def\Gin@nosize#1{%
+ \@latex@error
+ {Cannot determine size of graphic in #1 (no size specified)}%
+ \@ehc}
+\newif\ifGin@bbox
+\def\Gread@generic#1#2{%
+ \edef\Gread@attr@hash{%
+ \ifx\Gin@pagebox\@empty\else
+ :\Gin@pagebox
+ \fi
+ \ifx\Gin@page\@empty\else
+ :P\Gin@page
+ \fi
+ }%
+ \@ifundefined{#1 bbox\Gread@attr@hash}%
+ {\Gread@generic@aux{#1}{#2}}
+ {%
+ \expandafter\global\expandafter\let\expandafter\@gtempa
+ \csname #1 bbox\Gread@attr@hash\endcsname
+ }%
+ \expandafter\Gread@parse@bb\@gtempa\\%
+}
+\def\Gread@generic@aux#1#2{%
+ \begingroup
+ \@tempcnta\z@
+ \loop\ifnum\@tempcnta<\@xxxii
+ \catcode\@tempcnta14 %
+ \advance\@tempcnta\@ne
+ \repeat
+ \catcode`\^^?14 %
+ \let\do\@makeother
+ \dospecials
+ \catcode`\ 10 %
+ \catcode`\^^I10 %
+ \catcode\endlinechar5 %
+ \@makeother\:%
+ \@makeother\-%
+ \immediate\openin\@inputcheck"#1" %
+ #2{#1}%
+ \ifGin@bbox
+ \expandafter\xdef\csname #1 bbox\Gread@attr@hash\endcsname{\@gtempa}%
+ \else
+ \@latex@error
+ {Cannot determine size of graphic in #1 (no BoundingBox)}%
+ \@ehc
+ \gdef\@gtempa{0 0 72 72 }%
+ \fi
+ \endgroup
+}
+\def\Gread@eps#1{%
+ \Gread@generic{#1}\Gread@eps@aux
+}
+\def\Gread@eps@aux#1{%
+ \ifeof\@inputcheck
+ \@latex@error{File `#1' not found}\@ehc
+ \else
+ \Gread@true
+ \let\@tempb\Gread@false
+ \loop
+ \read\@inputcheck to\@tempa
+ \ifeof\@inputcheck
+ \Gread@false
+ \else
+ \expandafter\Gread@find@bb\@tempa:.\\%
+ \fi
+ \ifGread@
+ \repeat
+ \immediate\closein\@inputcheck
+ \fi
+}
+\long\def\Gread@find@bb#1:#2#3\\{%
+ \def\@tempa{#1}%
+ \ifx\@tempa\Gread@BBox
+ \Gread@test@atend#2#3()\\%
+ \fi}
+\def\Gread@test@atend#1(#2)#3\\{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\Gread@atend
+ \Gread@true
+ \let\@tempb\relax
+ \else
+ \gdef\@gtempa{#1}%
+ \@tempb
+ \Gin@bboxtrue
+ \fi}
+\def\Gread@parse@bb#1 #2 #3 #4 #5\\{%
+ \Gin@defaultbp\Gin@llx{#1}%
+ \Gin@defaultbp\Gin@lly{#2}%
+ \Gin@defaultbp\Gin@urx{#3}%
+ \Gin@defaultbp\Gin@ury{#4}}%
+\def\Gread@atend{atend}
+\let\Grot@height\@ovxx
+\let\Grot@left\@ovyy
+\let\Grot@right\@ovdx
+\let\Grot@depth\@ovdy
+\let\Grot@l\@ovro
+\let\Grot@r\@ovri
+\let\Grot@h\@xdim
+\let\Grot@d\@ydim
+\let\Grot@x\@linelen
+\let\Grot@y\@dashdim
+\long\def\rotatebox#1#2{%
+ \leavevmode
+ \Grot@setangle{#1}%
+ \setbox\z@\hbox{{#2}}%
+ \Grot@x\z@
+ \Grot@y\z@
+ \Grot@box}
+\def\Grot@setangle#1{\edef\Grot@angle{#1}}
+\def\Grot@Px#1#2#3{%
+ #1\Grot@cos#2%
+ \advance#1-\Grot@sin#3}
+\def\Grot@Py#1#2#3{%
+ #1\Grot@sin#2%
+ \advance#1\Grot@cos#3}
+\def\Grot@box{%
+ \begingroup
+ \CalculateSin\Grot@angle
+ \CalculateCos\Grot@angle
+ \edef\Grot@sin{\UseSin\Grot@angle}%
+ \edef\Grot@cos{\UseCos\Grot@angle}%
+^^A \GDebug{Rotate: angle \Grot@angle, sine is \Grot@sin,
+^^A cosine is \Grot@cos}%
+ \Grot@r\wd\z@ \advance\Grot@r-\Grot@x
+ \Grot@l\z@ \advance\Grot@l-\Grot@x
+ \Grot@h\ht\z@ \advance\Grot@h-\Grot@y
+ \Grot@d-\dp\z@ \advance\Grot@d-\Grot@y
+ \ifdim\Grot@sin\p@>\z@
+ \ifdim\Grot@cos\p@>\z@
+ \Grot@Py\Grot@height \Grot@r\Grot@h%B
+ \Grot@Px\Grot@right \Grot@r\Grot@d%E
+ \Grot@Px\Grot@left \Grot@l\Grot@h%C
+ \Grot@Py\Grot@depth \Grot@l\Grot@d%D
+ \else
+ \Grot@Py\Grot@height \Grot@r\Grot@d%E
+ \Grot@Px\Grot@right \Grot@l\Grot@d%D
+ \Grot@Px\Grot@left \Grot@r\Grot@h%B
+ \Grot@Py\Grot@depth \Grot@l\Grot@h%C
+ \fi
+ \else
+ \ifdim\Grot@cos\p@<\z@
+ \Grot@Py\Grot@height \Grot@l\Grot@d%D
+ \Grot@Px\Grot@right \Grot@l\Grot@h%C
+ \Grot@Px\Grot@left \Grot@r\Grot@d%E
+ \Grot@Py\Grot@depth \Grot@r\Grot@h%B
+ \else
+ \Grot@Py\Grot@height \Grot@l\Grot@h%C
+ \Grot@Px\Grot@right \Grot@r\Grot@h%B
+ \Grot@Px\Grot@left \Grot@l\Grot@d%D
+ \Grot@Py\Grot@depth \Grot@r\Grot@d%E
+ \fi
+ \fi
+ \advance\Grot@height\Grot@y
+ \advance\Grot@depth\Grot@y
+ \Grot@Px\dimen@ \Grot@x\Grot@y
+ \Grot@Py\dimen@ii \Grot@x\Grot@y
+ \dimen@-\dimen@ \advance\dimen@-\Grot@left
+ \dimen@ii-\dimen@ii \advance\dimen@ii\Grot@y
+^^A \GDebug{Rotate: (l,r,h,d)^^J%
+^^A Original \the\Grot@l,\the\Grot@r,\the\Grot@h,\the\Grot@d,^^J%
+^^A New..... \the\Grot@left,\the\Grot@right,%
+^^A \the\Grot@height,\the\Grot@depth}%
+ \setbox\z@\hbox{%
+ \kern\dimen@
+ \raise\dimen@ii\hbox{\Grot@start\box\z@\Grot@end}}%
+ \ht\z@\Grot@height
+ \dp\z@-\Grot@depth
+ \advance\Grot@right-\Grot@left\wd\z@\Grot@right
+ \leavevmode\box\z@
+ \endgroup}
+\def\scalebox#1{%
+ \@ifnextchar[{\Gscale@box{#1}}{\Gscale@box{#1}[#1]}}
+\long\def\Gscale@box#1[#2]#3{%
+ \leavevmode
+ \def\Gscale@x{#1}\def\Gscale@y{#2}%
+ \setbox\z@\hbox{{#3}}%
+ \setbox\tw@\hbox{\Gscale@start\rlap{\copy\z@}\Gscale@end}%
+ \ifdim#2\p@<\z@
+ \ht\tw@-#2\dp\z@
+ \dp\tw@-#2\ht\z@
+ \else
+ \ht\tw@#2\ht\z@
+ \dp\tw@#2\dp\z@
+ \fi
+ \ifdim#1\p@<\z@
+ \hb@xt@-#1\wd\z@{\kern-#1\wd\z@\box\tw@\hss}%
+ \else
+ \hb@xt@#1\wd\z@{\box\tw@\kern#1\wd\z@\hss}%
+ \fi}
+\def\reflectbox{\Gscale@box-1[1]}
+\def\resizebox{%
+ \leavevmode
+ \@ifstar{\Gscale@@box\totalheight}{\Gscale@@box\height}}
+\def\Gscale@@box#1#2#3{%
+ \let\@tempa\Gin@exclamation
+ \expandafter\def\expandafter\@tempb\expandafter{\string#2}%
+ \expandafter\def\expandafter\@tempc\expandafter{\string#3}%
+ \ifx\@tempb\@tempa
+ \ifx\@tempc\@tempa
+ \toks@{\mbox}%
+ \else
+ \toks@{\Gscale@box@dd{#3}#1}%
+ \fi
+ \else
+ \ifx\@tempc\@tempa
+ \toks@{\Gscale@box@dd{#2}\width}%
+ \else
+ \toks@{\Gscale@box@dddd{#2}\width{#3}#1}%
+ \fi
+ \fi
+ \the\toks@}
+\long\def\Gscale@box@dd#1#2#3{%
+ \@begin@tempboxa\hbox{#3}%
+ \setlength\@tempdima{#1}%
+ \setlength\@tempdimb{#2}%
+ \Gscale@div\@tempa\@tempdima\@tempdimb
+ \Gscale@box\@tempa[\@tempa]{\box\@tempboxa}%
+ \@end@tempboxa}
+\long\def\Gscale@box@dddd#1#2#3#4#5{%
+ \@begin@tempboxa\hbox{#5}%
+ \setlength\@tempdima{#1}%
+ \setlength\@tempdimb{#2}%
+ \Gscale@div\@tempa\@tempdima\@tempdimb
+ \setlength\@tempdima{#3}%
+ \setlength\@tempdimb{#4}%
+ \Gscale@div\@tempb\@tempdima\@tempdimb
+ \ifGin@iso
+ \ifdim\@tempa\p@>\@tempb\p@
+ \let\@tempa\@tempb
+ \else
+ \let\@tempb\@tempa
+ \fi
+ \fi
+ \Gscale@box\@tempa[\@tempb]{\box\@tempboxa}%
+ \@end@tempboxa}
+\newif\ifGin@iso
+\def\Gscale@div#1#2#3{%
+ \setlength\dimen@{#3}%
+ \ifdim\dimen@=\z@
+ \PackageError{graphics}{Division by 0}\@eha
+ \dimen@#2%
+ \fi
+ \edef\@tempd{\the\dimen@}%
+ \setlength\dimen@{#2}%
+ \count@65536\relax
+ \ifdim\dimen@<\z@
+ \dimen@-\dimen@
+ \count@-\count@
+ \fi
+ \ifdim\dimen@>\z@
+ \loop
+ \ifdim\ifnum\count@<\tw@\maxdimen\else\dimen@\fi<8192\p@
+ \dimen@\tw@\dimen@
+ \divide\count@\tw@
+ \repeat
+ \dimen@ii\@tempd\relax
+ \divide\dimen@ii\count@
+ \divide\dimen@\dimen@ii
+ \fi
+ \edef#1{\strip@pt\dimen@}}
+\Gin@codes
+\let\Gin@codes\relax
+% alow use of current .def files
+\def\quote@name#1{"\quote@@name#1\@gobble""}
+\def\quote@@name#1"{#1\quote@@name}
+\def\unquote@name#1{\quote@@name#1\@gobble"}
+%
+\endinput
+%%
+%% End of file `graphics.sty'.
diff --git a/macros/latex-dev/required/graphics/graphics-drivers.ins b/macros/latex-dev/required/graphics/graphics-drivers.ins
new file mode 100644
index 0000000000..dda92883ae
--- /dev/null
+++ b/macros/latex-dev/required/graphics/graphics-drivers.ins
@@ -0,0 +1,92 @@
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%% This file has the LPPL maintenance status "maintained".
+
+\input docstrip
+
+
+\preamble
+\endpreamble
+
+\keepsilent
+\askforoverwritefalse
+
+%% Generate a `template' .def file as an example for a new driver.
+%% (This is not set up yet.)
+%%\generate{\file{template.def}{%
+%% \from{drivers.dtx}{template}}}
+
+% These ones probably work
+\generate{%
+% dvips.def moved to graphics-def distribution
+% \file{dvips.def}{%
+% \from{drivers.dtx}{dvips,color1,psrulesZ,dosrules,macrules}}
+ \file{dvipdf.def}{%
+ \from{drivers.dtx}{dvipdf,color1,psrulesZ}}
+ \file{dvipsone.def}{%
+ \from{drivers.dtx}{tiffrules,dvipsone,color1,dosrules,psrules}}
+ \file{dviwin.def}{%
+ \from{drivers.dtx}{dviwin,nops}}
+ \file{emtex.def}{%
+ \from{drivers.dtx}{emtex,dosrules,nops}}
+% OzTeX (>3.0) uses dvips.def
+% \file{oztex.def}{%
+% \from{drivers.dtx}{oztex,macrules,nops}}
+ \file{pctexps.def}{%
+ \from{drivers.dtx}{pctexps,color3,colorfix}}
+ \file{pctex32.def}{%
+ \from{drivers.dtx}{pctex32,color1}}
+ \file{pctexhp.def}{%
+ \from{drivers.dtx}{pctexhp,nops}}
+ \file{pctexwin.def}{%
+ \from{drivers.dtx}{pctexwin,nops}}
+ \file{truetex.def}{%
+ \from{drivers.dtx}{truetex,color4,nops}}
+ \file{tcidvi.def}{%
+ \from{drivers.dtx}{tcidvi,color4,nops}}
+ \file{dvipsnam.def}{%
+ \from{drivers.dtx}{dvipsnames}}}
+
+
+% these ones are largely untested and no longer generated by default.
+%\generate{%
+% \file{pubps.def}{%
+% \from{drivers.dtx}{pubps,psrules}}
+% \file{psprint.def}{%
+% \from{drivers.dtx}{psprint,psrules}}
+%% The textures code generated by this option does more or less work
+%% I believe, but it does not use all of textures features, and as I
+%% have not got a Mac to test it on, it seems better to remove it for
+%% now.
+%% This release of the graphics distribution contains a textures.def
+%% written by Arthur Ogawa which is distributed as a separate file.
+%% It should however be installed in the same directory as the .def
+%% files generated by this .ins installation script.
+%% \file{textures.def}{%
+%% \from{drivers.dtx}{textures,color2,macrules}}
+%%
+%%%% Old versions of textures (prior to 1.7) do not have colour specials.
+%%%% To use colour with these versions, uncomment the next two lines.
+%%
+%%%% \file{textures.def}{%
+%%%% \from{drivers.dtx}{textures,color3,colorfix,macrules}}
+%%
+%%
+% \file{ln.def}{%
+% \from{drivers.dtx}{ln}}
+% \file{dvi2ps.def}{%
+% \from{drivers.dtx}{dvi2ps,psrules}}
+% \file{dvitops.def}{%
+% \from{drivers.dtx}{dvitops,psrules}}
+% \file{dvilaser.def}{%
+% \from{drivers.dtx}{dvilaser,psrules}}
+% \file{dvialw.def}{%
+% \from{drivers.dtx}{dvialw,psrules}}}
+%
+%
+%
+\endbatchfile
diff --git a/macros/latex-dev/required/graphics/graphics.dtx b/macros/latex-dev/required/graphics/graphics.dtx
new file mode 100644
index 0000000000..f2471e94bb
--- /dev/null
+++ b/macros/latex-dev/required/graphics/graphics.dtx
@@ -0,0 +1,1992 @@
+%
+% \iffalse
+%
+%% graphics.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz
+%% Copyright (C) 1995-2019 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+%<*dtx>
+ \ProvidesFile{graphics.dtx}
+%</dtx>
+%<+package>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+%<+package>\providecommand\DeclareRelease[3]{}
+%<+package>\providecommand\DeclareCurrentRelease[2]{}
+%<+package>
+%<+package>\DeclareRelease{}{2017-06-25}{graphics-2017-06-25.sty}
+%<+package>\DeclareCurrentRelease{}{2019-10-01}
+%<+package>
+%<+package>\ProvidesPackage{graphics}
+%<driver> \ProvidesFile{graphics.drv}
+% \fi
+% \ProvidesFile{graphics.dtx}
+ [2019/07/20 v1.3b Standard LaTeX Graphics (DPC,SPQR)]
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\newenvironment{option}[1]{\expandafter\macro\expandafter{%
+ \csname ds@#1\endcsname}}{\endmacro}
+\begin{document}
+ \DocInput{graphics.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{graphics.dtx}
+%
+% \title{The \textsf{graphics} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{D. P. Carlisle\and S. P. Q. Rahtz}
+% \date{\filedate}
+% \MaintainedByLaTeXTeam{graphics}
+% \maketitle
+%
+%
+% \changes{v0.3a}{1994/02/24}
+% {First DPC version (after prototype by SPQR).}
+% \changes{v0.4e}{1994/05/30}
+% {Rename egraphics to graphicx}
+% \changes{v1.0}{1996/05/29}
+% {Version 1 at last}
+%
+%
+% \def\star{{\ttfamily*}}
+% \makeatletter
+% \def\Describe@Macro#1{\endgroup
+% \setbox0=\lastbox\llap{\PrintDescribeMacro{#1}}}%
+% \makeatother
+% \marginparsep0pt
+%
+% \section{Introduction}
+%
+% This package implements various `graphics' functions. The main
+% features are a) inclusion of `graphics' files. b) Rotation of sections
+% of the page, c) Scaling of sections of the page.
+%
+% The design is split into three `levels'.
+% \begin{itemize}
+% \item The user interface. This is the collection of commands designed
+% to appear in a document text. Actually two separate user interface
+% have been implemented. The `standard' interface, described here, and a
+% more powerful, and more `user-friendly' interface provided by the
+% |graphicx| package.
+% \item The core functions. These functions, which are also implemented
+% in this file do all the `main work'. The `user-interface functions
+% just collect together the information from any optional-arguments or
+% star-forms, and then call one of these functions.
+% \item The driver files. It is not possible to achieve the
+% functionality of this package just using \TeX. The |dvi| driver used
+% must be given additional instructions. (Using the |\special| command
+% of \TeX.) Unfortunately, the capabilities of various drivers differ,
+% and the syntax required to pass instructions to the drivers is also
+% not standardised. So the `core functions' never access |\special|
+% directly, but rather call a series of commands that must be defined in
+% a special file customised for each driver. The accompanying file,
+% |drivers.dtx| has suitable files for a range of popular drivers.
+% \end{itemize}
+%
+% \section{Package Options}
+% Most of the options, such as |dvips|, |textures| etc., specify the
+% driver that is to be used to print the document. You may wish to set
+% up a configuration file so that this option always takes effect, even
+% if not specified in the document. To do this, produce a file
+% |graphics.cfg| containing the line:\\
+% |\ExecuteOptions{dvips}|\\
+% (or whichever other driver you wish.)
+%
+% Apart from the driver options there are a few other options to control
+% the behaviour of the package.
+% \begin{description}
+% \item[draft]
+% Do not include graphics files, but instead print a box of the size
+% the graphic would take up, and the file name. This greatly speeds up
+% previewing on most systems.
+% \item[final]
+% Turns off the |draft| option.
+% \item[debugshow]
+% Show a lot of tracing information on the terminal. If you are not me
+% you probably do not want to use this option.
+% \item[hiderotate]
+% Do not show rotated text. Sometimes useful if your previewer can not
+% rotate text.
+% \item[hidescale]
+% Do not show scaled text.
+% \item[hiresbb]
+% Look for Bounding Box lines of the form |%%HiResBoundingBox| instead
+% of the standard |%%BoundingBox|. These are used by some applications
+% to get round the restriction that BoundingBox comments should only
+% have integer values.
+% \item[setpagesize, nosetpagesize]
+% The |setpagesize| option requests that the driver option sets the page size.
+% (Whichever option is used, the page size is not set by this package if |\mag|
+% has been changed from its default value.)
+% \item[demo] Instead of including a graphics file, make
+% |\includegraphics| insert a black rectangle of size 150\,pt by
+% 100\,pt unless either dimension was already specified by another
+% option.
+% \end{description}
+%
+% \section{Standard Interface}
+%
+% \subsection{Graphics Inclusion}
+%
+% \DescribeMacro
+% \includegraphics\star\oarg{llx,lly}\oarg{urx,ury}\marg{file}\\
+% Include a graphics file.
+%
+% If \star\ is present, then the graphic is `clipped' to the size
+% specified. If \star\ is omitted, then any part of the graphic that is
+% outside the specified `bounding box' will over-print the surrounding
+% text.
+%
+% If the optional arguments are omitted, then the size of the graphic
+% will be determined by reading an external file as described below.
+% If \oarg{urx,ury} is present, then it should specify the coordinates
+% of the top right corner of the image, as a pair of \TeX\ dimensions.
+% If the units are omitted they default to |bp|. So |[1in,1in]| and
+% |[72,72]| are equivalent. If only one optional argument appears, the
+% lower left corner of the image is assumed to be at |[0,0]|. Otherwise
+% \oarg{llx,lly} may be used to specify the coordinates of this point.
+%
+% \DescribeMacro
+% \graphicspath\marg{dir-list}\\
+% This optional declaration may be used to specify a list of directories
+% in which to search for graphics files. The format is as for the
+% \LaTeXe\ primitive |\input@path|, a list of directories, each in a
+% |{}| group (even if there is only one in the list). For example:
+% |\graphicspath{{eps/}{tiff/}}|
+% would cause the system to look in the subdirectories |eps| and |tiff|
+% of the current directory. The default setting of this path is
+% |\input@path| that is: graphics files will be found wherever \TeX\
+% files are found.
+%
+% \DescribeMacro
+% \DeclareGraphicsExtensions\marg{ext-list}\\
+% This specifies the behaviour of the system when the filename argument to
+% |\includegraphics| does not have an extension specified.
+% Here \marg{ext-list} should be a comma-separated list of file
+% extensions, each with a leading period (\texttt{.}).
+% A file name is produced by appending \emph{sep} and one extension.
+% If a file is found, the system acts as if that extension had been
+% specified. If not, the next extension in \emph{ext-list} is tried.
+% \changes{v1.0m}{2001/06/07}{Extended documentation (CAR) graphics/3228}
+%
+% Each use of |\DeclareGraphicsExtensions| overwrites all previous
+% definitions. It is not possible to add an extension to an
+% existing list.
+%
+% Early versions of this package defined a default argument for this
+% command. This has been removed.
+%
+% \DescribeMacro
+% \DeclareGraphicsRule
+% \marg{ext}\marg{type}\marg{read-file}\marg{command}\\
+% Any number of these declarations can be made. They determine how the
+% system behaves when a file with extension \emph{ext} is specified.
+% (The extension may be specified explicitly or, if the argument to
+% |\includegraphics| does not have an extension, it may be a default
+% extension from the \emph{ext-list} specified with
+% |\DeclareGraphicsExtensions|.)
+%
+% \emph{ext} is the \emph{extension} of the file. Any file with this
+% extension will be processed by this graphics rule. Normally a file
+% with an extension for which no rule has been declared will generate an
+% error, however you may use |*| as the extension to define a
+% \emph{default rule}. For instance the |dvips| driver file declares all
+% files to be of type |eps| unless a more specific rule is declared.
+%
+% Since Version v0.6, extensions should be specified including the |.|
+% that is, |.eps| not |eps|.
+%
+% \emph{type} is the `type' of file involved. All files of the same type
+% will be input with the same internal command (which must be defined in
+% a `driver file'). For example files with extensions |ps|, |eps|,
+% |ps.gz| may all be classed as type |eps|.
+%
+% \emph{read-file} determines the extension of the file that should be
+% read to determine size information. It may be the same as \emph{ext}
+% but it may be different, for example |.ps.gz| files are not readable
+% easily by \TeX, so you may want to put the bounding box information in
+% a separate file with extension |.ps.bb|. If \emph{read-file} is empty,
+% |{}|, then the system will not try to locate an external file for size
+% info, and the size must be specified in the arguments of
+% |\includegraphics|. As a special case |*| may be used to denote the
+% same extension as the graphic file. This is mainly of use in
+% conjunction with using |*| as the extension, as in that case the
+% particular graphic extension is not known. For example
+%\begin{verbatim}
+% \DeclareGraphicsRule{*}{eps}{*}{}
+%\end{verbatim}
+% This would declare a default rule, such that all unknown extensions
+% would be treated as EPS files, and the graphic file would be read for
+% a BoundingBox comment.
+%
+% If the driver file specifies a procedure for
+% reading size files for \emph{type}, that will be used, otherwise the
+% procedure for reading |eps| files will be used. Thus the size of
+% bitmap files may be specified in a file with a PostScript style
+% |%%BoundingBox| line, if no other specific format is available.
+%
+% \emph{command} is usually empty, but if non empty it is used in place
+% of the filename in the |\special|. Within this argument, |#1| may be
+% used to denote the filename. Thus using the dvips driver, one may
+% use\\
+% |\DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{`zcat #1}|\\
+% the final argument causes dvips to use the |zcat| command to unzip the
+% file before inserting it into the PostScript output.
+%
+% \subsection{Rotation}
+%
+% \DescribeMacro
+% \rotatebox\marg{angle}\marg{text}\\
+% Rotate \emph{text} \emph{angle} degrees anti-clockwise. Normally
+% the rotation is about the left-hand end of the baseline of
+% \emph{text}.
+%
+% \subsection{Scaling}
+%
+% \DescribeMacro
+% \scalebox\marg{h-scale}\oarg{v-scale}\marg{text}\\
+% Scale \emph{text} by the specified amounts. If \emph{v-scale} is
+% omitted, the vertical scale factor is the same as the horizontal one.
+%
+% \DescribeMacro
+% \resizebox\star\marg{h-length}\marg{v-length}\marg{text}\\
+% Scale \emph{text} so that the width is \emph{h-length}.
+% If |!| is used as either length argument, the other argument is used
+% to determine a scale factor that is used in both directions.
+% Normally \emph{v-length} refers to the height of the box, but in the
+% star form, it refers to the `height + depth'.
+% As normal for \LaTeXe\ box length arguments, |\height|,
+% |\width|, |\totalheight| and |\depth| may be used to refer to the
+% original size of the box.
+%
+% \section{The Key=Value Interface}
+% As mentioned in the introduction, apart from the above `standard
+% interface', there is an alternative syntax to the |\includegraphics|
+% and |\rotatebox| commands that some people may prefer. It is provided
+% by the accompanying |graphicx| package.
+%
+% \StopEventually{}
+%
+% \section{The Graphics Kernel Functions}
+%
+% \subsection{Graphics Inclusion}
+%
+% \DescribeMacro
+% {\Ginclude@graphics}\marg{file}\\
+% Insert the contents of the file \emph{file} at the current point.
+% |\Ginclude@graphics| may use the four macros |\Gin@llx|, |\Gin@lly|,
+% |\Gin@urx|, |\Gin@ury| to determine the `bounding box' of the graphic.
+% The result will be a \TeX\ box of width $\mathit{urx}-\mathit{llx}$
+% and height $\mathit{ury}-\mathit{lly}$. If |\Gin@clip| is \meta{true}
+% then part of the graphic that is outside this box should not be
+% displayed. (Not all drivers can support this `clipping'.) Normally all
+% these parameters are set by the `user interface level'.
+%
+%
+% \DescribeMacro
+% {\Gread@eps}\marg{file}\\
+% For each \emph{type} of graphics file supported, the driver file must
+% define |\Ginclude@|\emph{type} and, optionally |\Gread@|\emph{type}.
+% The read command is responsible for obtaining size information from
+% the file specified in the |\DeclareGraphicsRule| command. However the
+% kernel defines a function, |\Gread@eps|, which can read PostScript
+% files to find the
+% |%%BoundingBox| comment. This function will be used for any type for
+% which a specific function has not been declared. |\Gread@eps| accepts
+% a generalised version of the bounding box comment. \TeX\ units may be
+% used (but there must be no space before the unit). If the unit is
+% omitted |bp| is assumed. So\\
+% |%%BoundingBox 0 0 2in 3in|\\
+% Would be accepted by this function, to produce a 2in wide, by 3in high
+% graphic.
+%
+% \subsection{Rotation}
+%
+% \DescribeMacro
+% {\Grot@box}\\
+% Rotate the contents of |\box0| through |\Grot@angle| degrees
+% (anti-clockwise). The user-interface is responsible for setting the
+% macro |\Grot@angle|, and putting the appropriate text in |\Grot@box|.
+%
+% \subsection{Scaling}
+%
+% \DescribeMacro
+% {\Gscale@box}\marg{xscale}\oarg{yscale}\marg{text}\\
+% (The second argument is not optional.)
+% Scale \emph{text} by the appropriate scale factors.
+%
+% \DescribeMacro
+% {\Gscale@box@dd}\marg{dima}\marg{dimb}\marg{text}\\
+% Scale \emph{text} in both directions by a factor
+% \emph{dima}/\emph{dimb}.
+%
+% \DescribeMacro
+% {\Gscale@box@dddd}
+% \marg{dima}\marg{dimb}\marg{dimc}\marg{dimd}\marg{text}\\
+% Scale \emph{text} in horizontally by a factor \emph{dima}/\emph{dimb},
+% and vertically by a factor of \emph{dimc}/\emph{dimd}.
+%
+% \DescribeMacro
+% {\Gscale@div}\marg{cmd}\marg{dima}\marg{dimb}\\
+% Define the macro \emph{cmd} to be the ratio of the lengths
+% \emph{dima}/\emph{dimb}.
+%
+%
+% \section{Interface to the Driver Files}
+%
+% \subsection{Graphics Inclusion}
+%
+% Each driver file must declare that its driver can include graphics of
+% certain \emph{types}. It does this by declaring for each type a
+% command of the form:\\
+% |\Ginclude@|\emph{type}\\
+% The Graphics kernel function will call this driver-defined function
+% with the filename as argument, and certain additional information will
+% be provided as follows.:
+%
+% \noindent\begin{tabular}{p{.4\textwidth}p{.5\textwidth}}
+% |\Gin@llx|, |\Gin@lly|,\newline
+% |\Gin@urx|, |\Gin@ury| &Macros storing the `bounding box'\\
+% |\Gin@nat@width|\newline |\Gin@nat@height| &
+% Registers storing the natural size.\\
+% |\Gin@req@width|\newline |\Gin@req@height| &
+% Registers storing the required size, after scaling.\\
+% |\Gin@scalex|, |\Gin@scaley| & macros with the scale factors. A value
+% of |!| means: Scale by the same amount as the other direction.\\
+% |\ifGin@clip| & |\newif| token, true if the graphic should be
+% `clipped' to the bounding box.
+% \end{tabular}
+%
+% Optionally the driver may define a command of the form:\\
+% |\Gread@|\emph{type}\\
+% This is responsible for reading an external file to find the bounding
+% box information. If such a command is not declared, but a read-file is
+% specified the command |\Gread@eps|, which is defined in the Graphics
+% Kernel will be used.
+%
+% \subsection{Literal Postscript}
+% Drivers that are producing PostScript output may want to define
+% the following macros. They each take one argument which should be
+% passed to an appropriate special. They are not used directly by this
+% package but allow other packages to use the standard configuration
+% file and package options to customise to various drivers:\\
+% |\Gin@PS@raw|, Literal PostScript special.\\
+% |\Gin@PS@restored|, Literal PostScript special, the driver will
+% surround this with a save-restore pair.\\
+% |\Gin@PS@literal@header|, Postscript to be inserted in the header
+% section of the PostScript file.\\
+% |\Gin@PS@file@header|, external file to be inserted in the header
+% section of the PostScript file.
+%
+%
+% \subsection{Rotation}
+%
+% |\Grot@start|, |\Grot@end| These macros must be defined to insert the
+% appropriate |\special| to rotate the text between them by
+% |\Grot@angle| degrees. The kernel function will make sure that the
+% correct \TeX\ spacing is produced, these functions only need insert
+% the |\special|.
+%
+% \subsection{Scaling}
+%
+% |\Gscale@start|, |\Gscale@end|, as for rotation, but here scale the
+% text by |\Gscale@x| and |\Gscale@y|.
+%
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Initialisation}
+%
+% \begin{macro}{\Gin@codes}
+% First we save the catcodes of some characters, and set them to
+% fixed values whilst this file is being read.
+% \changes{v0.5a}{1994/07/20}
+% {Save and restore catcodes}
+% \begin{macrocode}
+\edef\Gin@codes{%
+ \catcode`\noexpand\^^A\the\catcode`\^^A\relax
+ \catcode`\noexpand\"\the\catcode`\"\relax
+ \catcode`\noexpand\*\the\catcode`\*\relax
+ \catcode`\noexpand\!\the\catcode`\!\relax
+ \catcode`\noexpand\:\the\catcode`\:\relax}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\catcode`\^^A=\catcode`\%
+\@makeother\"%
+\catcode`\*=11
+\@makeother\!%
+\@makeother\:%
+% \end{macrocode}
+% \end{macro}
+%
+% We will need to have an implementation of the trigonometric
+% functions for the rotation feature. May as well load it now.
+% \begin{macrocode}
+\RequirePackage{trig}
+% \end{macrocode}
+%
+% \begin{macro}{\Grot@start}
+% \begin{macro}{\Grot@end}
+% Initialise the rotation primitives.
+% \begin{macrocode}
+\providecommand\Grot@start{\@latex@error{Rotation not supported}\@ehc
+ \global\let\Grot@start\relax}
+\providecommand\Grot@end{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gscale@start}
+% \begin{macro}{\Gscale@end}
+% Initialise the scaling primitives.
+% \begin{macrocode}
+\providecommand\Gscale@start{\@latex@error{Scaling not supported}\@ehc
+ \global\let\Gscale@start\relax}
+\providecommand\Gscale@end{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gread@BBox}
+% \changes{v1.0b}{1996/10/29}
+% {Moved to initial section, for hiresbb option}
+% |%%BoundingBox| as a macro for testing with |\ifx|.
+% This may be redefined by the hiresbb option.
+% \begin{macrocode}
+\edef\Gread@BBox{\@percentchar\@percentchar BoundingBox}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Options}
+%
+% \begin{option}{draft}
+% \begin{option}{final}
+% \changes{v0.3i}{1994/03/23}
+% {notdraft option added}
+% \changes{v0.4a}{1994/04/13}
+% {Rename option to nodraft}
+% \changes{v0.4d}{1994/05/06}
+% {Rename option to final}
+% \begin{macrocode}
+\DeclareOption{draft}{\Gin@drafttrue}
+\DeclareOption{final}{\Gin@draftfalse}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{macro}{\ifGin@draft}
+% True in draft mode.
+% \begin{macrocode}
+\newif\ifGin@draft
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{option}{hiresbb}
+% \changes{v1.0b}{1996/10/29}
+% {hiresbb option added}
+% If given this option the package will look for bounding box comments
+% of the form |%%HiResBoundingBox| (which typically have real values)
+% instead of the standard |%%BoundingBox| (which should have integer
+% values).
+% \begin{macrocode}
+\DeclareOption{hiresbb}{%
+ \edef\Gread@BBox{\@percentchar\@percentchar HiResBoundingBox}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{demo}
+% \changes{v1.0o}{2006/02/20}{demo option added}
+% If given this option the package will disregard the actual
+% graphics file and insert a black box unless width or height are
+% already specified.
+% \begin{macrocode}
+\DeclareOption{demo}{%
+ \AtBeginDocument{%
+ \def\Ginclude@graphics#1{%
+ \rule{\@ifundefined{Gin@@ewidth}{150pt}{\Gin@@ewidth}}%
+ {\@ifundefined{Gin@@eheight}{100pt}{\Gin@@eheight}}}}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{setpagesize}
+% \begin{option}{nosetpagesize}
+% The |setpagesize| option requests that the driver option sets the page size.
+% (Whichever option is used, the page size is not set by this package if |\mag|
+% has been changed from its default value.)
+% \changes{v1.0s}{2016/06/02}
+% {(no)setpagesize options added}
+% \begin{macrocode}
+\newif\ifGin@setpagesize\Gin@setpagesizetrue
+\DeclareOption{setpagesize}{\Gin@setpagesizetrue}
+\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{macro}{\Gin@driver}
+% Driver in use.
+% \begin{macrocode}
+\providecommand\Gin@driver{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{option}{dvips}
+% \changes{v0.3g}{1994/03/15}
+% {Use dvips def file not development version}
+% \begin{option}{xdvi}
+% Tomas Rockicki's PostScript driver (unix, MSDOS, VMS\ldots).
+% The |X11| previewer |xdvi| supports basically the same set of
+% |\specials|.
+% \begin{macrocode}
+\DeclareOption{dvips}{\def\Gin@driver{dvips.def}}
+\DeclareOption{xdvi}{\ExecuteOptions{dvips}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{dvipdf}
+% \changes{v1.0c}{1996/10/31}
+% {dvipdf added}
+% Sergey Lesenko's dvipdf driver.
+% \begin{macrocode}
+\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvipdfm}
+% \changes{v1.0k}{1999/01/13}
+% {dvipdfm added}
+% \changes{v1.2a}{2017/06/01}
+% {make dvipdfm an alias for dvipdfmx}
+% Mark Wick's dvipdfm driver (now merged with xdvipdfmx).
+% \begin{macrocode}
+\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfmx.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvipdfmx}
+% \changes{v1.0m}{2005/11/14}
+% {dvipdfmx added}
+% The driver for the dvipdfmx project (also supports xdvipdfmx).
+% \begin{macrocode}
+\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{xetex}
+% \changes{v1.0m}{2005/11/14}
+% {xetex added}
+% Jonathan Kew's \TeX\ variant.
+% \begin{macrocode}
+\DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{pdftex}
+% \changes{v1.0d}{1997/06/07}
+% {pdftex added}
+% Han The Thanh's \TeX\ variant.
+% \begin{macrocode}
+\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{luatex}
+% \changes{v1.0q}{2016/01/03}
+% {luatex added}
+% Lua\TeX\ \TeX\ variant.
+% \begin{macrocode}
+\DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{luatex}
+% \changes{v1.0r}{2016/05/09}
+% {dvisvgm added}
+% dvisvgm driver.
+% \begin{macrocode}
+\DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvipsone}
+% \begin{option}{dviwindo}
+% \changes{v0.3c}{1994/03/04}
+% {dviwindo support.}
+% \changes{v0.7c}{1995/09/07}
+% {Merge dviwindo option with dvipsone}
+% The drivers for the Y\&Y \TeX\ system.
+% \begin{macrocode}
+\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
+\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{emtex}
+% \begin{option}{dviwin}
+% Two freely available sets of drivers for MSDOS, OS/2 and Windows.
+% \begin{macrocode}
+\DeclareOption{emtex}{\def\Gin@driver{emtex.def}}
+\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{oztex}
+% \changes{v1.0f}{1997/09/09}
+% {Merge dvips and oztex options}
+% Oz\TeX\ (Macintosh).
+% Since release 3 of Oz\TeX, merge with dvips back end.
+% \begin{macrocode}
+\DeclareOption{oztex}{\ExecuteOptions{dvips}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{textures}
+% Textures (Macintosh).
+% \begin{macrocode}
+\DeclareOption{textures}{\def\Gin@driver{textures.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{pctexps}
+% \begin{option}{pctexwin}
+% \begin{option}{pctexhp}
+% \begin{option}{pctex32}
+% \changes{v1.0b}{1996/10/29}
+% {pctex32 option added}
+% PC\TeX\ (MSDOS/Windows) .
+% \begin{macrocode}
+\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
+\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}}
+\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}}
+\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{truetex}
+% \changes{v1.0b}{1996/10/29}
+% {truetex and tcidef options added}
+% \begin{option}{tcidvi}
+% Kinch TrueTeX, and its version with extended special support as
+% shipped by Scientific Word.
+% \begin{macrocode}
+\DeclareOption{truetex}{\def\Gin@driver{truetex.def}}
+\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{vtex}
+% \changes{v1.0h}{1998/05/27}
+% {vtex option added}
+% V\TeX\ driver.
+% \begin{macrocode}
+\DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{dvi2ps}
+% \begin{option}{dvialw}
+% \begin{option}{dvilaser}
+% \begin{option}{dvitops}
+% \begin{option}{psprint}
+% \begin{option}{pubps}
+% \begin{option}{ln}
+% \changes{v0.6b}{1994/12/12}
+% {ln support (untested)}
+% \changes{v1.0b}{1996/10/29}
+% {options for historic drivers depreciated}
+% If \emph{anyone} is using any of these driver options
+% would they let me know. All these are essentially untried
+% and untested as far as I know.
+% \begin{macrocode}
+%\DeclareOption{dvi2ps}{\def\Gin@driver{dvi2ps.def}}
+%\DeclareOption{dvialw}{\def\Gin@driver{dvialw.def}}
+%\DeclareOption{dvilaser}{\def\Gin@driver{dvilaser.def}}
+%\DeclareOption{dvitops}{\def\Gin@driver{dvitops.def}}
+%\DeclareOption{psprint}{\def\Gin@driver{psprint.def}}
+%\DeclareOption{pubps}{\def\Gin@driver{pubps.def}}
+%\DeclareOption{ln}{\def\Gin@driver{ln.def}}
+% \end{macrocode}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+% \end{option}
+%
+% \begin{option}{debugshow}
+% You probably don't want to use this\ldots
+% \begin{macrocode}
+\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout}
+% \end{macrocode}
+% \end{option}
+%
+% A local configuration file may define more options.
+% It should also make one driver option the default, by calling
+% |\ExecuteOptions| with the appropriate option.
+% \changes{v0.4f}{1994/07/27}
+% {Add missing 3rd argument to \cs{InputIfFileExists}}
+% \begin{macrocode}
+\InputIfFileExists{graphics.cfg}{}{}
+% \end{macrocode}
+%
+% \begin{option}{hiderotate}
+% \changes{v0.4a}{1994/04/13}
+% {Rename option to hiderotate}
+% \begin{macrocode}
+\DeclareOption{hiderotate}{%
+ \def\Grot@start{\begingroup\setbox\z@\hbox\bgroup}
+ \def\Grot@end{\egroup\endgroup}}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{hidescale}
+% \changes{v0.4a}{1994/04/13}
+% {Rename option to hidescale}
+% \begin{macrocode}
+\DeclareOption{hidescale}{%
+ \def\Gscale@start{\begingroup\setbox\z@\hbox\bgroup}
+ \def\Gscale@end{\egroup\endgroup}}
+% \end{macrocode}
+% \end{option}
+%
+% After the options are processed, load the appropriate driver file.
+% If a site wants a default driver (eg |textures|) it just needs to put
+% |\ExecuteOptions{textures}| in a |graphics.cfg| file.
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+%
+% Check that a driver has been specified (either as an option, or as a
+% default option in the configuration file). Then load the `def' file
+% for that option, if it has not already been loaded by some other
+% package (for instance the \textsf{color} package).
+% \changes{v0.5c}{1994/10/03}
+% {Error if no driver specified}
+% \begin{macrocode}
+\if!\Gin@driver!
+ \PackageError{graphics}
+ {No driver specified}
+ {You should make a default driver option in a file \MessageBreak
+ graphics.cfg\MessageBreak
+ eg: \protect\ExecuteOptions{textures}%
+ }
+\else
+ \PackageInfo{graphics}{Driver file: \Gin@driver}
+ \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
+\fi
+% \end{macrocode}
+%
+%
+% \subsection{Graphics Inclusion}
+%
+% This Graphics package uses a lot of dimension registers. \TeX\ only
+% has a limited number of registers, so rather than allocate new ones,
+% re-use some existing \LaTeX\ registers. This is safe as long as all
+% uses of the registers are \emph{local}, and that you can be sure
+% that you \emph{never} need to have access to both uses within the
+% same scope.
+%
+% \begin{macro}{\Gin@llx}
+% \begin{macro}{\Gin@lly}
+% \begin{macro}{\Gin@urx}
+% \begin{macro}{\Gin@ury}
+% In fact these four lengths are now stored as macros not as dimen
+% registers, mainly so that integer |bp| lengths may be passed exactly.
+% \changes{v0.7a}{1995/04/11}
+% {Bounding box coords no longer in registers}
+% \begin{macrocode}
+\def\Gin@llx{0}
+\let\Gin@lly\Gin@llx
+\let\Gin@urx\Gin@llx
+\let\Gin@ury\Gin@llx
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gin@nat@width}
+% \begin{macro}{\Gin@nat@height}
+% The `natural' size of the graphic, before any scaling.
+% \begin{macrocode}
+\let\Gin@nat@width\leftmarginv
+\let\Gin@nat@height\leftmarginvi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ifGin@clip}
+% This switch is \meta{true} if any graphics outside the specified
+% bounding box (really viewport) should not be printed.
+% \begin{macrocode}
+\newif\ifGin@clip
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DeclareGraphicsExtensions}
+% \changes{v0.6a}{1994/11/29}
+% {Remove optional argument, ignore spaces in main argument.}
+% Declare a comma separated list of default extensions to be used
+% if the file is specified with no extension.
+% \begin{macrocode}
+\newcommand\DeclareGraphicsExtensions[1]{%
+ \edef\Gin@extensions{\zap@space#1 \@empty}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@extensions}
+% Initialise the list of possible extensions.
+% \changes{v0.4b}{1994/04/20}
+% {Use \cmd{\providecommand} in case a previous def file has
+% already defined it}
+% \begin{macrocode}
+\providecommand\Gin@extensions{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\includegraphics}
+% \changes{v1.1a}{2017/03/17}
+% {\cs{leavevmode} added before the group in \cs{Gin@iii} so that
+% settings in \cs{everypar} are cleared}
+% Top level command for the standard interface, just look for a |*|.
+% \begin{macrocode}
+\def\includegraphics{%
+% \end{macrocode}
+% Clear |\everypar| before starting a group.
+% \begin{macrocode}
+ \leavevmode
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \@ifstar
+ {\Gin@cliptrue\Gin@i}%
+ {\Gin@clipfalse\Gin@i}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@i}
+% If an optional argument is present, call |\Gin@ii| to process it,
+% otherwise call |\Ginclude@graphics|.
+% \changes{v0.3e}{1994/03/09}
+% {Now specify ll before ur coordinate}
+% \begin{macrocode}
+\def\Gin@i{%
+ \@ifnextchar[%]
+ \Gin@ii
+ {\Gin@bboxfalse\Ginclude@graphics}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@ii}
+% Look for a second optional argument.
+% \begin{macrocode}
+\def\Gin@ii[#1]{%
+ \@ifnextchar[%]
+ {\Gin@iii[#1]}
+ {\Gin@iii[0,0][#1]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@iii}
+% Set the coordinates of the {\bfseries l}lower {\bfseries l}eft corner,
+% and the coordinates of the {\bfseries u}pper {\bfseries r}ight
+% corner. The coordinates may be any \TeX\ dimension, defaulting to |bp|.
+% \changes{v0.6c}{1994/12/15}
+% {(Denis Roegel) Extra group to keep bb settings local}
+% \begin{macrocode}
+\def\Gin@iii[#1,#2][#3,#4]#5{%
+ \begingroup
+ \Gin@bboxtrue
+ \Gin@defaultbp\Gin@llx{#1}%
+ \Gin@defaultbp\Gin@lly{#2}%
+ \Gin@defaultbp\Gin@urx{#3}%
+ \Gin@defaultbp\Gin@ury{#4}%
+ \Ginclude@graphics{#5}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@defaultbp}
+% \changes{v0.7a}{1995/04/11}{Macro added}
+% \begin{macro}{\Gin@def@bp}
+% \changes{v0.7a}{1995/04/11}{Macro added}
+% This macro grabs a length, |#2|, which may or may not have a unit,
+% and if a unit is supplied, converts to `bp' and stores the value in
+% |#1|. If a unit is not supplied `bp' is assumed, and |#2| is directly
+% stored in |#1|. Note that supplying `bp' is not quite the same as
+% supplying no units, as in the former case a conversion via `pt' and
+% back to `bp' takes place which can introduce rounding error. The error
+% is invisibly small but files conforming to Adobe DSC should have
+% \emph{integer} Bounding Box Coordinates, and conceivably some drivers
+% might demand integer values.
+% (Although most seem to accept real values (if they accept bounding box
+% coordinates at all) in the |\special|. This is the reason why the
+% mechanism uses |\def| and not \TeX\ lengths, as in earlier releases of
+% the package.
+% \begin{macrocode}
+\def\Gin@defaultbp#1#2{%
+ \afterassignment\Gin@def@bp\dimen@#2bp\relax{#1}{#2}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\Gin@def@bp#1\relax#2#3{%
+ \if!#1!%
+ \def#2{#3}%
+ \else
+ \dimen@.99626\dimen@
+ \edef#2{\strip@pt\dimen@}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\DeclareGraphicsRule}
+% Declare what actions should be taken for a particular file
+% extension.
+%
+% |#1| extension, |#2| type, |#3| read-file, |#4| command,
+% \changes{v0.5d}{1994/10/24}
+% {(Arthur Ogawa) Check arg3 is *, not arg2.}
+% \begin{macrocode}
+\def\DeclareGraphicsRule#1#2#3#4{%
+ \edef\@tempa{\string *}\def\@tempb{#3}%
+ \expandafter\edef\csname Gin@rule@#1\endcsname##1%
+ {{#2}%
+ {\ifx\@tempa\@tempb\noexpand\Gin@ext\else#3\fi}%
+ {\ifx\indent#4\indent##1\else#4\fi}}}
+% \end{macrocode}
+% \end{macro}
+%
+% An example rule base.
+%\begin{verbatim}
+% ext type read command
+% \DeclareGraphicsRule{.ps} {eps} {.ps} {}
+% \DeclareGraphicsRule{.eps} {eps} {.eps} {}
+% \DeclareGraphicsRule{.ps.gz}{eps} {.ps.bb} {`zcat #1}
+% \DeclareGraphicsRule{.pcx} {bmp} {} {}
+%\end{verbatim}
+%
+% \begin{macro}{\graphicspath}
+% User level command to set the input path for graphics files.
+% A list of directories, each in a |{}| group.
+% \begin{macrocode}
+\def\graphicspath#1{\def\Ginput@path{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Ginput@path}
+% The default graphic path is |\input@path|.
+% \begin{macrocode}
+\ifx\Ginput@path\@undefined
+ \let\Ginput@path\input@path
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@getbase}
+% \changes{v0.6a}{1994/11/29} {remove \cs{Gin@sep}}
+% \changes{v1.3a}{2019/07/01} {Support UTF-8 and spaces}
+% \changes{v1.3b}{2019/07/20} {Delay adding quotes to filename}
+% Given a possible extension, |#1|, check whether the file exists. If
+% it does set |\Gin@base| and |\Gin@ext| to the filename stripped of
+% the extension, and the extension, respectively.
+% \begin{macrocode}
+\def\Gin@getbase#1{%
+ \edef\Gin@tempa{%
+ \def\noexpand\@tempa####1#1\space{%
+ \def\noexpand\Gin@base{####1}}}%
+ \IfFileExists{\filename@area\filename@base#1}%
+ {\Gin@tempa
+ \edef\uq@filef@und{\expandafter\unquote@name
+ \expandafter{\@filef@und}}%
+ \expandafter\@tempa\uq@filef@und
+ \edef\Gin@ext{#1}}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@ext}
+% Initialise the macro to hold the extension.
+% \begin{macrocode}
+\let\Gin@ext\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@sepdefault}
+% \changes{v0.6a}{1994/11/29}
+% {remove \cs{Gin@sep}}
+% This must match the token used by |\filename@parse| to delimit the
+% extension.
+% \begin{macrocode}
+\def\Gin@sepdefault{.}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Ginclude@graphics}
+% The main internal function implementing graphics file inclusion.
+% |#1| is the file name.
+% \changes{v0.4c}{1994/04/28}
+% {Improve the wording of error messages}
+% \changes{v0.5a}{1994/07/20}
+% {Add default (*) rule possibility}
+% \changes{v0.6a}{1994/11/29}
+% {remove \cs{Gin@sepdefault}}
+% \changes{v1.3a}{2019/07/01} {Support UTF-8 and spaces}
+% The quoting business for graphic files needs further sorting
+% out. This should be handled differently, right now we quote and
+% unquote all over the place as we still use the old code base.
+%
+% This also makes the file name displays weird!
+%
+% Guard |\detokenize| use for plain classic tex.
+% \begin{macrocode}
+\def\Ginclude@graphics#1{%
+ \ifx\detokenize\@undefined\else
+ \edef\Gin@extensions{\detokenize\expandafter{\Gin@extensions}}%
+ \fi
+ \begingroup
+ \let\input@path\Ginput@path
+% \end{macrocode}
+% A lot of quote juggling going on here (room for improvements).
+% \begin{macrocode}
+ \set@curr@file{#1}%
+ \edef\uq@curr@file{\expandafter\unquote@name\expandafter{\@curr@file}}%
+ \expandafter\filename@parse\expandafter{\uq@curr@file}%
+ \edef\filename@area{\expandafter\quote@name\expandafter{\filename@area}}%
+ \edef\filename@base{\expandafter\quote@name\expandafter{\filename@base}}%
+ \ifx\filename@ext\relax
+ \@for\Gin@temp:=\Gin@extensions\do{%
+ \ifx\Gin@ext\relax
+ \Gin@getbase\Gin@temp
+ \fi}%
+ \else
+ \Gin@getbase{\Gin@sepdefault\filename@ext}%
+% \end{macrocode}
+% \changes{v0.4d}{1994/05/06}
+% {Make file not found a warning not an error}
+% \changes{v0.6a}{1994/11/29}
+% {remove \cs{Gin@sep}}
+% If the user supplied an explicit extension, just give a warning if the
+% file does not exist. (It may be created later.)
+% \begin{macrocode}
+ \ifx\Gin@ext\relax
+ \@warning{File `#1' not found}%
+ \def\Gin@base{\filename@area\filename@base}%
+% \end{macrocode}
+% \changes{v0.6c}{1994/12/15}
+% {(Piet van Oostrum) include `.' in \cs{Gin@ext}}%
+% \begin{macrocode}
+ \edef\Gin@ext{\Gin@sepdefault\filename@ext}%
+ \fi
+ \fi
+% \end{macrocode}
+% If no extension is supplied, it is an error if the file does not
+% exist, as there is no way for the system to know which extension to
+% supply.
+% \begin{macrocode}
+ \ifx\Gin@ext\relax
+ \@latex@error{File `#1' not found}%
+ {I could not locate the file with any of these extensions:^^J%
+ \Gin@extensions^^J\@ehc}%
+ \else
+ \@ifundefined{Gin@rule@\Gin@ext}%
+% \end{macrocode}
+% \changes{v0.5a}{1994/07/20}
+% {Add default (*) rule possibility}
+% Handle default rule.
+% \begin{macrocode}
+ {\ifx\Gin@rule@*\@undefined
+ \@latex@error{Unknown graphics extension: \Gin@ext}\@ehc
+ \else
+ \expandafter\Gin@setfile\Gin@rule@*{\Gin@base\Gin@ext}%
+ \fi}%
+ {\expandafter\expandafter\expandafter\Gin@setfile
+ \csname Gin@rule@\Gin@ext\endcsname{\Gin@base\Gin@ext}}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifGread@}
+% True if a file should be read to obtain the natural size.
+% \begin{macrocode}
+\newif\ifGread@\Gread@true
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@setfile}
+% Set a file to the size specified in arguments, or in a `read file'.
+% \changes{v0.5d}{1994/10/24}
+% {(Arthur Ogawa) Add missing \cs{expandafter}}
+% \begin{macrocode}
+\def\Gin@setfile#1#2#3{%
+ \ifx\\#2\\\Gread@false\fi
+ \ifGin@bbox\else
+ \ifGread@
+ \csname Gread@%
+ \expandafter\ifx\csname Gread@#1\endcsname\relax
+ eps%
+ \else
+ #1%
+ \fi
+ \endcsname{\Gin@base#2}%
+ \else
+% \end{macrocode}
+% \changes{v0.5a}{1994/07/20}
+% {New error trap for missing size arguments}
+% \changes{v0.7f}{1995/11/10}
+% {Use \cs{Gin@nosize}}
+% By now the natural size should be known either from arguments or
+% from the file. If not generate an error. (The \textsf{graphicx}
+% interface relaxes this condition slightly.)
+% \begin{macrocode}
+ \Gin@nosize{#3}%
+ \fi
+ \fi
+% \end{macrocode}
+% \changes{v0.7a}{1995/04/11}{\cs{Gin@viewport@code} added.}
+% The following call will modify the `natural size' if the user has
+% supplied a viewport or trim specification. (Not available in the
+% standard interface.)
+% \begin{macrocode}
+ \Gin@viewport@code
+% \end{macrocode}
+% Save the natural size, and then call |\Gin@req@sizes| which (in the
+% key-val interface) will calculate the required size from the natural
+% size, and any scaling info.
+% \begin{macrocode}
+ \Gin@nat@height\Gin@ury bp%
+ \advance\Gin@nat@height-\Gin@lly bp%
+ \Gin@nat@width\Gin@urx bp%
+ \advance\Gin@nat@width-\Gin@llx bp%
+ \Gin@req@sizes
+% \end{macrocode}
+%
+% Call |\Ginclude@|\emph{type} to include the figure unless
+% this is not defined, or draft mode is being used.
+% \changes{v0.7h}{1996/02/20}
+% {missing \texttt{@} added in \texttt{Gread@} csnames}
+% \begin{macrocode}
+ \expandafter\ifx\csname Ginclude@#1\endcsname\relax
+ \Gin@drafttrue
+ \expandafter\ifx\csname Gread@#1\endcsname\relax
+ \@latex@error{Can not include graphics of type: #1}\@ehc
+ \global\expandafter\let\csname Gread@#1\endcsname\@empty
+ \fi
+ \fi
+ \leavevmode
+ \ifGin@draft
+ \hb@xt@\Gin@req@width{%
+ \vrule\hss
+ \vbox to \Gin@req@height{%
+ \hrule \@width \Gin@req@width
+ \vss
+ \edef\@tempa{#3}%
+ \rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}%
+ \vss
+ \hrule}%
+ \hss\vrule}%
+ \else
+% \end{macrocode}
+% \changes{v0.3i}{1994/3/23}
+% {Add file list info}
+% Support |\listfiles| and then set the final box to the required size.
+% \begin{macrocode}
+ \@addtofilelist{#3}%
+ \ProvidesFile{#3}[Graphic file (type #1)]%
+ \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}%
+ \dp\z@\z@
+ \ht\z@\Gin@req@height
+ \wd\z@\Gin@req@width
+ \box\z@
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@decode}
+% \changes{v1.2c}{2017/06/25}
+% {New macro}
+% In the standard interface this is a no-op, but needs to be defined
+% to allow the caching code to be set up.
+% \begin{macrocode}
+\let\Gin@decode\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@exclamation}
+% \changes{v0.7g}{1995/12/06}{Macro added}
+% Catcode 12 |!|, in case of French, or other language styles.
+% \begin{macrocode}
+\def\Gin@exclamation{!}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@page}
+% \changes{v1.2a}{2017/06/01}
+% {New macro}
+% In the standard interface this is a no-op, but needs to be defined
+% to allow the caching code to be set up.
+% \begin{macrocode}
+\let\Gin@page\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@pagebox}
+% \changes{v1.2a}{2017/06/01}
+% {New macro}
+% In the standard interface always points to the |cropbox|.
+% \begin{macrocode}
+\def\Gin@pagebox{cropbox}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifGin@interpolate}
+% \changes{v1.2a}{2017/06/01}
+% {New macro}
+% In the standard setting a no-op.
+% \begin{macrocode}
+\newif\ifGin@interpolate
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@log}
+% \changes{v1.2a}{2017/06/01} {New macro} In the standard interface
+% this prints to the log but can be changed via keys in \textsf{graphicx}.
+% \begin{macrocode}
+\let\Gin@log\wlog
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\Gin@req@sizes}
+% \begin{macro}{\Gin@scalex}
+% \begin{macro}{\Gin@scaley}
+% \begin{macro}{\Gin@req@height}
+% \begin{macro}{\Gin@req@width}
+% In the standard interface there is no scaling, so the required size
+% is the same as the natural size. In other interfaces |\Gin@req@sizes|
+% will be responsible for setting these parameters. Here we can set them
+% globally.
+% \changes{v0.3g}{1994/03/15}
+% {Initialise y-scale to !!}
+% \changes{v1.0g}{1998/05/14}
+% {Fix !! usage in changes entries. graphics/2724}
+% \begin{macrocode}
+\let\Gin@req@sizes\relax
+\def\Gin@scalex{1}%
+\let\Gin@scaley\Gin@exclamation
+\let\Gin@req@height\Gin@nat@height
+\let\Gin@req@width\Gin@nat@width
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gin@viewport@code}
+% In the standard interface there is no possibility of specifying
+% a viewport, so this is a no-op.
+% \changes{v0.7a}{1995/04/11}{Macro added}
+% \begin{macrocode}
+\let\Gin@viewport@code\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@nosize}
+% \changes{v1.0p}{2014/10/14}{Fixed typo in error message}
+% \changes{v0.7f}{1995/11/10}
+% {Macro added}
+% This command is called in the case that the graphics type
+% specifies no `read file' and the user supplied no size arguments.
+% In the standard interface can only generate an error.
+% \begin{macrocode}
+\def\Gin@nosize#1{%
+ \@latex@error
+ {Cannot determine size of graphic in #1 (no size specified)}%
+ \@ehc}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Reading the BoundingBox in EPS files}
+%
+% \begin{macro}{\ifGin@bbox}
+% \changes{v0.7a}{1995/04/11}{Name changed from \cs{ifGin@viewport}}
+% This switch should be set \meta{true} once a size has been found,
+% either in an argument, or in an external file.
+% \begin{macrocode}
+\newif\ifGin@bbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gread@generic}
+% \changes{v1.2a}{2017/06/01}
+% {New macro}
+% \begin{macro}{\Gread@generic@aux}
+% \begin{macro}{\Gread@eps}
+% Read an EPS file (|#1|) and search for a line
+% starting with |%%BoundingBox| and returns the result
+% by setting four dimension registers
+% |\Gin@llx|, |\Gin@lly|, |\Gin@urx| and |\Gin@ury|.
+% \changes{v0.5e}{1994/1l/02}
+% {Fix the catcodes of \cs{endlinechar} and ctrl-D}
+% \changes{v0.7a}{1995/04/11}
+% {Fix more catcodes, for binary headers of eps files}
+% \changes{v1.2a}{2017/06/01}
+% {Split to allow code reuse by \cs{Gread@extractbb} in
+% \texttt{dvipdfmx.def} driver}
+% \begin{macro}{\Gread@eps@aux}
+% \begin{macrocode}
+\def\Gread@generic#1#2{%
+ \edef\Gread@attr@hash{%
+ \ifx\Gin@pagebox\@empty\else
+ :\Gin@pagebox
+ \fi
+ \ifx\Gin@page\@empty\else
+ :P\Gin@page
+ \fi
+ }%
+ \@ifundefined{#1 bbox\Gread@attr@hash}%
+ {\Gread@generic@aux{#1}{#2}}
+ {%
+ \expandafter\global\expandafter\let\expandafter\@gtempa
+ \csname #1 bbox\Gread@attr@hash\endcsname
+ }%
+ \expandafter\Gread@parse@bb\@gtempa\\%
+}
+\def\Gread@generic@aux#1#2{%
+ \begingroup
+% \end{macrocode}
+% Make it reasonably safe to have binary headers in the EPS file
+% before the bounding box line.
+% \begin{macrocode}
+ \@tempcnta\z@
+ \loop\ifnum\@tempcnta<\@xxxii
+ \catcode\@tempcnta14 %
+ \advance\@tempcnta\@ne
+ \repeat
+ \catcode`\^^?14 %
+ \let\do\@makeother
+ \dospecials
+% \end{macrocode}
+% Make sure tab and space are accepted as white space.
+% \changes{v1.0e}{1997/09/02}
+% {Allow TAB in DSC comments graphics/2587}
+% \changes{v1.0i}{1999/01/07}
+% {Fix catcode of hyphen. graphics/2846}
+% \begin{macrocode}
+ \catcode`\ 10 %
+ \catcode`\^^I10 %
+ \catcode\endlinechar5 %
+ \@makeother\:%
+ \@makeother\-%
+% \end{macrocode}
+% The first thing we need to do is to open the
+% information file, if possible.
+% \changes{v0.4d}{1994/05/06}
+% {Improve the error message if the info file is not there.}
+% \changes{v1.2a}{2017/06/01}
+% {Allow for spaces in name of a file}
+% Due to the space handling code file names are now already quoted
+% so we should not add any quotes around \verb=#1= any more.
+% \changes{v1.3b}{2019/07/20} {add quotes here again}
+% \begin{macrocode}
+ \immediate\openin\@inputcheck\quote@name{#1} %
+ #2{#1}%
+% \end{macrocode}
+% \changes{v0.3i}{1994/03/23}
+% {Wording of error message improved}
+% \changes{v1.0}{1996/05/29}
+% {Use \cs{@gtempa} not \cs{g@tempa} /2090}
+% \changes{v1.2b}{2017/06/13}
+% {Stored bounding box data for reuse}
+% \begin{macrocode}
+ \ifGin@bbox
+ \expandafter\xdef\csname #1 bbox\Gread@attr@hash\endcsname{\@gtempa}%
+ \else
+ \@latex@error
+ {Cannot determine size of graphic in #1 (no BoundingBox)}%
+ \@ehc
+ \gdef\@gtempa{0 0 72 72 }%
+ \fi
+ \endgroup
+}
+\def\Gread@eps#1{%
+ \Gread@generic{#1}\Gread@eps@aux
+}
+\def\Gread@eps@aux#1{%
+ \ifeof\@inputcheck
+ \@latex@error{File `#1' not found}\@ehc
+ \else
+% \end{macrocode}
+% Now we'll scan lines until we find one that starts with
+% |%%BoundingBox:|
+% We need to reset the catcodes to read the file, and so this
+% is done in a group.
+% \begin{macrocode}
+ \Gread@true
+ \let\@tempb\Gread@false
+ \loop
+ \read\@inputcheck to\@tempa
+ \ifeof\@inputcheck
+ \Gread@false
+ \else
+ \expandafter\Gread@find@bb\@tempa:.\\%
+ \fi
+ \ifGread@
+ \repeat
+ \immediate\closein\@inputcheck
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gread@find@bb}
+% If a line in the EPS file starts with a |%%BoundingBox:|, we
+% will examine it more closely. Note using the `extra' argument |#2#3|
+% causes any space after the |:| to be gobbled.
+% \begin{macrocode}
+\long\def\Gread@find@bb#1:#2#3\\{%
+ \def\@tempa{#1}%
+ \ifx\@tempa\Gread@BBox
+ \Gread@test@atend#2#3()\\%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Gread@test@atend}
+% Determine if the stuff following the |%%BoundingBox| is `(atend)',
+% which will involve further reading of the file. This is accomplished
+% by making |\@tempb| into a no-op, so that finding a |%%BoundingBox|
+% does not stop the loop.
+% \begin{macrocode}
+\def\Gread@test@atend#1(#2)#3\\{%
+ \def\@tempa{#2}%
+ \ifx\@tempa\Gread@atend
+ \Gread@true
+ \let\@tempb\relax
+ \else
+ \gdef\@gtempa{#1}%
+ \@tempb
+ \Gin@bboxtrue
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Gread@parse@bb}
+% We have |%%BoundingBox| and what follows is not `(atend)' so we
+% will parse the rest of the line as a BB with four elements.
+% PostScript files should never have units specified in the
+% BoundingBox comment, but we allow arbitrary \TeX\ units in external
+% files, or in other interfaces.
+% \begin{macrocode}
+\def\Gread@parse@bb#1 #2 #3 #4 #5\\{%
+ \Gin@defaultbp\Gin@llx{#1}%
+ \Gin@defaultbp\Gin@lly{#2}%
+ \Gin@defaultbp\Gin@urx{#3}%
+ \Gin@defaultbp\Gin@ury{#4}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gread@atend}
+% |atend| as a macro for testing with |\ifx|.
+% \begin{macrocode}
+\def\Gread@atend{atend}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Rotation}
+%
+% As above, we will re-use some existing local registers.
+%
+% \begin{macro}{\Grot@height}
+% \begin{macro}{\Grot@left}
+% \begin{macro}{\Grot@right}
+% \begin{macro}{\Grot@depth}
+% Final Rotated box dimensions
+% \begin{macrocode}
+\let\Grot@height\@ovxx
+\let\Grot@left\@ovyy
+\let\Grot@right\@ovdx
+\let\Grot@depth\@ovdy
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Grot@h}
+% \begin{macro}{\Grot@l}
+% \begin{macro}{\Grot@r}
+% \begin{macro}{\Grot@d}
+% Original box dimensions
+% \begin{macrocode}
+\let\Grot@l\@ovro
+\let\Grot@r\@ovri
+\let\Grot@h\@xdim
+\let\Grot@d\@ydim
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Grot@x}
+% \begin{macro}{\Grot@y}
+% Coordinates of centre of rotation.
+% \begin{macrocode}
+\let\Grot@x\@linelen
+\let\Grot@y\@dashdim
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\rotatebox}
+% The angle is specified by |#1|. The box to be rotated is |#2|.
+% In the standard interface the centre of rotation is $(0,0)$.
+% Then finally call |\Grot@box| to rotate the box.
+% \changes{v0.3f}{1994/03/11}{Remove star form}
+% \changes{v0.3h}{1994/03/17}{Fix Typo}
+% \changes{v0.7a}{1995/04/11}{\cs{leavevmode} added graphics/1521}
+% \changes{v1.0n}{2001/07/07}
+% {Made long (CAR) graphics/2908 and 3345}
+% \begin{macrocode}
+\long\def\rotatebox#1#2{%
+ \leavevmode
+ \Grot@setangle{#1}%
+ \setbox\z@\hbox{{#2}}%
+ \Grot@x\z@
+ \Grot@y\z@
+ \Grot@box}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\Grot@setangle}
+% Set the internal macro used by |\Grot@box|. In the standard
+% interface this is trivial, but other interfaces may have more
+% interesting definitions. For example:
+%\begin{verbatim}
+% \def\Grot@setangle#1{%
+% \dimen@#1\p@
+% \dimen@-57.2968\dimen@
+% \edef\Grot@angle{\strip@pt\dimen@}}
+%\end{verbatim}
+% This would cause the argument of |\rotatebox| to be interpreted as
+% an angle specified in \emph{radians}, \emph{clockwise}.
+% \begin{macrocode}
+\def\Grot@setangle#1{\edef\Grot@angle{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Deriving a `bounding box' for rotated object}
+% We want to know the size of a `bounding box' enclosing the rotated
+% box.
+% We define two formulae (as \TeX\ macros) to work out the $x$ and $y$
+% coordinates of vertices of the rotated box
+% in relation to its original coordinates (i.e., its width, height
+% and depth). The box we visualize with vertices $B$, $C$,
+% $D$ and $E$ is illustrated below. The vertex
+% $S$ is the reference point on the baseline. $O$ is the centre of
+% rotation, which in the standard interface is always $S$.
+%
+% \begin{center}
+% \setlength{\unitlength}{3pt}%
+%
+% \begin{picture}(34,36)(12,44)
+% \thicklines
+% \put(20,52){\dashbox{1}(20,21){}}
+% \put(20,80){\line(0,-1){36}}
+% \put(12,58){\line(1, 0){34}}
+% \put(41,59){A}
+% \put(40,74){B}
+% \put(21,74){C}
+% \put(21,49){D}
+% \put(40,49){E}
+% \put(21,59){S}
+% \put(33,65){O}
+% \put(33,65){\circle*{1}}
+% \end{picture}
+% \end{center}
+%
+% The formulae are, for a point $P$ and angle $\alpha$:
+%\[
+% \begin{array}{l}
+% P'_x = P_x - O_x \\
+% P'_y = P_y - O_y \\
+% P''_x = ( P'_x \times \cos(\alpha)) - ( P'_y \times \sin(\alpha) ) \\
+% P''_y = ( P'_x \times \sin(\alpha)) + ( P'_y \times \cos(\alpha) ) \\
+% P'''_x = P''_x + O_x + L_x \\
+% P'''_y = P''_y + O_y
+% \end{array}
+% \]
+% The `extra' horizontal translation $L_x$ at the end is calculated so
+% that the leftmost point of the resulting box has $x$-coordinate $0$.
+% This is desirable as \TeX\ boxes must have the reference point at
+% the left edge of the box.
+%
+% \begin{macro}{\Grot@Px}
+% Work out new $x$ coordinate of point after rotation. The parameters
+% |#2| and |#3| are the original $x$ and $y$ coordinates of the point.
+% The new $x$ coordinate is stored in |#1|.
+% \begin{macrocode}
+\def\Grot@Px#1#2#3{%
+ #1\Grot@cos#2%
+ \advance#1-\Grot@sin#3}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Grot@Py}
+% Work out new $y$ coordinate of point after rotation. The parameters
+% |#2| and |#3| are the original $x$ and $y$ coordinates of the point.
+% The new $y$ coordinate is stored in |#1|.
+% \begin{macrocode}
+\def\Grot@Py#1#2#3{%
+ #1\Grot@sin#2%
+ \advance#1\Grot@cos#3}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Grot@box}
+% This is the tricky bit. We can rotate the box, but then need
+% to work out how much space to leave for it on the page.
+%
+% We simplify matters by working out first which quadrant we are in, and
+% then picking just the right values.
+%
+% \begin{macrocode}
+\def\Grot@box{%
+ \begingroup
+% \end{macrocode}
+% We are going to need to know the sine and cosine
+% of the angle; simplest to calculate these now.
+% \begin{macrocode}
+ \CalculateSin\Grot@angle
+ \CalculateCos\Grot@angle
+ \edef\Grot@sin{\UseSin\Grot@angle}%
+ \edef\Grot@cos{\UseCos\Grot@angle}%
+^^A \GDebug{Rotate: angle \Grot@angle, sine is \Grot@sin,
+^^A cosine is \Grot@cos}%
+% \end{macrocode}
+% Save the four extents of the original box.
+% \begin{macrocode}
+ \Grot@r\wd\z@ \advance\Grot@r-\Grot@x
+ \Grot@l\z@ \advance\Grot@l-\Grot@x
+ \Grot@h\ht\z@ \advance\Grot@h-\Grot@y
+ \Grot@d-\dp\z@ \advance\Grot@d-\Grot@y
+% \end{macrocode}
+% Now a straightforward test to see which quadrant we are
+% operating in;
+% \begin{macrocode}
+ \ifdim\Grot@sin\p@>\z@
+ \ifdim\Grot@cos\p@>\z@
+% \end{macrocode}
+% First quadrant:
+% Height=$By$, Right=$Ex$, Left=$Cx$, Depth=$Dy$
+% \begin{macrocode}
+ \Grot@Py\Grot@height \Grot@r\Grot@h%B
+ \Grot@Px\Grot@right \Grot@r\Grot@d%E
+ \Grot@Px\Grot@left \Grot@l\Grot@h%C
+ \Grot@Py\Grot@depth \Grot@l\Grot@d%D
+ \else
+% \end{macrocode}
+% Second quadrant:
+% Height=$Ey$, Right=$Dx$, Left=$Bx$, Depth=$Cy$
+% \begin{macrocode}
+ \Grot@Py\Grot@height \Grot@r\Grot@d%E
+ \Grot@Px\Grot@right \Grot@l\Grot@d%D
+ \Grot@Px\Grot@left \Grot@r\Grot@h%B
+ \Grot@Py\Grot@depth \Grot@l\Grot@h%C
+ \fi
+ \else
+ \ifdim\Grot@cos\p@<\z@
+% \end{macrocode}
+% Third quadrant:
+% Height=$Dy$, Right=$Cx$, Left=$Ex$, Depth=$By$
+% \begin{macrocode}
+ \Grot@Py\Grot@height \Grot@l\Grot@d%D
+ \Grot@Px\Grot@right \Grot@l\Grot@h%C
+ \Grot@Px\Grot@left \Grot@r\Grot@d%E
+ \Grot@Py\Grot@depth \Grot@r\Grot@h%B
+ \else
+% \end{macrocode}
+% Fourth quadrant:
+% Height=$Cy$, Right=$Bx$, Left=$Dx$, Depth=$Ey$
+% \begin{macrocode}
+ \Grot@Py\Grot@height \Grot@l\Grot@h%C
+ \Grot@Px\Grot@right \Grot@r\Grot@h%B
+ \Grot@Px\Grot@left \Grot@l\Grot@d%D
+ \Grot@Py\Grot@depth \Grot@r\Grot@d%E
+ \fi
+ \fi
+% \end{macrocode}
+% Now we should translate back by $(O_x,O_y)$, but \TeX\ can not really
+% deal with boxes that do not have the reference point at the left edge.
+% (Everything with a $-$ve $x$-coordinate would over-print earlier
+% text). So we modify the horizontal translation so that the
+% reference point as understood by \TeX\ \emph{is} at the left edge.
+% This means that the `centre of rotation' is not fixed by |\rotatebox|,
+% but typically moves horizontally. We also need to find the image of
+% the original reference point, $S$, as that is where the rotation
+% specials must be inserted.
+%
+% \begin{macrocode}
+ \advance\Grot@height\Grot@y
+ \advance\Grot@depth\Grot@y
+ \Grot@Px\dimen@ \Grot@x\Grot@y
+ \Grot@Py\dimen@ii \Grot@x\Grot@y
+ \dimen@-\dimen@ \advance\dimen@-\Grot@left
+ \dimen@ii-\dimen@ii \advance\dimen@ii\Grot@y
+% \end{macrocode}
+%
+% \begin{macrocode}
+^^A \GDebug{Rotate: (l,r,h,d)^^J%
+^^A Original \the\Grot@l,\the\Grot@r,\the\Grot@h,\the\Grot@d,^^J%
+^^A New..... \the\Grot@left,\the\Grot@right,%
+^^A \the\Grot@height,\the\Grot@depth}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \setbox\z@\hbox{%
+ \kern\dimen@
+ \raise\dimen@ii\hbox{\Grot@start\box\z@\Grot@end}}%
+ \ht\z@\Grot@height
+ \dp\z@-\Grot@depth
+ \advance\Grot@right-\Grot@left\wd\z@\Grot@right
+ \leavevmode\box\z@
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Stretching and Scaling}
+%
+%
+% \begin{macro}{\scalebox}
+% The top level |\scalebox|. If the vertical scale factor is omitted it
+% defaults to the horizontal scale factor, |#1|.
+% \changes{v0.3d}{1994/03/06}{Better support for negative arguments.}
+% \begin{macrocode}
+\def\scalebox#1{%
+ \@ifnextchar[{\Gscale@box{#1}}{\Gscale@box{#1}[#1]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gscale@box}
+% Internal version of |\scalebox|.
+% \changes{v0.7a}{1995/04/11}
+% {\cs{leavevmode} moved earlier. graphics/1521}
+% \changes{v1.0j}{1999/01/07}
+% {made long. graphics/2908}
+% \changes{v1.1b}{2017/04/14}
+% {Adjust box resizing for math mode gh issue 6}
+% \begin{macrocode}
+\long\def\Gscale@box#1[#2]#3{%
+ \leavevmode
+ \def\Gscale@x{#1}\def\Gscale@y{#2}%
+ \setbox\z@\hbox{{#3}}%
+ \setbox\tw@\hbox{\Gscale@start\rlap{\copy\z@}\Gscale@end}%
+ \ifdim#2\p@<\z@
+ \ht\tw@-#2\dp\z@
+ \dp\tw@-#2\ht\z@
+ \else
+ \ht\tw@#2\ht\z@
+ \dp\tw@#2\dp\z@
+ \fi
+ \ifdim#1\p@<\z@
+ \hb@xt@-#1\wd\z@{\kern-#1\wd\z@\box\tw@\hss}%
+ \else
+ \hb@xt@#1\wd\z@{\box\tw@\kern#1\wd\z@\hss}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\reflectbox}
+% Just an abbreviation for the appropriate scale to get reflection.
+% \changes{v0.3e}{1994/03/09}{Macro added}
+% \begin{macrocode}
+\def\reflectbox{\Gscale@box-1[1]}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\resizebox}
+% \changes{v0.3b}{1994/03/01}{Recode \cmd\resizebox.}
+% \changes{v0.7b}{1995/04/27}
+% {Add \cs{leavevmode} for graphics/1512}
+% Look for a |*|, which specifies that a final vertical size refers to
+% `height + depth' not just `height'.
+% \begin{macrocode}
+\def\resizebox{%
+ \leavevmode
+ \@ifstar{\Gscale@@box\totalheight}{\Gscale@@box\height}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gscale@@box}
+% Look for the |!| in the arguments.
+% \changes{v0.5a}{1994/07/20}
+% {Support French active !!}
+% \changes{v0.5d}{1994/10/24}
+% {Correct the support for !!}
+% \changes{v0.7g}
+% {1995/12/06}{Use \cs{Gin@exclamation}}
+% \begin{macrocode}
+\def\Gscale@@box#1#2#3{%
+ \let\@tempa\Gin@exclamation
+ \expandafter\def\expandafter\@tempb\expandafter{\string#2}%
+ \expandafter\def\expandafter\@tempc\expandafter{\string#3}%
+ \ifx\@tempb\@tempa
+ \ifx\@tempc\@tempa
+ \toks@{\mbox}%
+ \else
+ \toks@{\Gscale@box@dd{#3}#1}%
+ \fi
+ \else
+ \ifx\@tempc\@tempa
+ \toks@{\Gscale@box@dd{#2}\width}%
+ \else
+ \toks@{\Gscale@box@dddd{#2}\width{#3}#1}%
+ \fi
+ \fi
+ \the\toks@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gscale@box@dd}
+% Scale the text |#3| in both directions by a factor $|#1|/|#2|$.
+% \changes{v0.3i}{1994/03/23}
+% {Missing percent added}
+% \changes{v1.0i}{1999/01/07}
+% {made long. graphics/2908}
+% \begin{macrocode}
+\long\def\Gscale@box@dd#1#2#3{%
+ \@begin@tempboxa\hbox{#3}%
+ \setlength\@tempdima{#1}%
+ \setlength\@tempdimb{#2}%
+ \Gscale@div\@tempa\@tempdima\@tempdimb
+ \Gscale@box\@tempa[\@tempa]{\box\@tempboxa}%
+ \@end@tempboxa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gscale@box@dddd}
+% Scale the text |#5| horizontally by a factor $|#1|/|#2|$ and
+% vertically by a factor $|#3|/|#4|$.
+% \changes{v0.3i}{1994/03/23}
+% {Missing percent added}
+% \changes{v0.7e}{1995/09/29}
+% {Add \cs{ifGin@iso} code added}
+% \changes{v1.0i}{1999/01/07}
+% {made long. graphics/2908}
+% \begin{macrocode}
+\long\def\Gscale@box@dddd#1#2#3#4#5{%
+ \@begin@tempboxa\hbox{#5}%
+ \setlength\@tempdima{#1}%
+ \setlength\@tempdimb{#2}%
+ \Gscale@div\@tempa\@tempdima\@tempdimb
+ \setlength\@tempdima{#3}%
+ \setlength\@tempdimb{#4}%
+ \Gscale@div\@tempb\@tempdima\@tempdimb
+ \ifGin@iso
+ \ifdim\@tempa\p@>\@tempb\p@
+ \let\@tempa\@tempb
+ \else
+ \let\@tempb\@tempa
+ \fi
+ \fi
+ \Gscale@box\@tempa[\@tempb]{\box\@tempboxa}%
+ \@end@tempboxa}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifGin@iso}
+% If this flag is true, then specifying two lengths to |\resizebox|
+% scales the box by the same factor in either direction, such that
+% neither length \emph{exceeds} the stated amount. No user interface
+% to this flag in the standard package, but it is used by the
+% |keepaspectratio| key to |\includegraphics| in the \textsf{graphicx}
+% package.
+% \changes{v0.7e}{1995/09/29}
+% {Macro added}
+% \begin{macrocode}
+\newif\ifGin@iso
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gscale@div}
+% The macro |#1| is set to the ratio of the lengths |#2| and |#3|.
+% \changes{v0.7a}{1995/04/11}
+% {Add trap for division by 0}
+% \changes{v0.7d}{1995/09/27}
+% {Use \cs{setlength} to support calc package}
+% \changes{v1.0a}{1996/09/16}
+% {Stop infinite loop if 2nd arg zero. graphics/2259}
+% \begin{macrocode}
+\def\Gscale@div#1#2#3{%
+ \setlength\dimen@{#3}%
+ \ifdim\dimen@=\z@
+ \PackageError{graphics}{Division by 0}\@eha
+ \dimen@#2%
+ \fi
+ \edef\@tempd{\the\dimen@}%
+ \setlength\dimen@{#2}%
+ \count@65536\relax
+ \ifdim\dimen@<\z@
+ \dimen@-\dimen@
+ \count@-\count@
+ \fi
+ \ifdim\dimen@>\z@
+ \loop
+% \end{macrocode}
+%
+% \changes{v1.0u}{2016/10/09}
+% {avoid overflow for small lengths eg 5sp divided by 2sp}
+% \begin{macrocode}
+ \ifdim\ifnum\count@<\tw@\maxdimen\else\dimen@\fi<8192\p@
+ \dimen@\tw@\dimen@
+ \divide\count@\tw@
+ \repeat
+ \dimen@ii\@tempd\relax
+ \divide\dimen@ii\count@
+ \divide\dimen@\dimen@ii
+ \fi
+ \edef#1{\strip@pt\dimen@}}
+% \end{macrocode}
+% \end{macro}
+%
+% Restore Catcodes
+% \begin{macrocode}
+\Gin@codes
+\let\Gin@codes\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
diff --git a/macros/latex-dev/required/graphics/graphics.ins b/macros/latex-dev/required/graphics/graphics.ins
new file mode 100644
index 0000000000..95e190c9ec
--- /dev/null
+++ b/macros/latex-dev/required/graphics/graphics.ins
@@ -0,0 +1,43 @@
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%% This file has the LPPL maintenance status "maintained".
+
+\input docstrip
+
+\preamble
+
+The source is maintained by the LaTeX Project team and bug
+reports for it can be opened at https://latex-project.org/bugs/
+(but please observe conditions on bug reports sent to that address!)
+
+
+\endpreamble
+
+\keepsilent
+\askforoverwritefalse
+
+\usedir{tex/latex/graphics}
+
+% The packages
+
+\generate{\file{graphics.sty}{\from{graphics.dtx}{package}}}
+
+\generate{\file{color.sty}{\from{color.dtx}{package}}}
+
+\generate{\file{graphicx.sty}{\from{graphicx.dtx}{package}}}
+
+\generate{\file{trig.sty}{\from{trig.dtx}{package}}}
+
+\generate{\file{keyval.sty}{\from{keyval.dtx}{package}}}
+
+\generate{\file{epsfig.sty}{\from{epsfig.dtx}{package}}}
+
+\generate{\file{lscape.sty}{\from{lscape.dtx}{package}}}
+
+\generate{\file{rotating.sty}{\from{rotating.dtx}{package}}}
+
+\endbatchfile
diff --git a/macros/latex-dev/required/graphics/graphics.pdf b/macros/latex-dev/required/graphics/graphics.pdf
new file mode 100644
index 0000000000..63a2ed999c
--- /dev/null
+++ b/macros/latex-dev/required/graphics/graphics.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/graphicx.dtx b/macros/latex-dev/required/graphics/graphicx.dtx
new file mode 100644
index 0000000000..aad8460ac5
--- /dev/null
+++ b/macros/latex-dev/required/graphics/graphicx.dtx
@@ -0,0 +1,939 @@
+%
+% \iffalse
+%
+%% graphicx.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz
+%% Copyright (C) 1995--2015,2017 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%<*dtx>
+ \ProvidesFile{graphicx.dtx}
+%</dtx>
+%<package>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+%<package>\ProvidesPackage{graphicx}
+%<driver> \ProvidesFile{graphicx.drv}
+% \fi
+% \ProvidesFile{graphicx.dtx}
+ [2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)]
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\newenvironment{key}[2]{\expandafter\macro\expandafter{%
+ \csname KV@#1@#2\endcsname}}{\endmacro}
+%
+\begin{document}
+ \DocInput{graphicx.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{graphicx.dtx}
+%
+% \title{The \textsf{graphicx} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{D. P. Carlisle\and S. P. Q. Rahtz}
+% \date{\filedate}
+% \MaintainedByLaTeXTeam{graphics}
+% \maketitle
+%
+%
+% \changes{v0.3}{1994/03/01}
+% {First DPC version (after prototype by SPQR).}
+% \changes{v0.4b}{1994/05/30}
+% {Rename from egraphics. 8+3 name for CDROM}
+% \changes{v1.0}{1996/05/29}
+% {Version 1 at last}
+%
+% \def\star{{\ttfamily*}}
+% \makeatletter
+% \def\Describe@Macro#1{\endgroup
+% \setbox0=\lastbox\llap{\PrintDescribeMacro{#1}}}%
+% \makeatother
+% \marginparsep0pt
+%
+% \section{Introduction}
+%
+% This package provides an alternative interface to the \LaTeXe\
+% graphics functions. The command names provided are the same as in the
+% standard package, and they use the same internal functions. However
+% the meaning of the optional arguments is different. Note \emph{only}
+% the optional arguments have changed: any document which only uses the
+% graphics commands with the mandatory arguments and/or the star-forms
+% will work identically (with essentially identical implementation) with
+% the two packages.
+%
+% \section{Key=Value Interface}
+% When the decision to produce \LaTeXe\ was made, certain `guiding
+% principles' were made (and published in the original announcement).
+% One of these was that all new features would `conform to the
+% conventions of version 2.09'. Specifically this meant that new
+% commands would obey the same basic syntax rules for arguments as the
+% existing commands.
+%
+% Standard \LaTeX\ optional arguments are \emph{positional}. If a
+% command were to take three optional arguments, then there would be no
+% way of specifying only the third, one would have to give all three,
+% even if the first two were repeats of the default values. Basically
+% this means that `standard' optional arguments are not suitable if
+% there is more than one option. Various existing packages (for
+% \LaTeX~2.09) have recognised this, and used `named arguments' in
+% various forms. Perhaps the two most noticeable are |psfig| and
+% |pstricks|. With `named arguments' (sometimes called `attributes')
+% each option is not tied to a particular position, but rather given a
+% name (or key) and any options that must be set are set by explicitly
+% associating this name with the desired value.
+%
+% The members of the \LaTeX3 project do appreciate the importance of
+% this kind of syntax, but felt that rather than extending the syntax of
+% \LaTeX\ in an uncoordinated way, it would be better to keep with
+% `standard arguments' in \LaTeXe, which is intended as a `consolidation
+% of existing \LaTeX\ variants'. The long term planning for an eventual
+% \LaTeX3 release will then be able to consider the whole \LaTeX\
+% user interface, and a suitable syntax for named arguments. It is
+% important that such an interface design is not hampered by having to
+% retain compatibility with earlier attempts at a named argument
+% syntax. For this reason this |graphicx| package, which uses the named
+% argument mechanism from the |keyval| package should be considered `non
+% standard' although it is supported by the same mechanism, and same
+% authors as the `standard' |graphics| package.
+%
+% \section{The User Interface}
+%
+% \DescribeMacro
+% \includegraphics\star\oarg{key-val list}\marg{file}\\
+% \DescribeMacro
+% \includegraphics\star\oarg{llx,lly}\oarg{urx,ury}\marg{file}\\
+% Include a graphics file.
+%
+% The star form is just for
+% compatibility with the standard interface, and essentially just adds
+% |clip| to the keys specified. Similarly the second, two-optional
+% argument form is for increased compatibility with the standard
+% package. The two optional argument form is not needed in the |keyval|
+% interface.
+%
+% Various `keys' or named arguments are supported.
+% \begin{description}
+% \item[bb] Set the bounding box. The argument should be four
+% dimensions, separated by spaces.
+% \item[bbllx,bblly,bburx,bbury] Set the bounding box. Mainly for
+% compatibility with older packages. |bbllx=a,bblly=b,bburx=c,bbury=d|
+% is equivalent to |bb = a b c d|.
+% \item[natwidth,natheight] Again an alternative to |bb|.
+% |natheight=h,natwidth=w| is equivalent to |bb = 0 0 h w|.
+% \item[viewport] Modify the bounding box specified in the file.
+% The four values specify a bounding box \emph{relative} to the
+% |llx|,|lly| coordinate of the original box.
+% \item[trim] Modify the bounding box specified in the file.
+% The four values specify the amounts to remove from
+% the left, bottom, right and top of the original box.
+% \item[hiresbb] Boolean valued key. Defaults to |true|.
+% Causes \TeX\ to look for |%%HiResBoundingBox| comments rather than
+% the standard |%%BoundingBox|. May be set to |false| to override
+% a default setting of true specified by the |hiresbb| package option.
+% \item[angle] Rotation angle.
+% \item[origin] Rotation origin (see |\rotatebox|, below).
+% \item[width] Required width, a dimension (default units |bp|). The
+% graphic will be scaled to make the width the specified dimension.
+% \item[height] Required height. a dimension (default units |bp|).
+% \item[totalheight] Required totalheight (i.e., height $+$ depth). a
+% dimension (default units |bp|). Most useful after a rotation (when the
+% height might be zero).
+% \item[keepaspectratio] Boolean valued key (like |clip|). If it is set
+% to true, modify the meaning of the |width| and |height| (and
+% |totalheight|) keys such that if both are specified then rather than
+% distort the figure the figure is scaled such that neither dimension
+% \emph{exceeds} the stated dimensions.
+% \item[scale] Scale factor.
+% \item[clip] Either `true' or `false' (or no value, which is equivalent
+% to `true'). Clip the graphic to the bounding box (or viewport if one
+% is specified).
+% \item[draft] a boolean valued key, like `clip'. locally switches to
+% draft mode, ie.\ do not include the graphic, but leave the
+% correct space, and print the filename.
+% \item[type] Specify the file type. (Normally determined from the file
+% extension.)
+% \item[ext] Specify the file extension.
+% \emph{Only} for use with |type|.
+% \item[read] Specify the `read file' which is used for determining the
+% size of the graphic. \emph{Only} for use with |type|.
+% \item[command] Specify the file command.
+% \emph{Only} for use with |type|.
+% \item[quiet] Turns off writing information about graphics to the |.log|.
+% \item[page] The page of a multi-page PDF graphic to be used.
+% \item[interpolate] Enables interpolation of bitmap images by viewers.
+% \item[pagebox] Specifies which PDF box should be used for the natural image size, one of
+% mediabox, cropbox, bleedbox, trimbox, artbox. The default is driver-specific.
+% \end{description}
+%
+% The arguments are interpreted left to right. |clip|, |draft|, |bb|,,
+% and |bbllx| etc.\ have the same effect wherever they appear. but the
+% scaling and rotation keys interact.
+%
+% Any scaling that is specified \emph{before} rotation, is handled by
+% the internal graphics inclusion function. Rotation, or any later
+% scaling is handled by implicitly calling |\rotatebox| or |\scalebox|.
+% So |[height=1in,angle=90]| scales the graphic to 1in, then rotates it,
+% so it is one inch wide. |[angle=90,height=1in]| first rotates, then
+% scales the result so that it is 1in high. A driver that can scale
+% included graphics, but not arbitrary text will not be able to support
+% the second form, as it will require a call to |\scalebox|, but the
+% first form should work as there the scaling is handled by
+% |\Ginclude@graphics|.
+%
+% \DescribeMacro
+% \rotatebox\oarg{key-val list}\marg{angle}\marg{text}\\
+% Rotate \emph{text}.
+%
+% The keys supported by |\rotatebox| are:
+% \begin{description}
+% \item[origin] Specify the centre of rotation. |origin=|\meta{label},
+% where the labels are up to two of |lrctbB| (|B| denotes the
+% baseline, as for PSTricks).
+% \item[x,y] An alternative to
+% |origin|. |x=|\meta{dimen}|,y=|\meta{dimen} The $x,y$ coordinate of
+% the centre of rotation. As usual |\height| etc may be used.
+% \item[units] Specify the units used in the main argument. eg
+% |units=-360| would mean that the argument referred to degrees
+% \emph{clockwise} instead of the default anti-clockwise rotation.
+% \end{description}
+%
+% As an example |\rotatebox[origin=c]{180}{text}| will rotate ``text''
+% around its centre, thus creating a final box of the same dimensions as
+% the original box. This is to be contrasted to the default behaviour,
+% which rotates around the reference point on the baseline, thus
+% producing a box that is mainly \emph{below} the baseline.
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% One new option is handled by keyval. It suppresses the error
+% normally generated if an unknow keyval key is used.
+% (This helps porting between drivers that use extended interfaces.)
+% \changes{v1.0e}{1999/01/10}{new unknownkeysallowed option}
+% \begin{macrocode}
+\DeclareOption{unknownkeysallowed}
+ {\PassOptionsToPackage\CurrentOption{keyval}}
+% \end{macrocode}
+%
+% All other options are handled by the \textsf{graphics} package.
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+%
+% This package requires these two building blocks.
+% \begin{macrocode}
+\RequirePackage{keyval,graphics}
+% \end{macrocode}
+%
+%
+% \subsection{Graphics Inclusion}
+%
+%
+% First we declare the `bounding box' keys. These all use
+% |\Gin@defaultbp| so that the \meta{value} can be given as a length in
+% the usual \TeX\ units such as |cm| or as an integer, taken as |bp|.
+%
+% \begin{key}{Gin}{bb}
+% \begin{macrocode}
+\define@key{Gin}{bb}
+ {\Gin@bboxtrue\Gread@parse@bb#1 \\}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{bbllx}
+% \begin{key}{Gin}{bblly}
+% \begin{key}{Gin}{bburx}
+% \begin{key}{Gin}{bbury}
+% \changes{v0.3b}{1994/03/11}{use bbllx not llx}
+% \changes{v0.3b}{1994/03/11}{add natheight and natwidth}
+% \changes{v0.6a}{1995/04/11}{New \cs{Gin@defaultbb} code}
+% \changes{v0.6b}{1995/06/26}{typos fixed for graphics/1685}
+% \begin{macrocode}
+\define@key{Gin}{bbllx}
+ {\Gin@bboxtrue\Gin@defaultbp\Gin@llx{#1}}
+\define@key{Gin}{bblly}
+ {\Gin@bboxtrue\Gin@defaultbp\Gin@lly{#1}}
+\define@key{Gin}{bburx}
+ {\Gin@bboxtrue\Gin@defaultbp\Gin@urx{#1}}
+\define@key{Gin}{bbury}
+ {\Gin@bboxtrue\Gin@defaultbp\Gin@ury{#1}}
+% \end{macrocode}
+% \end{key}
+% \end{key}
+% \end{key}
+% \end{key}
+%
+% \begin{key}{Gin}{hiresbb}
+% \changes{v1.0b}{1996/10/29}
+% {hiresbb key added}
+% If set to true (the default) \TeX\ will look for bounding box
+% comments of the form |%%HiResBoundingBox| (which typically have
+% real values) instead of the standard |%%BoundingBox| (which should
+% have integer values).
+% It may be set to false to override a package option of hiresbb.
+% \begin{macrocode}
+\define@key{Gin}{hiresbb}[true]{%
+ \edef\Gread@BBox{%
+ \@percentchar\@percentchar
+ \csname if#1\endcsname HiRes\fi
+ BoundingBox}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{natheight}
+% \begin{key}{Gin}{natheight}
+% \changes{v0.6d}{1995/09/22}
+% {typos fixed in natheight and natwidth keys}
+% \begin{macrocode}
+\let\KV@Gin@natwidth\KV@Gin@bburx
+\let\KV@Gin@natheight\KV@Gin@bbury
+% \end{macrocode}
+% \end{key}
+% \end{key}
+%
+% \begin{key}{Gin}{viewport}
+% \begin{key}{Gin}{trim}
+% \changes{v0.6a}{1995/04/11}{viewport and trim keys added}
+% \changes{v0.6c}{1995/09/07}{arithmetic in viewport key fixed}
+% A `viewport' is a user-specified area of the graphic to be included.
+% It should not be confused with the `Bounding Box' of a PS file.
+% In fact, the origin for a viewport specification is the (llx,lly)
+% lower left coordinate of the bounding box. If a viewport is
+% specified, and clipping is turned on, clipping is based on the
+% viewport, not on the boundingbox.
+%
+% Both `viewport' and `trim' were suggested (and originally, but
+% differently, implemented) by Arthur Ogawa.
+% \begin{macrocode}
+\define@key{Gin}{viewport}
+ {\let\Gin@viewport@code\Gin@viewport\Gread@parse@vp#1 \\}
+\define@key{Gin}{trim}
+ {\let\Gin@viewport@code\Gin@trim\Gread@parse@vp#1 \\}
+% \end{macrocode}
+% \end{key}
+% \end{key}
+%
+% \begin{macro}{\Gread@parse@vp}
+% Grabs four bounding box values like |\Gread@parse@bp| but saves them
+% in alternative macros that are used in the viewport and trim cases to
+% modify the bounding box read from the file.
+% \begin{macrocode}
+\def\Gread@parse@vp#1 #2 #3 #4 #5\\{%
+ \Gin@defaultbp\Gin@vllx{#1}%
+ \Gin@defaultbp\Gin@vlly{#2}%
+ \Gin@defaultbp\Gin@vurx{#3}%
+ \Gin@defaultbp\Gin@vury{#4}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@viewport}
+% \changes{v1.0c}{1996/10/31}{Original bb saved}
+% If a viewport is specified, reset the bounding box coordinates
+% by adding the original origin, |\Gin@llx|, |\Gin@lly| to the new
+% values specified as the viewport. The original Bounding box
+% coordinates are saved in |\Gin@ollx|\ldots\ some drivers
+% might need this information (currently just |tcidvi|).
+% \begin{macrocode}
+\def\Gin@viewport{%
+ \let\Gin@ollx\Gin@llx
+ \let\Gin@olly\Gin@lly
+ \let\Gin@ourx\Gin@urx
+ \let\Gin@oury\Gin@ury
+ \dimen@\Gin@llx\p@\advance\dimen@ \Gin@vurx\p@
+ \edef\Gin@urx{\strip@pt\dimen@}%
+ \dimen@\Gin@lly\p@\advance\dimen@ \Gin@vury\p@
+ \edef\Gin@ury{\strip@pt\dimen@}%
+ \dimen@\Gin@llx\p@\advance\dimen@ \Gin@vllx\p@
+ \edef\Gin@llx{\strip@pt\dimen@}%
+ \dimen@\Gin@lly\p@\advance\dimen@ \Gin@vlly\p@
+ \edef\Gin@lly{\strip@pt\dimen@}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@trim}
+% \changes{v1.0c}{1996/10/31}{Original bb saved}
+% If a trim is specified, reset the bounding box coordinates
+% by trimming the four specified values off each side of the
+% graphic.
+% \begin{macrocode}
+\def\Gin@trim{%
+ \let\Gin@ollx\Gin@llx
+ \let\Gin@olly\Gin@lly
+ \let\Gin@ourx\Gin@urx
+ \let\Gin@oury\Gin@ury
+ \dimen@\Gin@llx\p@\advance\dimen@ \Gin@vllx\p@
+ \edef\Gin@llx{\strip@pt\dimen@}%
+ \dimen@\Gin@lly\p@\advance\dimen@ \Gin@vlly\p@
+ \edef\Gin@lly{\strip@pt\dimen@}%
+ \dimen@\Gin@urx\p@\advance\dimen@ -\Gin@vurx\p@
+ \edef\Gin@urx{\strip@pt\dimen@}%
+ \dimen@\Gin@ury\p@\advance\dimen@ -\Gin@vury\p@
+ \edef\Gin@ury{\strip@pt\dimen@}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@vllx}
+% \begin{macro}{\Gin@vlly}
+% \begin{macro}{\Gin@vurx}
+% \begin{macro}{\Gin@vury}
+% Four macros to hold the modifiers for the bounding box for viewport
+% and trim specifications.
+% \begin{macrocode}
+\let\Gin@vllx\Gin@llx\let\Gin@vlly\Gin@llx
+\let\Gin@vurx\Gin@llx\let\Gin@vury\Gin@llx
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{key}{Gin}{angle}
+% Specify a rotation. This is just handled by wrapping the
+% |\includegraphics| command in a call to the internal version of
+% |\rotatebox|. Normally this is the `standard' version but if an
+% |origin| key is used in |\includegraphics| then the \emph{keyval}
+% version of origin is used, and the |origin| key is passed on.
+% \begin{macrocode}
+\define@key{Gin}{angle}
+ {\Gin@esetsize
+ \@tempswatrue
+ \edef\@tempa{\toks@{\noexpand\Gin@erotate{#1}{\the\toks@}}}%
+ \@tempa}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{origin}
+% Pass the origin key value on to |\rotatebox|. |\Gin@erotate| is
+% initialised to |\Grot@box@std| later in the file, after the latter has
+% been defined.
+% \changes{v0.6e}{1995/09/28}
+% {key added}
+% \begin{macrocode}
+\define@key{Gin}{origin}[c]{%
+ \def\Gin@erotate{\Grot@box@kv[origin=#1]}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{width}
+% \begin{key}{Gin}{height}
+% Save the required height and width. The actual scaling is done later.
+% \begin{macrocode}
+\define@key{Gin}{width}{\def\Gin@ewidth{#1}}
+\define@key{Gin}{height}{\def\Gin@eheight{#1}}
+% \end{macrocode}
+% \end{key}
+% \end{key}
+%
+% \begin{key}{Gin}{totalheight}
+% \changes{v0.6a}{1995/04/11}{New totalheight key}
+% The same as |height| key, but locally changes |\Gin@eresize| to
+% |\totalheight| from its default value of |\height|.
+% \begin{macrocode}
+\define@key{Gin}{totalheight}{%
+ \def\Gin@eresize{\totalheight}\def\Gin@eheight{#1}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{keepaspectratio}
+% Boolean valued key (like |clip|). If it is set to true,
+% modify the meaning of the |width| and |height| (and |totalheight|)
+% keys such that if both are specified then rather than distort the
+% figure the figure is scaled such that neither dimension \emph{exceeds}
+% the stated dimensions.
+% \changes{v0.6e}{1995/09/28}
+% {key added}
+% \changes{v0.6h}{1995/12/06}
+% {Name changed to keepaspectratio}
+% \begin{macrocode}
+\define@key{Gin}{keepaspectratio}[true]{%
+ \lowercase{\Gin@boolkey{#1}}{iso}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{scale}
+% \changes{v0.6h}{1995/12/06}
+% {Use \cs{Gin@exclamation}}
+% If the scaling is being handled externally, wrap |\includegraphics| in
+% the internal form of |\scalebox|, otherwise locally define
+% |\Gin@req@sizes| to calculate the required sizes based on
+% scale factor.
+% \begin{macrocode}
+\define@key{Gin}{scale}{%
+ \if@tempswa
+ \edef\@tempa{\toks@{\noexpand\Gscale@box{#1}[#1]{\the\toks@}}}%
+ \@tempa
+ \else
+ \def\Gin@req@sizes{%
+ \def\Gin@scalex{#1}\let\Gin@scaley\Gin@exclamation
+ \Gin@req@height\Gin@scalex\Gin@nat@height
+ \Gin@req@width\Gin@scalex\Gin@nat@width}%
+ \fi
+ \@tempswatrue}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{draft}
+% Locally set the draft switch to true. This is used by the code in
+% \textsf{graphics} package to suppress the file inclusion.
+% \begin{macrocode}
+\define@key{Gin}{draft}[true]{%
+ \lowercase{\Gin@boolkey{#1}}{draft}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{clip}
+% Locally set the clip switch to true. This is used by the code in
+% \textsf{graphics} package to suppress the printing of anything outside
+% the bounding box specified.
+% \begin{macrocode}
+\define@key{Gin}{clip}[true]{%
+ \lowercase{\Gin@boolkey{#1}}{clip}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{type}
+% If you use `type' you must use no extension in the main argument
+% and you must use `ext'. You can also use `read' and `command'.
+% \changes{v0.5a}{1994/11/29}
+% {remove \cs{Gin@sep}}
+% \begin{macrocode}
+\define@key{Gin}{type}{%
+ \def\Ginclude@graphics##1{%
+ \begingroup
+ \def\Gin@base{##1}%
+ \edef\@tempa{{#1}{\Gin@eread}{\Gin@ecom{##1\Gin@eext}}}%
+ \expandafter\Gin@setfile\@tempa
+ \endgroup}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{ext}
+% \changes{v1.0d}{1997/06/09}{initialise ext to empty}
+% Specify an extension, for use with the `type' key.
+% \begin{macrocode}
+\define@key{Gin}{ext}{\def\Gin@eext{#1}}
+\let\Gin@eext\@empty
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{read}
+% Specify a read file, for use with the `type' key.
+% You may want to globally set this to |*| using |\setkeys|.
+% |*| means read the graphic file for size info, as in
+% |\DeclareGraphicsRule|.
+% \changes{v0.5a}{1994/11/29}
+% {Add default * possibility.}
+% \begin{macrocode}
+\define@key{Gin}{read}{%
+ \def\Gin@eread{#1}%
+ \def\@tempa{*}\ifx\@tempa\Gin@eread\def\Gin@eread{\Gin@eext}\fi}
+\let\Gin@eread\@empty
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{command}
+% Specify a command, for use with the `type' key.
+% \begin{macrocode}
+\define@key{Gin}{command}{\def\Gin@ecom##1{#1}}
+\let\Gin@ecom\@firstofone
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{decodearray}
+% \changes{v1.1b}{2017/06/25}{New decodearray key}
+% For manipulating bitmap images.
+% \begin{macrocode}
+\define@key{Gin}{decodearray}{%
+ \def\Gin@decode{#1}%
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{quiet}
+% \changes{v1.1a}{2017/06/01}{New quiet key}
+% Skip writing to the log.
+% \begin{macrocode}
+\define@key{Gin}{quiet}{%
+ \let\Gin@log\@gobble
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{page}
+% \changes{v1.1a}{2017/06/01}{New page key}
+% Page of a multi-page (PDF) graphic.
+% \begin{macrocode}
+\define@key{Gin}{page}{%
+ \def\Gin@page{#1}%
+ \ifx\Gin@page\@empty
+ \else
+ \edef\Gin@page{\number\Gin@page}%
+ \fi
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{interpolate}
+% \changes{v1.1a}{2017/06/01}{New interpolate key}
+% Enable/disable interpolation of bitmap images by the viewer.
+% \begin{macrocode}
+\define@key{Gin}{interpolate}[true]{%
+ \lowercase{\Gin@boolkey{#1}}{interpolate}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Gin}{pagebox}
+% \changes{v1.1a}{2017/06/01}{New pagebox key}
+% Specify which PDF box to use for the natural image size in PDF inclusions.
+% \begin{macrocode}
+\define@key{Gin}{pagebox}{%
+ \expandafter\let\expandafter\Gin@pagebox
+ \csname Gin@pagebox@#1\endcsname
+ \ifx\Gin@pagebox\relax
+ \let\Gin@pagebox\Gin@pagebox@cropbox
+ \@warning{%
+ Unknown value `#1' for `pagebox'.\MessageBreak
+ Supported values:\MessageBreak
+ mediabox, cropbox, bleedbox, trimbox, artbox%
+ }%
+ \fi
+ }
+ \def\Gin@pagebox@mediabox{mediabox}%
+ \def\Gin@pagebox@cropbox{cropbox}%
+ \def\Gin@pagebox@bleedbox{bleedbox}%
+ \def\Gin@pagebox@trimbox{trimbox}%
+ \def\Gin@pagebox@artbox{artbox}%
+% \end{macrocode}
+% \end{key}
+%
+% \begin{macro}{\Gin@boolkey}
+% Helper function for defining boolean valued functions. The order of
+% arguments allows |\lowercase| to only act on the user-supplied
+% argument.
+% \changes{v0.4a}{1994/04/14}{Make `empty'!=true so clip!= works}
+% \begin{macrocode}
+\def\Gin@boolkey#1#2{%
+ \csname Gin@#2\ifx\relax#1\relax true\else#1\fi\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@esetsize}
+% \changes{v0.6h}{1995/12/06}
+% {Use \cs{Gin@exclamation}}
+% Arrange for the final size to be set, either by wrapping the include
+% graphics call in |\scalebox|, or by redefining |\Gin@req@sizes|
+% appropriately.
+% \begin{macrocode}
+\def\Gin@eresize{\height}
+\def\Gin@esetsize{%
+ \let\@tempa\Gin@exclamation
+ \if@tempswa
+% \end{macrocode}
+% External. Wrap the |\includegraphics| command in a call to the
+% internal form of |\scalebox| to handle the rotation.
+% \begin{macrocode}
+ \edef\@tempa{\toks@{\noexpand
+ \Gscale@@box\noexpand\Gin@eresize
+ {\Gin@ewidth}{\Gin@eheight}{\the\toks@}}}%
+ \@tempa
+ \else
+% \end{macrocode}
+% Internal. Handle scaling with the |\includegraphics| command directly
+% rather than calling |\scalebox|.
+% \begin{macrocode}
+ \ifx\Gin@ewidth\@tempa
+ \ifx\Gin@eheight\@tempa
+% \end{macrocode}
+% No resizing.
+% \begin{macrocode}
+ \else
+% \end{macrocode}
+% Just height specified.
+% \changes{v0.6e}{1995/09/28}
+% {Use \cs{setlength} to support calc package}
+% \changes{v0.6h}{1995/12/06}
+% {Use \cs{Gin@exclamation}}
+% \begin{macrocode}
+ \let\Gin@@eheight\Gin@eheight
+ \def\Gin@req@sizes{%
+ \Gscale@div\Gin@scaley\Gin@@eheight\Gin@nat@height
+ \let\Gin@scalex\Gin@exclamation
+ \setlength\Gin@req@height\Gin@@eheight
+ \Gin@req@width\Gin@scaley\Gin@nat@width}%
+ \fi
+ \else
+ \ifx\Gin@eheight\@tempa
+% \end{macrocode}
+% Just width specified.
+% \changes{v0.6e}{1995/09/28}
+% {Use \cs{setlength} to support calc package}
+% \changes{v0.6h}{1995/12/06}
+% {Use \cs{Gin@exclamation}}
+% \begin{macrocode}
+ \let\Gin@@ewidth\Gin@ewidth
+ \def\Gin@req@sizes{%
+ \Gscale@div\Gin@scalex\Gin@@ewidth\Gin@nat@width
+ \let\Gin@scaley\Gin@exclamation
+ \setlength\Gin@req@width\Gin@@ewidth
+ \Gin@req@height\Gin@scalex\Gin@nat@height}%
+ \else
+% \end{macrocode}
+% Both height and width specified.
+% \begin{macrocode}
+ \let\Gin@@ewidth\Gin@ewidth
+ \let\Gin@@eheight\Gin@eheight
+% \end{macrocode}
+% \changes{v0.6g}{1995/11/10}
+% {Use \cs{ifGin@iso} to support isoscale key}
+% At this point can locally redefine |\Gin@nosize|. Instead
+% of generating an error, just set the `natural' size to be the
+% `requested size'. Previous versions of this package did not
+% allow the use of |height| and |width| unless the natural size was
+% known as otherwise \LaTeX\ can not calculate the scale factor.
+% However many drivers (especially for bitmap formats) can work this out
+% themselves, so as long as both |height| and |width| are given, so
+% \LaTeX\ knows the size to leave, accept this. This assumes the code in
+% the driver file will use the `required height' information, not the
+% scale factors, which will be set to 1!.
+% \changes{v1.0a}{1996/08/05}
+% {Missing percent added for graphics/2244}
+% \begin{macrocode}
+ \def\Gin@nosize##1{%
+ \KV@Gin@natwidth\Gin@@ewidth
+ \KV@Gin@natheight\Gin@@eheight}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \def\Gin@req@sizes{%
+ \Gscale@div\Gin@scalex\Gin@@ewidth\Gin@nat@width
+ \Gscale@div\Gin@scaley\Gin@@eheight\Gin@nat@height
+% \end{macrocode}
+% \changes{v0.6f}{1995/09/29}
+% {Use \cs{ifGin@iso} to support isoscale key}
+% Donald Arseneau requested this feature. If both |height|
+% and |width| are chosen, choose the smaller scale factor rather than
+% distort the graphic. This mode is turned on with the
+% \textsf{keepaspectratio} key.
+% \begin{macrocode}
+ \ifGin@iso
+ \ifdim\Gin@scaley\p@>\Gin@scalex\p@
+ \let\Gin@scaley\Gin@scalex
+ \else
+ \let\Gin@scalex\Gin@scaley
+ \fi
+ \fi
+ \Gin@req@width\Gin@scalex\Gin@nat@width
+ \Gin@req@height\Gin@scaley\Gin@nat@height}%
+ \fi
+ \fi
+ \fi
+ \let\Gin@ewidth\Gin@exclamation
+ \let\Gin@eheight\Gin@ewidth}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@req@height}
+% \begin{macro}{\Gin@req@width}
+% The required final size.
+% \begin{macrocode}
+\newdimen\Gin@req@height
+\newdimen\Gin@req@width
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gin@outer@scalex}
+% \begin{macro}{\Gin@outer@scaley}
+% Scale factors to pass to |\scalebox|.
+% \begin{macrocode}
+\let\Gin@outer@scalex\relax
+\let\Gin@outer@scaley\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gin@angle}
+% Rotation angle.
+% \begin{macrocode}
+\let\Gin@angle\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Gin@ewidth}
+% \changes{v0.6h}{1995/12/06}
+% {Use \cs{Gin@exclamation}}
+% \begin{macro}{\Gin@eheight}
+% Final size, initialised for no scaling.
+% \begin{macrocode}
+\let\Gin@ewidth\Gin@exclamation
+\let\Gin@eheight\Gin@ewidth
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gin@scalex}
+% \begin{macro}{\Gin@scaley}
+% \changes{v0.6h}{1995/12/06}
+% {Use \cs{Gin@exclamation}}
+% Scale factors. Initialised for no scaling.
+% \begin{macrocode}
+\def\Gin@scalex{1}
+\let\Gin@scaley\Gin@exclamation
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Gin@i}
+% Use the same top level |\includegraphics| command as the standard
+% interface. This will set the clipping switch, and then call |\Gin@i|.
+% \changes{v0.3c}{1994/03/15}{Dont locally initialise width/height}
+% \changes{v0.3c}{1994/03/15}{Always call \cmd{\Gin@ii}}
+% \changes{v0.4c}{1994/09/12}{Use `standard' version if two opt.\ args.}
+% \begin{macrocode}
+\def\Gin@i{%
+ \def\Gin@req@sizes{%
+ \Gin@req@height\Gin@nat@height
+ \Gin@req@width\Gin@nat@width}%
+ \@ifnextchar[\Gin@ii{\Gin@ii[]}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\Gin@ii}
+% Look for a second optional argument.
+% If one optional argument is present, call |\setkeys| to process it,
+% \begin{macrocode}
+\def\Gin@ii[#1]#2{%
+ \def\@tempa{[}\def\@tempb{#2}%
+ \ifx\@tempa\@tempb
+ \def\@tempa{\Gin@iii[#1][}%
+ \expandafter\@tempa
+ \else
+ \begingroup
+ \@tempswafalse
+ \toks@{\Ginclude@graphics{#2}}%
+ \setkeys{Gin}{#1}%
+ \Gin@esetsize
+ \the\toks@
+ \endgroup
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v0.4b}{1994/05/06}
+% {Remove incorrect initialisation of \cs{Gin@scalex}}
+%
+% \section{Rotation}
+%
+% \begin{macro}{\rotatebox}
+% Look for an optional argument.
+% \changes{v0.3b}{1994/03/11}{Remove star form}
+% \changes{v1.0g}{2014/04/25}{\cs{leavevmode} added graphics/1521}
+% \begin{macrocode}
+\def\rotatebox{%
+ \leavevmode
+ \@ifnextchar[\Grot@box@kv\Grot@box@std}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Grot@box@std}
+% If no KV argument, just repeat the standard definition.
+% \changes{v1.0g}{2014/04/25}{Made long graphics/4296}
+% \begin{macrocode}
+\long\def\Grot@box@std#1#2{%
+ \Grot@setangle{#1}%
+ \setbox\z@\hbox{{#2}}%
+ \Grot@x\z@
+ \Grot@y\z@
+ \Grot@box}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Grot@box@kv}
+% \changes{v1.0g}{2014/04/25}{Made long graphics/4296}
+% \begin{macrocode}
+\long\def\Grot@box@kv[#1]#2#3{%
+ \@begin@tempboxa\hbox{#3}%
+ \Grot@x\width \divide\Grot@x\tw@
+ \Grot@y\height \advance\Grot@y-\depth \divide\Grot@y\tw@
+ \setkeys{Grot}{#1}%
+ \setbox\z@\box\@tempboxa
+ \Grot@setangle{#2}%
+ \Grot@box
+ \@end@tempboxa}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% There are two ways of specifying the centre of rotation.
+%
+% \begin{key}{Grot}{origin}
+% |origin=|\meta{label}, where the labels are up to two of |lrctbB|
+% (|B| denotes the baseline, as for PSTricks).
+% \begin{macrocode}
+\define@key{Grot}{origin}[c]{%
+ \@tfor\@tempa:=#1\do{%
+ \if l\@tempa \Grot@x\z@\else
+ \if r\@tempa \Grot@x\width\else
+ \if t\@tempa \Grot@y\height\else
+ \if b\@tempa \Grot@y-\depth\else
+ \if B\@tempa \Grot@y\z@\fi\fi\fi\fi\fi}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{Grot}{x}
+% \begin{key}{Grot}{y}
+% |x=|\meta{dimen}|,y=|\meta{dimen} The $x,y$ coordinate of the centre
+% of rotation. As usual |\height| etc may be used.
+% \begin{macrocode}
+\define@key{Grot}{x}{\setlength\Grot@x{#1}}
+\define@key{Grot}{y}{\setlength\Grot@y{#1}}
+% \end{macrocode}
+% \end{key}
+% \end{key}
+%
+% \begin{key}{Grot}{units}
+% `units' specifies the number or units in one anti-clockwise circle.
+% So the default is $360$. $-360$ gives clockwise rotation, $6.283185$
+% gives radians etc.
+% \begin{macrocode}
+\define@key{Grot}{units}{%
+ \def\Grot@setangle##1{%
+ \dimen@##1\p@
+ \dimen@ii#1\p@
+ \divide\dimen@ii360\relax
+ \divide\dimen@\dimen@ii
+ \edef\Grot@angle{\number\dimen@}}}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{macro}{\Gin@erotate}
+% Initialise the rotation command to use in |\includegraphics|.
+% \changes{v0.6e}{1995/09/28}{macro added}
+% \begin{macrocode}
+\let\Gin@erotate\Grot@box@std
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
diff --git a/macros/latex-dev/required/graphics/graphicx.pdf b/macros/latex-dev/required/graphics/graphicx.pdf
new file mode 100644
index 0000000000..6137b786f8
--- /dev/null
+++ b/macros/latex-dev/required/graphics/graphicx.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/grfguide.pdf b/macros/latex-dev/required/graphics/grfguide.pdf
new file mode 100644
index 0000000000..cd6d72046e
--- /dev/null
+++ b/macros/latex-dev/required/graphics/grfguide.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/grfguide.tex b/macros/latex-dev/required/graphics/grfguide.tex
new file mode 100644
index 0000000000..b00a86d307
--- /dev/null
+++ b/macros/latex-dev/required/graphics/grfguide.tex
@@ -0,0 +1,1031 @@
+%% grfguide.tex Copyright (C) 1994 1995 1996 1998 1999 David Carlisle
+%% Copyright (C) 2005 2014 2016 2017 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%% This file has the LPPL maintenance status "maintained".
+
+\begin{filecontents*}{a.ps}
+%!
+%%BoundingBox:0 0 72 72
+0 0 moveto
+72 72 rlineto
+72 neg 0 rlineto
+72 72 neg rlineto
+stroke
+0 0 moveto
+/Times-Roman findfont
+72 scalefont
+setfont
+(A) show
+showpage
+\end{filecontents*}
+\begin{filecontents*}{a.pdf}
+%PDF-1.4
+%%%%%
+1 0 obj
+<<
+/Pages 2 0 R
+/Type /Catalog
+>>
+ endobj
+2 0 obj
+<<
+/Kids [3 0 R]
+/Type /Pages
+/Count 1
+>>
+ endobj
+3 0 obj
+<<
+/Rotate 0
+/Parent 2 0 R
+/MediaBox [0 0 72 72]
+ /Resources
+<<
+/ExtGState 4 0 R
+/Font 5 0 R
+/ProcSet [/PDF /Text]
+>>
+/pdftk_PageNum 1
+/Type /Page
+/Contents 6 0 R
+>>
+ endobj
+4 0 obj
+<<
+/R7 7 0 R
+>>
+ endobj
+5 0 obj
+<<
+/R8 8 0 R
+>>
+ endobj
+6 0 obj
+<<
+/Length 135
+>>
+stream
+q 0.1 0 0 0.1 0 0 cm
+/R7 gs
+10 w
+0 G
+0 0 m
+720 720 l
+0 720 l
+720 0 l
+S
+0 g
+q
+10 0 0 10 0 0 cm BT
+/R8 72 Tf
+1 0 0 1 0 0 Tm
+(A)Tj
+ET
+Q
+Q
+
+ endstream
+ endobj
+7 0 obj
+<<
+/Type /ExtGState
+/OPM 1
+>>
+ endobj
+8 0 obj
+<<
+/BaseFont /Times-Roman
+/LastChar 65
+/Subtype /Type1
+/FontDescriptor 9 0 R
+/Widths [722]
+/Type /Font
+/Encoding /WinAnsiEncoding
+/FirstChar 65
+>>
+ endobj
+9 0 obj
+<<
+/FontName /Times-Roman
+/StemV 105
+/CharSet (/A)
+/Ascent 674
+/Flags 65568
+/Descent 0
+/ItalicAngle 0
+/MissingWidth 250
+/FontBBox [0 0 706 674]
+/Type /FontDescriptor
+/CapHeight 674
+>>
+ endobj
+10 0 obj
+<<
+/Producer (GPL Ghostscript 9.06)
+/ModDate (D:20140426202438+01'00')
+/CreationDate (D:20140426202438+01'00')
+>>
+endobj xref
+0 11
+0000000000 65535 f
+0000000015 00000 n
+0000000066 00000 n
+0000000125 00000 n
+0000000308 00000 n
+0000000341 00000 n
+0000000374 00000 n
+0000000563 00000 n
+0000000610 00000 n
+0000000774 00000 n
+0000000975 00000 n
+trailer
+
+<<
+/Info 10 0 R
+/Root 1 0 R
+/Size 11
+/ID [<4ca1370d594acd28b9d948a5e8b925c3> <4ca1370d594acd28b9d948a5e8b925c3>]
+>>
+startxref
+1106
+%%EOF
+\end{filecontents*}
+\documentclass{ltxguide}
+
+%%% No driver option specified
+%%% set up the files color.cfg and graphics.cfg for your site.
+%%% for example:
+%%%
+%%% \ExecuteOptions{dvips}
+%%%
+\usepackage{color,graphicx,shortvrb}
+
+%% Just as an example, and to make sure, in case some
+%% driver option has not declared a default rule for
+%% .ps files:
+%\DeclareGraphicsRule{.ps}{eps}{.ps}{}
+%\DeclareGraphicsExtensions{.pdf,.ps}
+%% Which means:
+%% .ps files are (to be treated as) EncapsulatedPostScript
+%% files. The .ps file is to be read for the BoundingBox.
+%% No `special' commands need to be applied by the driver.
+
+
+\renewcommand\star{{\ttfamily*}}
+
+\let\package\textsf
+
+\newlength{\gxlen}
+\settowidth{\gxlen}{\package{graphicx}: }
+\newcommand\gs{\makebox[\gxlen][l]{\package{graphics}:}}
+\newcommand\gx{\makebox[\gxlen][l]{\package{graphicx}:}}
+
+\MakeShortVerb{\|}
+
+\begin{document}
+\title{Packages in the `graphics' bundle}
+\author{D. P. Carlisle \and The \LaTeX3 Project}
+\date{2017-06-01}
+
+\maketitle
+
+\tableofcontents
+
+\section{Introduction}
+This document serves as a user-manual for the packages \package{color},
+\package{graphics}, and \package{graphicx}. Further documentation may be
+obtained by processing the source (|dtx|) files of the individual
+packages.
+
+\section{Driver support}\label{drivers}
+All these packages rely on features that are not in \TeX\ itself.
+These features must be supplied by the `driver' used to print the
+|dvi| file. Unfortunately not all drivers support the same features, and
+even the internal method of accessing these extensions varies between
+drivers. Consequently all these packages take options such as
+`|dvips|' to specify which driver is being used.
+
+Normally you should \emph{not} specify the driver option explicitly
+in the document, but allow it to be defaulted automatically.
+This allows the document to be portable between different systems.
+
+Your \TeX\ distribution should have included |graphics.cfg| and
+|color.cfg| configuration files to specify these defaults.
+Standard versions of the configuration files are maintained by the
+\LaTeX\ Project and distributed in the CTAN |graphics-cfg| collection.
+
+For special requirements you may edit a copy of these |cfg| files
+to set up a site default for these options. Suppose that you wish
+the \package{color} package to always default to use specials for the
+PostScript driver, |dvisvgm|. In that case, create a file |color.cfg|
+containing the line:\\
+|\ExecuteOptions{dvisvgm}|\\
+Normally you will want an identical file |graphics.cfg| to set a similar
+default for the graphics packages.
+
+The following driver options are declared in the packages.
+The matching definition files (\emph{driver}|.def|)
+are now also maintained by the \LaTeX\ project,
+but distributed separately, in the CTAN |graphics-def| collection.
+\begin{quote}\raggedright
+ |dvipdfmx|, |dvips|, |dvisvgm|, |luatex|, |pdftex|, |xetex|
+\end{quote}
+
+
+The following two options are also supported, they do not correspond
+to separate definition files, but are essentially aliases for the
+|dvips| option (and |monochrome| in the case of |xdvi|).
+\begin{quote}\raggedright
+ |xdvi|, |oztex|
+\end{quote}
+
+The following set of options are supported by these packages
+with associated driver files extracted from the |drivers.dtx|
+documented source in this bundle. These are now, mainly of historic
+interest but the documented sources do contain some useful code
+and advice if you need to produce a new definition file for a new
+driver or \TeX\ system. |drivers.dtx| also contains documented
+sources for older driver files that are no longer extracted.
+\begin{quote}\raggedright
+ |dvipdf|, |dvipdfm|, |dviwin|, |dvipsone|,
+ |emtex|, |pctexps|, |pctexwin|, |pctexhp|, |pctex32|,
+ |truetex|, |tcidvi|, |vtex|
+\end{quote}
+
+The final driver option is an alias for |dvipsone|.
+\begin{quote}\raggedright
+ |dviwindo|
+\end{quote}
+
+
+\section[Colour]{Colour\footnote{%
+The basic \package{color} package functionality described here
+will be enough for many uses, however a much extended version
+is available in the contributed \package{xcolor} package, distributed
+and maintained separately. All the color commands described here are
+also available if you specify \package{xcolor} in your document.}%
+}
+The colour support is built around the idea of a system of
+\emph{Colour Models}. The Colour models supported by a driver vary,
+but typically include
+\begin{description}
+\item[rgb] Red Green Blue: A comma separated list of three numbers
+ between~0 and~1, giving the components of the colour.
+\item[cmyk] Cyan Magenta Yellow [K]Black: A comma separated list of
+ four numbers between~0 and~1, giving the components of the colour
+ according to the additive model used in most printers.
+\item[gray] Grey scale: a single number between~0 and~1.
+\item[named] Colours accessed by name, e.g.\ `JungleGreen'. Not all
+ drivers support this model. The names must either be `known' to the
+ driver or added using commands described in |color.dtx|. Some drivers
+ support an extended form of the named model in which an `intensity' of
+ the colour may also be specified, so `\mbox{JungleGreen, 0.5}' would
+ denote that colour at half strength.
+\end{description}
+Note that the \textbf{named} model is really just given as an example
+of a colour model that takes names rather than a numeric specification.
+Other options may be provided locally that provide different colour
+models, eg \textbf{pantone} (An industry standard set of colours),
+\textbf{x11} (Colour names from the X Window System), etc. The
+standard distribution does not currently have such models, but the
+\textbf{named} model could be used as an example of how to define a new
+colour model. The names used in the \textbf{named} model are those
+suggested by Jim Hafner in his \textsf{colordvi} and \textsf{foiltex}
+packages, and implemented originally in the |color.pro| header file for
+the \texttt{dvips} driver.
+
+\subsection{Package Options}
+Most of the options to the \package{color} package just specify a
+driver, e.g., \ |dvips|, as discussed in section~\ref{drivers}.
+
+One special option for the \package{color} package
+that is of interest is |monochrome.|
+If this option is selected the colour commands are all
+disabled so that they do not generate errors, but do not generate colour
+either. This is useful if previewing with a previewer that can not
+produce colour.
+
+Three other package options control the use of the \textbf{named} model.
+The |dvips| driver (by default) pre-defines 68 colour names. The |dvips|
+option normally makes these names available in the \textbf{named} colour
+model. If you do not want these names to be declared in this model
+(Saving \TeX\ some memory) you may give the |nodvipsnames|
+option. Conversely, if you are using another driver, you may wish to
+add these names to the named model for that driver (especially if you
+are processing a document originally produced on |dvips|). In this case
+you could use the |dvipsnames| option. Lastly the |usenames| option
+makes all names in the \textbf{named} model directly available, as
+described below.
+
+\subsection{Defining Colours}
+
+The colours |black|, |white|, |red|, |green|, |blue|, |cyan|,
+|magenta|, |yellow| should be predefined, but should you wish to mix
+your own colours use the |\definecolor| command.
+
+\begin{decl}
+|\definecolor|\arg{name}\arg{model}\arg{colour specification}
+\end{decl}
+
+
+This defines \m{name} as a colour which can be used in later colour
+commands. For example
+\begin{verbatim}
+\definecolor{light-blue}{rgb}{0.8,0.85,1}
+\definecolor{mygrey}{gray}{0.75}
+\end{verbatim}
+\definecolor{light-blue}{rgb}{0.8,0.85,1}
+\definecolor{mygrey}{gray}{0.75}
+
+Now |light-blue| and |mygrey| may be used in addition to the
+predefined colours above.
+
+\subsection{Using Colours}
+
+\subsubsection{Using predefined colours}
+The syntax for colour changes is designed to mimic font changes.
+The basic syntax is:
+
+\begin{decl}
+|\color|\arg{name}
+\end{decl}
+
+This is a \emph{declaration}, like |\bfseries| It changes the current
+colour to \m{name} until the end of the current group or
+environment.
+
+An alternative command syntax is to use a \emph{command} form that
+takes the text to be coloured as an \emph{argument}. This is similar
+to the font commands such as |\textbf|:
+
+\begin{decl}
+|\textcolor|\arg{name}\arg{text}
+\end{decl}
+
+
+So the above is essentially equivalent to
+|{\color|\arg{name}\emph{text}|}|.
+
+\subsubsection{Using colour specifications directly}
+
+
+\begin{decl}
+|\color|\oarg{model}\arg{specification}\\
+|\textcolor|\oarg{model}\arg{specification}\arg{text}
+\end{decl}
+
+Normally one would predeclare all the colours used in a package, or in
+the document preamble, but sometimes it is convenient to directly use
+a colour without naming it first. To achieve this |\color| (and all
+the other colour commands) take an optional argument specifying the
+model. If this is used then the mandatory argument takes a
+\m{colour specification} instead of a \m{name}. For example:\\
+|\color[rgb]{1,0.2,0.3}|\\
+would directly select that colour.
+
+This is particularly useful for accessing the \textbf{named} model:\\
+|\color[named]{BrickRed}| selects the |dvips| colour BrickRed.
+
+Rather than repeatedly use |[named]| you may use |\definecolor| to
+provide convenient aliases:\\
+|\definecolor{myred}{named}{WildStrawberry}|
+ \ldots\ |\color{myred}|\ \ldots
+
+Alternatively if you are happy to use the existing names from the
+\textbf{named} model, you may use the |usenames| package option, which
+effectively calls |\definecolor| on every colour in the \textbf{named}
+model, thus allowing |\color{WildStrawberry}| in addition to
+|\color[named]{WildStrawbery}|.
+
+\subsection{Named Colours}
+Using the \textbf{named} colour model has certain advantages over
+using other colour models.
+
+Firstly as the |dvi| file contains a request
+for a colour by \emph{name}, the actual mix of primary colours used to
+obtain the requested colour can be tuned to the characteristics of a
+particular printer. In the |dvips| driver the meanings of the colour
+names are defined in the header file |color.pro|. Users are encouraged
+to produce different versions of this file for any printers they use. By
+this means the same dvi file should produce colours of similar
+appearance when printed on printers with different colour
+characteristics.
+
+Secondly, apart from the so called `process colours' that are produced
+by mixing primary colours during the print process, one may want to use
+`spot' or `custom' colours. Here a particular colour name does not
+refer to a mix of primaries, but to a particular ink. The parts of the
+document using this colour will be printed separately using this named
+ink colour.
+
+\subsection{Page Colour}
+
+
+\begin{decl}
+|\pagecolor|\arg{name}\\
+|\pagecolor|\oarg{model}\arg{specification}\\
+|\nopagecolor|
+\end{decl}
+
+The background colour of the whole page can be set using
+|\pagecolor|. This takes the same argument forms as |\color| but sets
+the background colour for the current and all subsequent pages. It is
+a global declaration, so you need to use
+|\nopagecolor|\NEWfeature{2014/04/23}\ to `get back to normal'.
+If that is not supported, you may use |\pagecolor{white}| although that
+will make a white background rather than the default transparent background.
+
+\subsection{Box Backgrounds}
+Two commands similar to |\fbox| produce boxes with the backgrounds
+shaded an appropriate colour.
+
+\begin{decl}
+|\colorbox|\arg{name}\arg{text}\\
+|\colorbox|\oarg{model}\arg{specification}\arg{text}\\
+|\fcolorbox|\arg{name1}\arg{name2}\arg{text}\\
+|\fcolorbox|\oarg{model}%
+ \arg{specification1}\arg{specification2}\arg{text}
+\end{decl}
+
+
+The former produces a box coloured with \emph{name}
+\colorbox{mygrey}{like this}. The latter is similar but puts a frame of
+colour \emph{name1} around the box coloured \emph{name2}.
+
+These commands use the |\fbox| parameters |\fboxrule| and |\fboxsep|
+to determine the thickness of the rule, and the size of the shaded area.
+
+\subsection{Possible Problems}
+
+\TeX\ was not designed with colour in mind, and producing colours
+requires a lot of help from the driver program. Thus, depending on the
+driver, some or all features of the \package{color} package may not be
+available.
+
+Some drivers do not maintain a special `colour stack'. These drivers are
+likely to get confused if you nest colour changes, or use colours in
+floating environments.
+
+Some drivers do not maintain colours over a page break, so that if the
+page breaks in the middle of a coloured paragraph, the last part of the
+text will incorrectly be printed in black.
+
+There is a different type of problem that will occur for all drivers.
+Due to certain technical difficulties\footnote{At least two causes:
+1) The presence of a \texttt{\char`\\special} \m{whatsit} prevents
+\texttt{\char`\\addvspace} `seeing' space on the current vertical list,
+so causing it to incorrectly add extra vertical space. 2) A
+\m{whatsit} as the first item in a \texttt{\char`\\vtop} moves the
+reference point of the box.}%
+, it is possible that at points
+where the colour changes, the \emph{spacing} is affected. For this
+reason the |monochrome| option does not completely disable the colour
+commands, it redefines them to write to the log file. This will have the
+same effects on spacing, so you can produce monochrome drafts of your
+document, at least knowing that the final spacing is being shown.
+\section{The Graphics packages}
+There are two graphics packages:
+\begin{description}
+\item[\package{graphics}] The `standard' graphics package.
+\item[\package{graphicx}] The `extended' or `enhanced' graphics
+ package.
+\end{description}
+The two differ only in the format of optional arguments for the
+commands defined. The command names, and the mandatory arguments are
+the same for the two packages.
+
+\subsection{Package Options}
+As discussed in section~\ref{drivers}, the graphics packages share the
+same `driver' options as the \package{color} package. As for colour
+you should set up a site-default in a file,
+|graphics.cfg|, containing the line (for |dvips|):\\
+|\ExecuteOptions{dvips}|
+
+The graphics packages have some other options for controlling how many
+of the features to enable:
+\begin{description}
+\item[draft] suppress all the `special' features. In particular
+ graphics files are not included (but they are still read for size
+ info) just the filename is printed in a box of the correct size.
+\item[final] The opposite of |draft|. Useful to over-ride a global
+ |draft| option specified in the |\documentclass| command.
+\item[hiderotate] Do not show rotated text (presumably because the
+ previewer can not rotate).
+\item[hidescale] Do not show scaled text (presumably because the
+ previewer can not scale).
+\item[hiresbb] Look for size specifications in |%%HiResBoundingBox|
+ lines rather than standard |%%BoundingBox| lines.%
+ \NEWfeature{1996/10/29}
+\item[demo] Instead of inserting an image file |\includegraphics|
+ draws a 150\,pt by 100\,pt rectangle unless other dimensions are
+ specified manually.\NEWfeature{2006/02/20}
+\end{description}
+\subsection{Rotation}
+
+\begin{decl}
+\gs |\rotatebox|\arg{angle}\arg{text}\\
+\gx |\rotatebox|\oarg{key val list}\arg{angle}\arg{text}
+\end{decl}
+
+This puts \emph{text} in a box, like |\mbox|, but rotates the box
+through \emph{angle} degrees, \rotatebox{15}{like this}.
+
+The standard version always rotates around the reference point of the
+box, but the \package{keyval} version takes the following keys:
+
+\begin{decl}
+|origin|=\m{label}\\
+|x|=\m{dimen}\\
+|y|=\m{dimen}\\
+|units|=\m{number}
+\end{decl}
+
+So you may specify both |x| and |y|, which give the coordinate of
+the centre of rotation relative to the reference point of the box, eg
+|[x=2mm, y=5mm]|. Alternatively, for the most common points, one may use
+|origin| with a \emph{label} containing one or two of the following:
+|lrctbB| (|B| denotes the baseline, as for \package{PSTricks}). For
+example, compare a default rotation of $180^\circ$
+\ldots\rotatebox{180}{Like This}\ldots\ to the effects gained by using
+the |origin| key:\\
+|[origin = c]| rotates about the centre of the box,\ldots
+ \rotatebox[origin=c]{180}{Like This}\ldots\\
+|[origin = tr]| rotates about the top right hand corner\ldots
+ \rotatebox[origin=tr]{180}{Like This}\ldots
+
+The |units| key allows a change from the default units of degrees
+anti-clockwise. Give the number of units in one full anti-clockwise
+rotation. For example:\\
+|[units = -360]| specifies degrees clockwise.\\
+|[units= 6.283185]| specifies radians.
+
+\subsection{Scaling}
+
+\subsubsection{Scaling by scale factor}
+
+\begin{decl}
+|\scalebox|\arg{h-scale}\oarg{v-scale}\arg{text}
+\end{decl}
+
+Again this is basically like |\mbox| but scales the \emph{text}.
+If \emph{v-scale} is not specified it defaults to \emph{h-scale}.
+If it is specified the text is distorted as the horizontal and
+vertical stretches are different, \scalebox{3}[.7]{Like This}.
+
+
+\begin{decl}
+|\reflectbox|\arg{text}
+\end{decl}
+
+An abbreviation for |\scalebox{-1}[1]|\arg{text}.
+
+\subsubsection{Scaling to a requested size}
+
+\begin{decl}
+|\resizebox|\star\arg{h-length}\arg{v-length}\arg{text}
+\end{decl}
+
+ Scale \emph{text} so that the width is \emph{h-length}.
+ If |!| is used as either length argument, the other argument is used
+ to determine a scale factor that is used in both directions.
+ Normally \emph{v-length} refers to the height of the box, but in the
+ star form, it refers to the `height + depth'.
+ As normal for \LaTeXe\ box length arguments, |\height|,
+ |\width|, |\totalheight|, |\depth| may be used to refer to the
+ original size of the box.
+
+|\resizebox{1in}{\height}{Some text}|:
+\resizebox{1in}{\height}{Some text}
+
+|\resizebox{1in}{!}{Some text}|:
+\resizebox{1in}{!}{Some text}
+
+\subsection{Including Graphics Files}
+The functions for graphics inclusion try to give the same user syntax
+for including any kind of graphics file that can be understood by the
+driver. This relies on the file having an extension that identifies
+the file type. The `driver options' will define a collection of file
+extensions that the driver can handle, although this list may be
+extended using the declarations described below.
+
+If the file's extension is unknown to the driver, the system may try a
+default file type. The PostScript driver files set this default to be
+|eps| (PostScript), but this behaviour may be customised if other
+defaults are required.
+
+\begin{decl}
+\gs |\includegraphics|\star\oarg{llx,lly}\oarg{urx,ury}\arg{file}\\
+\gx |\includegraphics|\star\oarg{key val list}\arg{file}
+\end{decl}
+ Include a graphics file.
+
+ If \star\ is present, then the graphic is `clipped' to the size
+ specified. If \star\ is omitted, then any part of the graphic that is
+ outside the specified `bounding box' will over-print the surrounding
+ text.
+
+ If the optional arguments are omitted, then the size of the graphic
+ will be determined by reading an external file as described below.
+
+\paragraph{\package{graphics} version}
+ If \oarg{urx,ury} is present, then it should specify the coordinates
+ of the top right corner of the image, as a pair of \TeX\ dimensions.
+ If the units are omitted they default to |bp|. So |[1in,1in]| and
+ |[72,72]| are equivalent. If only one optional argument appears, the
+ lower left corner of the image is assumed to be at |[0,0]|. Otherwise
+ \oarg{llx,lly} may be used to specify the coordinates of this point.
+
+\paragraph{\package{graphicx} version}
+Here the star form is just for compatibility with the standard
+version. It just adds |clip| to the list of keys specified.
+(Also, for increased compatibility, if \emph{two} optional arguments are
+used, the `standard' version of |\includegraphics| is always used, even
+if the \package{graphicx} package is loaded.)
+
+The allowed keys are listed below.
+\begin{description}
+\item[bb] The argument should be four dimensions, separated by spaces.
+ These denote the `Bounding Box' of the printed region within
+ the file.
+\item[bbllx,bblly,bburx,bbury] Set the bounding box. Mainly for
+ compatibility with older packages.
+ Specifying |bbllx=a,bblly=b,bburx=c,bbury=d|
+ is equivalent to specifying |bb = a b c d|.
+\item[natwidth,natheight] Again an alternative to |bb|.
+ |natheight=h,natwidth=w| is equivalent to |bb = 0 0 h w|.
+\item[hiresbb]\NEWfeature{1996/10/29}
+ Boolean valued key. If set to |true| (just specifying |hiresbb|
+ is equivalent to |hiresbb=true|) then \TeX\ will look for
+ |%%HiResBoundingBox| lines rather than |%%BoundingBox|. It may be set
+ to |false| to overrule a default setting of |true| set by the
+ |hiresbb| package option.
+\item[pagebox]\NEWfeature{2017/06/01}
+PDF files do not have BoundingBox but may specify up to four predefined
+rectangles.
+
+|MediaBox|: the boundaries of the physical medium.
+|CropBox|: the region to which the contents of the page are to be
+ clipped when displayed.
+|BleedBox|: the region to which the contents of the
+ page should be clipped in production.
+|TrimBox|: the intended dimensions of the finished page.
+|ArtBox|: the extent of the page's meaningful content.
+
+The driver will set the image size based on |CropBox| if present,
+otherwise it will not use one of the others,
+with a driver-defined order of preference.
+|MediaBox| is always present.
+
+The |pagebox| key may be used to specify which bounding box specification to use,
+The value should be one of
+|mediabox|, |cropbox|, |bleedbox|, |trimbox|, |artbox|.
+\item[viewport]\NEWfeature{1995/06/01}
+ The |viewport| key takes four arguments, just like
+ |bb|. However in this case the values are taken relative to the
+ origin specified by the bounding box in the file. So to `view' the
+ 1in square in the bottom left hand corner of the area specified by
+ the bounding box, use the argument |viewport=0 0 72 72|.
+\item[trim]\NEWfeature{1995/06/01}
+ Similar to viewport, but here the four lengths specify the
+ amount to remove or add to each side. |trim= 1 2 3 4| `crops' the
+ picture by 1bp at the left, 2bp at the bottom, 3bp on the right and
+ 4bp at the top.
+\item[angle] Rotation angle.
+\item[origin]\NEWfeature{1995/09/28}
+ Origin for rotation. See the documentation of |\rotatebox|.
+\item[width] Required width. The
+ graphic is scaled to this width.
+\item[height] Required height. The
+ graphic is scaled to this height.
+\item[totalheight]\NEWfeature{1995/06/01}
+ Specify the total height (height $+$ depth) of the figure.
+ This will differ from the `height' if rotation has occurred.
+ In particular if the figure has been rotated by $-90^\circ$
+ then it will have zero height but large depth.
+\item[keepaspectratio]\NEWfeature{1995/09/27}
+ Boolean valued key like `clip'.
+ If set to true then specifying both `width' and `height' (or
+ `totalheight') does not distort the figure but scales such that
+ neither of the specified dimensions is \emph{exceeded}.
+\item[scale] Scale factor.
+\item[clip] Either `true' or `false' (or no value, which is equivalent
+ to `true'). Clip the graphic to the bounding box.
+\item[draft] a boolean valued key, like `clip'. Locally switches to
+ draft mode.
+\item[type] Specify the graphics type.
+\item[ext] Specify the file extension. This should \emph{only} be
+ used in conjunction with |type|.
+\item[read] Specify the file extension of the `read file'. This
+ should \emph{only} be used in conjunction with |type|.
+\item[command] Specify any command to be applied to the file. This
+ should \emph{only} be used in conjunction with |type|.
+\item[quiet]\NEWfeature{2017/06/01}
+ Skip writing information to the log.
+\item[page]\NEWfeature{2017/06/01}
+Page of a multi-page PDF file. (by default the first page will be used.)
+\item[interpolate]\NEWfeature{2017/06/01}
+Enable/disable interpolation of bitmap images by the viewer.
+\end{description}
+
+For the keys specifying the original size (i.e,, the bounding box,
+trim and viewport keys) the units can be omitted, in
+which case bp (i.e., PostScript points) are assumed.
+
+The first seven keys specify the original size of the image. This size
+needs to be specified in the case that the file can not be read by
+\TeX, or it contains an incorrect size `BoundingBox' specification.
+
+|bbllx|\ldots\ |\bbury| are mainly for compatibility for older
+packages.\\
+|bbllx=a, bblly=b, bburx=c, bbury=d|\\
+is equivalent to\\
+|bb = a b c d|.
+
+|natheight| and |natwidth| are just shorthands for setting the lower
+left coordinate to 0 0 and the upper right coordinate to the specified
+width and height.
+
+The next few keys specify any scaling or rotation to be applied to the
+image. To get these effects using the standard package, the
+|\includegraphics| call must be placed inside the argument of a
+|\rotatebox| or |\scalebox| command.
+
+The keys are read left-to-right, so |[angle=90, height=1in]| means
+rotate by 90 degrees, and then scale to a height of 1in.
+|[height=1in, angle=90]| would result in a final \emph{width} of 1in.
+
+If the \textsf{calc} package is also loaded the lengths may use
+\textsf{calc} syntax, for instance to specify a width of 2\,cm
+less than the text width: |[width=\textwidth-2cm]|.
+
+\TeX\ leaves the space specified either in the file, or in
+the optional arguments. If any part of the image is actually outside
+this area, it will by default overprint the surrounding text.
+If the star form is used, or |clip| specified, any part of the image
+outside this area will not be printed.
+
+The last four keys suppress the parsing of the filename. If they are
+used, the main \emph{file} argument should not have the file
+extension. They correspond to the arguments of |\DeclareGraphicsRule|
+described below.
+
+To see the effect that the various options have consider the file
+|a.ps|. This file contains the bounding box specification
+\begin{verbatim}
+%%BoundingBox:0 0 72 72
+\end{verbatim}
+That is, the printed region consists of a one-inch square, in
+the bottom left hand corner of the paper.
+
+In all the following examples the input will be of the form
+\begin{verbatim}
+left---\fbox{\includegraphics{a}}---right
+\end{verbatim}
+With different options supplied to |\includegraphics|.
+
+No optional argument.\\
+left---\fbox{\includegraphics{a}}---right
+
+\gs |\scalebox{0.5}{\includegraphics{a}}|\\
+\gx |\includegraphics[scale=.5]{a}|\\
+left---\fbox{\includegraphics[scale=.5]{a}}---right
+
+\gs |\includegraphics[15,10][35,45]{a}}|\\
+\gx |\includegraphics[viewport= 15 10 35 45]{a}|\\
+left---\fbox{\includegraphics[viewport= 15 10 35 45]{a}}---right
+
+\gs |\includegraphics*[15,10][35,45]{a}}|\\
+\gx |\includegraphics[viewport= 15 10 35 45,clip]{a}|\\
+left---\fbox{\includegraphics[viewport= 15 10 35 45,clip]{a}}---right
+
+\gs |\scalebox{0.5}{\includegraphics{a}}|
+ and |draft| option.\\
+\gx |\includegraphics[scale=.5, draft]{a}|\\
+left---\fbox{\includegraphics[scale=.5, draft]{a}}---right
+
+\subsection{Other commands in the \package{graphics} package}
+
+\begin{decl}
+|\graphicspath|\arg{dir-list}
+\end{decl}
+This optional declaration may be used to specify a list of directories
+in which to search for graphics files. The format is the same as for
+the \LaTeXe\ primitive |\input@path|. A list of directories, each in a
+|{}| group (even if there is only one in the list). For example:\\
+ |\graphicspath{{eps/}{tiff/}}|\\
+ would cause the system to look in the subdirectories |eps| and |tiff|
+ of the current directory. (All modern \TeX{} systems use |/|
+ as the directory separator, even on Windows.)
+
+ The default setting of this path is
+ |\input@path| that is: graphics files will be found wherever \TeX\
+ files are found.
+
+\begin{decl}
+|\DeclareGraphicsExtensions|\arg{ext-list}
+\end{decl}
+ \NEWdescription{1994/12/01}
+ This specifies the behaviour of the system when no file extension
+ is specified in the argument to |\includegraphics|.
+ \arg{ext-list} should be a comma separated list of file extensions.
+ (White space is ignored between the entries.)
+ A file name is produced by appending one extension from the list.
+ If a file is found, the system acts as if that extension had been
+ specified. If not, the next extension in \emph{ext-list} is tried.
+
+
+Note that if the extension is not specified in the |\includegraphics|
+command, the graphics file must exist at the time \LaTeX\ is run, as
+the existence of the file is used to determine which extension from
+the list to choose. However if a file extension \emph{is} specified,
+e.g.\ |\includegraphics{a.ps}| instead of |\includegraphics{a}|, then
+the graphics file need not exist at the time \LaTeX\ is used. (In
+particular it may be created on the fly by the \m{command}
+specified in the |\DeclareGraphicsRule| command described below.)
+\LaTeX\ does however need to be able to determine the size of the
+image so this size must be specified in arguments, or the `read file'
+must exist at the time \LaTeX\ is used.
+
+\begin{decl}
+|\DeclareGraphicsRule|\arg{ext}\arg{type}\arg{read-file}\arg{command}
+\end{decl}
+ Any number of these declarations can be made. They determine how the
+ system behaves when a file with extension \emph{ext} is specified.
+ (The extension may be specified explicitly or, if the argument to
+ |\includegraphics| does not have an extension, it may be a default
+ extension from the \emph{ext-list} specified with
+ |\DeclareGraphicsExtensions|.)
+
+\emph{ext} the file extension for which this rule applies. As a special
+case, \emph{ext} may be given as |*| to denote the default behaviour for
+all undeclared extensions (see the example below).
+
+\emph{type} is the `type' of file involved. All files of the same type
+will be input with the same internal command (which must be defined in
+a `driver file'). For example files with extensions |ps|, |eps|,
+|ps.gz| may all be classed as type |eps|.
+
+\emph{read-file} determines the extension of the file that should be
+read to determine size information. It may be the same as \emph{ext}
+but it may be different, for example |.ps.gz| files are not readable
+easily by \TeX, so you may want to put the bounding box information in
+a separate file with extension |.ps.bb|. If \emph{read-file} is empty,
+|{}|, then the system will not try to locate an external file for size
+info, and the size must be specified in the arguments of
+|\includegraphics|. If the driver file specifies a procedure for
+reading size files for \emph{type}, that will be used, otherwise the
+procedure for reading |eps| files will be used. Thus the size of
+bitmap files may be specified in a file with a PostScript style
+|%%BoundingBox| line, if no other specific format is available.
+
+As a special case |*| may be used to denote the
+same extension as the graphic file. This is mainly of use in
+conjunction with using |*| as the extension, as in that case the
+particular graphic extension is not known. For example
+\begin{verbatim}
+ \DeclareGraphicsRule{*}{eps}{*}{}
+\end{verbatim}
+This would declare a default rule, such that all unknown extensions
+would be treated as EPS files, and the graphic file would be read for
+a BoundingBox comment.
+
+\emph{command} is usually empty, but if non empty it is used in place
+of the filename in the |\special|. Within this argument, |#1| may be
+used to denote the filename. Thus using the dvips driver, one may
+use\\
+|\DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{`zcat #1}|\\
+the final argument causes dvips to use the |zcat| command to unzip the
+file before inserting it into the PostScript output.
+
+Note that \LaTeX\ will find the graphics file by searching along
+TEXINPUTS (and possibly other places, as specified with
+|\graphicspath|) however it may be that the command you specify
+in this argument can not find such files unless they are in the
+current directory. On some systems it may be possible to modify
+the command so that it will find any files that \LaTeX\ can find.
+For example on newer web2c \TeX\ releases on unix, one may modify the
+above command so that the last argument is:\\
+|{`zcat `kpsewhich -n latex tex #1`}|\\
+which incantation causes the |kpsewhich| program to find the
+file, by searching along \LaTeX's path, and then pass the full path
+name to the |zcat| program so that it can uncompress the file.
+Any such uses are very system dependent, and would best be placed in
+a |graphics.cfg| file, thus keeping the document itself portable.
+
+\subsection{Global setting of keys}
+
+Most of the \package{keyval} keys used in the \package{graphicx} package
+may also be set using the command |\setkeys| provided by the
+\package{keyval} package.%
+\footnote{\texttt{clip}, \texttt{scale} and \texttt{angle} may not be set via
+\texttt{\string\setkeys} prior to calling
+\texttt{\string\includegraphics}.}
+
+For instance, suppose you wanted all the files to be included in the
+current document to be scaled to 75\% of the width of the lines of text,
+then one could issue the following command:\\
+|\setkeys{Gin}{width=0.75\textwidth}|\\
+Here `|Gin|' is the name used for the \package{keyval} keys associated
+with `Graphics inclusion'. All following
+|\includegraphics| commands (within the same group or environment) will
+act as if |[width=0.75\textwidth]| had been specified, in addition to
+any other key settings actually given in the optional argument.
+
+Similarly to make all |\rotatebox| arguments take an argument in
+radians, one just needs to specify:\\
+|\setkeys{Grot}{units=6.28318}|
+
+\subsection{Compatibility between \package{graphics} and
+ \package{graphicx}}
+
+For a document author, there are not really any problems of
+compatibility between the two packages. You just choose the interface
+that you personally prefer, and then use the appropriate package.
+
+For a package or class writer the situation is slightly
+different. Suppose that you are writing a letter class that needs to
+print a company logo as part of the letterhead.
+
+As the author of the class you may want to give the users the
+possibility of using either interface in their letters (should they
+need to include any further graphics into the letter body).
+In this case the class should load the \package{graphics} package (not
+\package{graphicx}, as this would commit any users of the class to the
+\package{keyval} interface). The logo should be included with
+|\includegraphics| either with \emph{no} optional argument (if the
+correct size information is in the file) or \emph{both} optional
+arguments otherwise.
+Do not use the \emph{one} optional argument form, as the meaning of this
+argument would change (and generate errors) if the user were to load
+\package{graphicx} as well as your class.
+
+\section{Remaining packages in the graphics bundle}
+
+\subsection{Epsfig}
+This is a small package essentially a `wrapper' around the
+\package{graphicx} package, defining a command |\psfig| which has the
+syntax\\
+|\psfig{file=xxx,...}| rather than |\includegraphics[...]{xxx}|.\\
+It also has a few more commands to make it slightly more compatible with
+the old \LaTeX~2.09 style of the same name.
+
+\subsection{Rotating}
+An extension package to \package{graphicx}, mainly used for providing
+rotated float environments.
+
+\subsection{Trig}
+The trig package is not intended to be used directly in documents. It
+calculates sine, cosine and tangent trigonometric functions. These
+are used to calculate the space taken up by a rotated box. This
+package is also used by the |fontinst| program which converts
+PostScript files to a form usable by \TeX.
+
+As well as being used as a \LaTeX\ package, the macros may be extracted
+with the \package{docstrip} options \texttt{plain,package}. In this case
+the \LaTeX\ package declarations are omitted from the file, and the
+macros may be directly used as part of another macro file (they work
+with any format based on plain \TeX.)
+
+\subsection{Keyval}
+The \package{keyval} package is intended to be used by other
+packages. It provides a generic way of setting `keys' as used by the
+\package{graphicx} package, and splitting up the comma separated lists
+of \m{key}~=~\m{value} pairs.
+
+Like the \package{trig} package, these macros may be extracted and used
+as part of another macro file, based on plain \TeX, as well as the
+standard use as a \LaTeX\ package.
+
+By default an undeclared key will generate an error.
+If however the option \texttt{unknownkeysallowed} is used, then
+unknown keys will be silently ignored (leaving a message in the log
+file). This option is also accepted by the \textsf{graphicx} package.
+
+\iffalse
+
+\subsection{Pstcol}
+\package{PSTricks}, by Timothy Van Zandt is an immensely powerful
+package that enables a very full featured interface between PostScript
+and \TeX. Unfortunately the colour support in \package{PSTricks} is
+slightly incompatible with the colour mechanism defined in the
+\package{color} package. The \package{pstcol} package is a (hopefully
+temporary) package that modifies a very small number of internal
+PSTricks functions, to remove this incompatibility. If
+\package{pstricks} is loaded via this package, you may use any colours
+defined by \package{color} package commands within \package{pstricks}
+commands, and vice versa.
+
+\fi
+
+\subsection{Lscape}
+The \package{lscape} package requires and takes the same options
+as the \package{graphics} package. It defines a |landscape| environment
+within which page bodies are rotated through 90 degrees. The page head
+and foot are not affected, they appear in the standard (portrait)
+position.
+\end{document}
diff --git a/macros/latex-dev/required/graphics/keyval.dtx b/macros/latex-dev/required/graphics/keyval.dtx
new file mode 100644
index 0000000000..f656961d0b
--- /dev/null
+++ b/macros/latex-dev/required/graphics/keyval.dtx
@@ -0,0 +1,419 @@
+%
+% \iffalse
+%% keyval.dtx Copyright (C) 1993 1994 1995 1997 1998 1999 David Carlisle
+%% Copyright (C) 2000--2015 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%
+%<*dtx>
+ \ProvidesFile{keyval.dtx}
+%</dtx>
+%<*!plain>
+%<package&!plain>\NeedsTeXFormat{LaTeX2e}
+%<package&!plain>\ProvidesPackage{keyval}
+%<driver> \ProvidesFile{keyval.drv}
+% \fi
+% \ProvidesFile{keyval.dtx}
+ [2014/10/28 v1.15 key=value parser (DPC)]
+%
+% \iffalse
+%</!plain>
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{keyval}
+\begin{document}
+ \DocInput{keyval.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{keyval.dtx}
+% \title{The \textsf{keyval} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{David Carlisle}
+% \date{\filedate}
+% \MaintainedByLaTeXTeam{graphics}
+% \maketitle
+%
+% \begin{abstract}
+% A \LaTeX\ package implementing a system allowing the setting
+% of parameters (or `named arguments' with a
+% \meta{key}${}={}$\meta{value} syntax.
+%
+% Eg: |\foo[height=3in, shadow = true ]{bar}|
+% \end{abstract}
+%
+%
+% \changes{v1.03}
+% {1993/10/13}{Initial version}
+% \changes{v1.04}{1993/11/15}
+% {Upgrade after comments from Timothy van Zandt}
+% \changes{v1.05}{1993/11/17}
+% {Further small improvements}
+% \changes{v1.06}{1994/02/01}
+% {Update to LaTeX2e}
+% \changes{v1.07}{1994/03/15}
+% {New style ltxdoc}
+% \changes{v1.08}{1994/09/12}
+% {Improve docstrip handling}
+% \changes{v1.09}{1995/09/21}
+% {Move a comma for graphics/1698}
+% \changes{v1.14}{2014/04/25}
+% {Make most definitions \cs{long} to allow \cs{par} in values: graphics/3446}
+% \changes{v1.14}{2014/04/25}
+% {Only strip a single brace pair from values: graphics/3446}
+% \changes{v1.15}{2014/05/08}
+% {revert this change: Only strip a single brace pair from values: graphics/3446}
+%
+%
+% This package implements a system of defining and using sets of
+% parameters, which are set using the syntax \meta{key}=\meta{value}.
+%
+% For each keyword in such a set, there exists a function which is
+% called whenever the parameter appears in a parameter list. For
+% instance if the set |dpc| is to have the keyword |scale| then I
+% would define.\\
+% | \define@key{dpc}{scale}{scale ({\tt\string#1})\\}|\\
+% The first argument of |\define@key| is the set of keywords being
+% used, the second is the keyword, and the third is the function to
+% call. This function will be given as |#1| the \meta{value} specified
+% by the user.
+%
+% Normally it is an error to omit the `=\meta{value}' however if an
+% optional \meta{value} is supplied when the keyword is defined, then
+% just the keyword need be supplied.\\
+% |\define@key{dpc}{clip}[true]{...}|\\
+% For `|clip|' you can go `|clip = true|' or `|clip = false|' or
+% just `|clip|', which is the same as `|clip = true|'
+%
+% To use these keywords, just call `|\setkeys|' with a comma
+% separated list of settings, each of the form
+% \meta{key}=\meta{value}, or just \meta{key}. Any white space around
+% the `|=|' and `|,|' is ignored.
+%
+% As the \meta{key} is passed as a macro argument, if it consists
+% entirely of a |{ }| group, the outer braces are stripped off. Thus
+% |,key=foo,| and |,key={foo},| are equivalent. This fact enables one to
+% `hide' any commas or equals signs that must appear in the value. i.e.\
+% in |foo={1,2,3},bar=4|, |foo| gets the value |1,2,3|, the comma after
+% |1| does not terminate the keyval pair, as it is `hidden' by the
+% braces.
+%
+% Empty entries, with nothing between the commas, are silently ignored.
+% This means that it is not an error to have a comma after the last
+% term, or before the first.
+%
+% \section{Example}
+%
+% We may extend the examples above to give a `fake' graphics
+% inclusion macro, with a syntax similar to that used in the psfig
+% macros.
+%
+% \makeatletter
+% \def\dpcgraphics{\@ifnextchar[\@dpcgraphics{\@dpcgraphics[]}}
+%
+% |\dpcgraphics| has one optional argument which is passed through
+% |\setkeys|, and one mandatory argument, the filename. It actually
+% just typesets its arguments, for demonstration.
+%
+% \def\@dpcgraphics[#1]#2{{\setkeys{dpc}{#1}INPUT: #2}}%
+%
+% \define@key{dpc}{scale}{scale ({\tt\string#1\relax})\\}
+% \define@key{dpc}{height}{height ({\tt#1})\\}
+% \define@key{dpc}{width}{width ({\tt#1})\\}
+% \define@key{dpc}{bb}{bounding box ({\tt#1})\\}
+% \define@key{dpc}{clip}[true]{clip ({\tt\string#1\relax})\\}
+% \makeatother
+%
+% The declared keys are: |scale|, |height|, |width|, |bb|,
+% and |clip|. Except for the last, they must all be given a value if
+% used.
+%
+% Note how in the following, any white space around |=| or |,| is
+% ignored, as are the `empty' arguments caused by extra commas. Note
+% also that each macro receives \emph{exactly} the tokens that you
+% specify as arguments, no premature expansion is done.
+%
+% \begin{verbatim}
+% \def\dpcgraphics{\@ifnextchar[\@dpcgraphics{\@dpcgraphics[]}}
+% \def\@dpcgraphics[#1]#2{{\setkeys{dpc}{#1}INPUT: #2}}
+%
+% \define@key{dpc}{scale}{scale ({\tt\string#1\relax})\\}
+% \define@key{dpc}{clip}[true]{clip ({\tt\string#1\relax})\\}
+% \end{verbatim}
+%
+% \begin{minipage}{.4\textwidth}
+% \begin{verbatim}
+% \def\scalemacro{9}
+% \dpcgraphics
+% [ height =4in, ,
+% width = 3in,
+% scale = \scalemacro,
+% bb = 20 20 300 400 ,
+% clip,
+% ]{aaa}
+% \end{verbatim}
+% \end{minipage}
+% \hfill
+% \begin{minipage}{.4\textwidth}
+% \def\scalemacro{9}
+%\dpcgraphics
+% [ height =4in, ,
+% width = 3in,
+% scale = \scalemacro ,
+% bb = 20 20 300 400 ,
+% clip ,
+% ]{aaa}
+% \end{minipage}
+%
+%
+% \section{The Internal Interface}
+% A declaration of the form:\\
+% |\define@key{family}{key}{...}|\\
+% Defines a macro |\KV@prefix@key| with one argument. When used in a
+% keyval list, the macro receives the value as its argument.
+%
+% A declaration of the form:\\
+% |\define@key{family}{key}[default]{...}|\\
+% Defines a macro |\KV@family@key| as above, however it also defines the
+% macro |\KV@family@key@default| as a macro with no arguments, and
+% definition\\
+% |\KV@family@key{default}|.
+%
+% Thus if macros are defined using |\define@key|, the use of a key with
+% no value \ldots|,foo,|\ldots\ is always equivalent to the use of the
+% key with some value, \ldots|,foo=default,|\ldots. However a package
+% writer may wish that the `default' behaviour for some key is not
+% directly equivalent to using that key with a value. (In particular, as
+% pointed out to me by Timothy Van Zandt, you may wish to omit error
+% checking on the default value as you know it is correct.) In these
+% cases one simply needs to define the two macros
+% |\KV@|\meta{family}|@key| and |\KV@|\meta{family}|@key@default|
+% directly using |\def| (or |\newcommand|). I do not supply a user
+% interface for this type of definition, but it is supported in the
+% sense that I will try to ensure that any future upgrades of this
+% package do not break styles making use of these `low level'
+% definitions.
+%
+% \StopEventually{}
+%
+% \section{The Macros}
+%
+% From version~1.05, all `internal' macros associated to keys have names
+% of the form:\\
+% |\KV@|\meta{family}|@|\meta{key} or
+% |\KV@|\meta{family}|@|\meta{key}|@|\meta{default}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \begin{macro}{\setkeys}
+% The top level macro. |#2| should be a comma separated values of the
+% form \meta{key} |=| \meta{value} or just simply \meta{key}.
+% The macro associated with this key in the `family' |#1| is called with
+% argument \meta{value}. The second form is only allowed if the key was
+% declared with a default value.
+% \begin{macrocode}
+\long\def\setkeys#1#2{%
+% \end{macrocode}
+% Save the `family' for later. Then begin acting on the comma
+% separated list.
+% \changes{v1.11}{1998/06/05}
+% {Make \cs{@tempc} safe (in case it is an \cs{if}.}
+% \begin{macrocode}
+ \def\KV@prefix{KV@#1@}%
+ \let\@tempc\relax
+ \KV@do#2,\relax,}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KV@do}
+% Iterate down the list of comma separated argument pairs.
+% \changes{v1.14}{2014/04/25}
+% {Add \cs{@empty} not \cs{empty}}
+% \begin{macrocode}
+\long\def\KV@do#1,{%
+ \ifx\relax#1\@empty\else
+ \KV@split#1==\relax
+ \expandafter\KV@do\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KV@split}
+% Split up the keyword and value, and call the appropriate command.
+% This macro was slightly reorganised for version 1.04, after some
+% suggestions from Timothy Van Zandt.
+% \begin{macrocode}
+\long\def\KV@split#1=#2=#3\relax{%
+ \KV@@sp@def\@tempa{#1}%
+ \ifx\@tempa\@empty\else
+ \expandafter\let\expandafter\@tempc
+ \csname\KV@prefix\@tempa\endcsname
+ \ifx\@tempc\relax
+%<plain> \KV@err
+%<!plain> \KV@errx
+ {\@tempa\space undefined}%
+ \else
+ \ifx\@empty#3\@empty
+ \KV@default
+ \else
+ \KV@@sp@def\@tempb{#2}%
+ \expandafter\@tempc\expandafter{\@tempb}\relax
+ \fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KV@default}
+% Run the default code, or raise an error.
+% \begin{macrocode}
+\def\KV@default{%
+ \expandafter\let\expandafter\@tempb
+ \csname\KV@prefix\@tempa @default\endcsname
+ \ifx\@tempb\relax
+ \KV@err{No value specified for \@tempa}%
+ \else
+ \@tempb\relax
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KV@err}
+% \changes{v1.10}{1997/11/10}
+% {Use \cs{PackageError}}
+% \changes{v1.12}{1998/11/18}
+% {Option system added}
+% Error messages.
+% \begin{macrocode}
+%<plain>\def\KV@err#1{\errmessage{key-val: #1}}
+%<*!plain>
+\DeclareOption{unknownkeysallowed}{%
+ \def\KV@errx#1{\PackageInfo{keyval}{#1}}}
+\DeclareOption{unknownkeyserror}{%
+ \def\KV@errx#1{\PackageError{keyval}{#1}\@ehc}}
+\ExecuteOptions{unknownkeyserror}
+\let\KV@err\KV@errx
+\ProcessOptions
+%</!plain>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KV@@sp@def}
+% \changes{v1.10}{1997/11/10}
+% {Reorganise to not require doubled hash tokens, and to not
+% lose initial brace groups.}
+% \begin{macro}{\KV@@sp@b}
+% \begin{macro}{\KV@@sp@c}
+% \begin{macro}{\KV@@sp@d}
+% |\KV@@sp@def|\meta{cmd}\meta{token list} is like |\def|, except that
+% a space token at the beginning or end of \meta{token list} is
+% removed before making the assignment. \meta{token list} may not
+% contain the token |\@nil|, unless it is within a brace group.
+% The names of these commands were changed at version~1.05 to ensure
+% that they do not clash with `internal' macros in a key family `sp'.
+%
+% Since v1.10, |#| may appear in the second argument without it
+% needing to be doubled as |##|. Also earlier versions would
+% drop any initial brace group, so |{abc}d| would incorrectly
+% be treated as |abcd|. The current version only removes brace
+% groups that surround the entire value, so |{abcd}| \emph{is} treated
+% correctly as |abcd|. Prior to v1.14, two levels of bracing are removed, if
+% you require the entire argument to be a single brace group, you had
+% use |{{{abcd}}}|, from v1.14 exactly one brace group is removed, so to make
+% the entire value be a brace group you need |{{abc}}|.
+%
+% \begin{macrocode}
+\def\@tempa#1{%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\long\def\KV@@sp@def##1##2{%
+ \futurelet\KV@tempa\KV@@sp@d##2\@nil\@nil#1\@nil\relax##1}%
+% \end{macrocode}
+%
+% Early release removed initial space by having an `extra' argument
+% in |\KV@@sp@b| but that removed too many braces, so now make
+% |\KV@@sp@b| explicitly remove a single space token. That unfortunately
+% means we need the new |\KV@@sp@d| command to add a space token if
+% one was not there before.
+% \begin{macrocode}
+\def\KV@@sp@d{%
+ \ifx\KV@tempa\@sptoken
+ \expandafter\KV@@sp@b
+ \else
+ \expandafter\KV@@sp@b\expandafter#1%
+ \fi}%
+% \end{macrocode}
+%
+% \changes{v1.14}{2014/04/25}
+% {Add \cs{@empty} to avoid dropping a brace pair: graphics/3446}
+% \changes{v1.15}{2014/05/08}
+% {revert last change}
+% \begin{macrocode}
+\long\def\KV@@sp@b#1##1 \@nil{\KV@@sp@c##1}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<plain>\def\@sptoken{#1}%
+% \end{macrocode}
+%
+% Make the above definitions, inserting the space token where needed.
+% \begin{macrocode}
+ }
+\@tempa{ }
+% \end{macrocode}
+%
+% \changes{v1.14}{2014/04/25}
+% {Add \cs{expandafter} to remove the extra \cs{@empty} token: graphics/3446}
+% \changes{v1.15}{2014/05/08}
+% {revert last change}
+% \begin{macrocode}
+\long\def\KV@@sp@c#1\@nil#2\relax#3{\KV@toks@{#1}\edef#3{\the\KV@toks@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\KV@toks@}
+% Macro register used above to prevent |#| doubling.
+% Avoid uding one of the normal scratch registers, as this code
+% is not in a local group.
+% \begin{macrocode}
+\newtoks\KV@toks@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\define@key}
+% Define the command associated to the key |#2| in the family |#1|.
+% First looks for a default argument (the default value for the
+% key)
+% \begin{macrocode}
+\def\define@key#1#2{%
+ \@ifnextchar[{\KV@def{#1}{#2}}{\long\@namedef{KV@#1@#2}####1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\KV@def}
+% Make the definitions of the command, and the default value.
+% \begin{macrocode}
+\def\KV@def#1#2[#3]{%
+ \long\@namedef{KV@#1@#2@default\expandafter}\expandafter
+ {\csname KV@#1@#2\endcsname{#3}}%
+ \long\@namedef{KV@#1@#2}##1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+% \Finale
+%
+\endinput
diff --git a/macros/latex-dev/required/graphics/keyval.pdf b/macros/latex-dev/required/graphics/keyval.pdf
new file mode 100644
index 0000000000..8790611726
--- /dev/null
+++ b/macros/latex-dev/required/graphics/keyval.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/lscape.dtx b/macros/latex-dev/required/graphics/lscape.dtx
new file mode 100644
index 0000000000..733e183ee6
--- /dev/null
+++ b/macros/latex-dev/required/graphics/lscape.dtx
@@ -0,0 +1,135 @@
+%
+% \iffalse
+%
+%% lscape.dtx Copyright (C) 1994 1999-2000 David Carlisle
+%% Copyright (C) 2000--2015 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%<*dtx>
+ \ProvidesFile{lscape.dtx}
+%</dtx>
+%<package>\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+%<package>\ProvidesPackage{lscape}
+%<driver> \ProvidesFile{lscape.drv}
+% \fi
+% \ProvidesFile{lscape.dtx}
+ [2000/10/22 v3.01 Landscape Pages (DPC)]
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{lscape}
+\begin{document}
+ \DocInput{lscape.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{lscape.dtx}
+%
+% \title{The \textsf{lscape} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{D. P. Carlisle}
+% \date{\filedate}
+%
+%
+% \begin{landscape}
+% \MaintainedByLaTeXTeam{graphics}
+% \maketitle
+%
+% All text, within the \texttt{landscape} environment is rotated through
+% 90 degrees. The environment may span several pages. It works well
+% with, and was originally created for, use with \textsf{longtable} to
+% produce long wide tables.
+%
+% All the work is done by the \textsf{graphics} package, the trick is to
+% call it at the right place in the output routine to rotate the current
+% page before the page head and foot are added.
+%
+%
+% \StopEventually{\end{landscape}}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \changes{v1.00}{1992/04/28}{Initial release}
+% \changes{v2.00}{1992/11/18}{Support for footnotes and floats.
+% Special thanks to Sarah J. McQuay for testing this release}
+% \changes{v3.00}{1994/10/05}{Update using LaTeX2e graphics package}
+% \changes{v3.01}{1999/06/22}{Added better pdfTeX support
+% by Scott Pakin, from graphics/3063}
+%
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Here is what Scott Pakin wrote about the pdftex option:
+% \begin{quote}
+% I've made a minor improvement to lscape.dtx that I'd like to share
+% with the world. My addition makes lscape rotate the PDF "paper" --
+% not just the text on the page -- when given the "pdftex" option.
+% (Naturally, this works only with pdfLaTeX.) The result is that the
+% text is viewable online without the reader having to rotate his/her
+% head 90 degrees. The document still prints normally.
+% \end{quote}
+%
+%
+% \begin{macrocode}
+\newif\ifGin@pdftex
+\Gin@pdftexfalse
+\DeclareOption{pdftex}{%
+ \PassOptionsToPackage\CurrentOption{graphics}
+ \Gin@pdftextrue
+}
+\DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}}
+\ProcessOptions
+\RequirePackage{graphics}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\LS@makecol=\@makecol
+\let\LS@makefcolumn=\@makefcolumn
+\def\LS@rot{%
+ \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}}
+% \end{macrocode}
+%
+% First set up the page size for landscape.
+% \begin{macrocode}
+\def\landscape{%
+ \clearpage
+ \begingroup
+ \vsize=\textwidth
+ \hsize=\textheight
+ \linewidth=\hsize
+ \columnwidth=\hsize
+ \@colroom=\vsize
+ \textheight=\vsize
+ \@colht=\vsize
+% \end{macrocode}
+% Rotate the page body (text and float pages).
+% \begin{macrocode}
+ \def\@makecol{\LS@makecol\LS@rot}%
+ \def\@makefcolumn##1{\LS@makefcolumn{##1}\LS@rot}}
+% \end{macrocode}
+%
+% Restore everything. This is where the pdftex option makes a
+% difference.
+% \begin{macrocode}
+\def\endlandscape{%
+ \ifGin@pdftex
+ \pdfpageattr{/Rotate 90}
+ \fi
+ \clearpage
+ \endgroup
+ \global\@colht=\textheight
+ \global\vsize=\textheight
+ \global\@colroom=\textheight}
+%</package>
+% \end{macrocode}
+%
+%
+% \Finale
+%
diff --git a/macros/latex-dev/required/graphics/lscape.pdf b/macros/latex-dev/required/graphics/lscape.pdf
new file mode 100644
index 0000000000..bf3d93a04c
--- /dev/null
+++ b/macros/latex-dev/required/graphics/lscape.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/rotating.dtx b/macros/latex-dev/required/graphics/rotating.dtx
new file mode 100644
index 0000000000..41bd399d4e
--- /dev/null
+++ b/macros/latex-dev/required/graphics/rotating.dtx
@@ -0,0 +1,686 @@
+%
+% \iffalse
+%
+%
+% File: rotating.dtx
+%% Copyright 1995--1999 Sebastian Rahtz and Leonor Barroca
+%% Copyright 2001--2003,2007--2009 Robin Fairbairns
+%% Copyright 2016 LaTeX3 Project
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% https://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+%
+% This work consists of the file rotating.dtx
+% and the derived file rotating.sty, and testing material
+% rotex.tex and cat.eps
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+%<*dtx>
+\ProvidesFile{rotating.dtx}%
+%</dtx>
+%<package>\ProvidesPackage{rotating}%
+ [2016/08/11 v2.16d
+%<package> rotated objects in LaTeX%
+%<*dtx>
+ rotating package source file%
+%</dtx>
+ ]
+%<*dtx>
+\documentclass{ltxdoc}
+\GetFileInfo{rotating.dtx}
+\begin{document}
+ \title{A package for rotated objects in \LaTeX\thanks{This file has
+ version number \fileversion, last revised \filedate}}
+ \author{Robin Fairbairns
+ \and Sebastian Rahtz \and Leonor Barroca}
+ \date{printed \today}
+ \MaintainedByLaTeXTeam{graphics}
+ \maketitle
+ \tableofcontents
+% \listoffigures
+% \listoftables
+ \DocInput{rotating.dtx}
+\end{document}
+%</dtx>
+% \fi
+%
+% \begin{abstract}
+% This article documents a \LaTeX\ package, `rotating.sty',
+% which performs most sorts of
+% rotation one might like, including rotation of complete floating
+% figures and tables.
+% \end{abstract}
+%
+% \section{Introduction}
+%
+% The package provides:
+% \begin{itemize}
+% \item two new environments, \texttt{sidewaystable} and
+% \texttt{sidewaysfigure}, each of which produces a single page-size
+% float with contents rotated $\pm90$\,degrees; and
+% \item a variety of other rotation-related commands and environments.
+% \end{itemize}
+%
+% Note that the package uses rotation facilities from the
+% \textsf{graphicx} package. When generating DVI output, users should
+% note that rotation is typically \emph{not} visible in a DVI viewer:
+% conversion to, and viewing, PostScript or PDF is necessary.
+%
+% \section{Usage}
+%
+% \subsection{Package options}
+%
+% Sideways figures and tables always take up the whole page. In
+% single-sided documents, they may be rotated so that the bottom of
+% the figures is on the left (package option
+% `\texttt{counterclockwise}') or the right (package option
+% `\texttt{clockwise}'). The default is to turn so that the bottom is
+% on the right (option `\texttt{clockwise}').
+%
+% Option `\texttt{anticlockwise}' is an alias for
+% `\texttt{counterclockwise}'.
+%
+% If the `\texttt{twoside}' option has been given to the main document
+% class (either explicitly, or implicitly as in the default for book
+% class), the package will rotate sideways figures according to the
+% page number (this requires at least two passes through \LaTeX{}).
+% If you want the `\texttt{twoside}' option, but want the figures
+% always in one direction, use the `\texttt{figuresright}' or
+% `\texttt{figuresleft}' options to the package.
+%
+% The package can produce a lot of logging information; the
+% amount of information is controlled by the package options
+% `\texttt{quiet}' (fewest messages; default), `\texttt{log}' and
+% `\texttt{chatter}' (most messages).
+%
+% All other options are passed to the \textsf{graphicx} package when
+% it is loaded to provide rotation functions.
+%
+% \subsection{Float environments}
+%
+% The environments \texttt{sidewaystable} and \texttt{sidewaysfigure}
+% introduce landscape-form floating tables and figures, respectively.
+% (Each of the environments has a ``starred'' version, such as
+% \texttt{sidewaystable*}, for a single-column float in a double-column
+% area of the document.)
+%
+% New rotated environments may be declared using the combined
+% facilities of the float and rotfloat packages.
+%
+% \subsection{Other environments and commands}
+% The package provides other \LaTeX\ environments:
+% \begin{description}
+% \item[\mdseries\ttfamily sideways] prints the contents of the
+% environment turned through 90 degrees counterclockwise;
+% \item[\mdseries\ttfamily turn] prints the contents turned through an
+% arbitrary angle (the argument to the environment);
+% \item[\mdseries\ttfamily rotate] prints the contents turned through
+% an arbitrary angle but does \emph{not} leave any space for the result
+% \end{description}
+%
+% The command \cs{turnbox}\marg{angle}\marg{matter to turn} is a macro
+% version of the \texttt{rotate} environment.
+%
+% A set of examples is given in the file \texttt{rotex.tex}
+%
+% \subsection{Positioning}
+%
+% Floats appear one to a page, and are positioned by spacer skips that
+% appear (logically) above and below the floating object. The skips,
+% \cs{rotFPtop} and \cs{rotFPbot}, are initialised from the standard
+% \LaTeX{} (internal) \cs{@fptop} and \cs{@fpbot} skips. As a result,
+% by default, rotated floats appear horizontally centred on their
+% float pages.
+%
+% Some sensible values for the registers are:
+% \par\noindent
+% \begin{tabular}{@{}llp{3in}@{}}
+% \cs{rotFPtop} & \cs{rotFPbot} & Effect \\
+% \hline
+% 0pt plus 1fil & 0pt plus 1fil & figure/table appears in middle
+% (default value) \\
+% 0pt & 0pt plus 1fil & figure/table appears with its top
+% nearest the edge of the page \\
+% 0pt plus 1fil & 0pt plus 2fil & figure/table's bottom appears
+% twice as far from the edge as the
+% top does
+% \end{tabular}
+%
+% \StopEventually{}
+%
+% \section{Setup}
+% Now we present the documented code. First, package options.
+%
+% Note that the \texttt{clockwise} and \texttt{counterclockwise}
+% options are present for compatibility only.
+% \begin{macrocode}
+%<*package>
+\DeclareOption{clockwise}{%
+ \AtBeginDocument{\setkeys{Grot}{units=360}}%
+}
+\DeclareOption{counterclockwise}{%
+ \AtBeginDocument{\setkeys{Grot}{units=-360}}%
+}
+\DeclareOption{anticlockwise}{\ds@counterclockwise}
+% \end{macrocode}
+% Control figure orientation
+% \begin{macrocode}
+\DeclareOption{figuresleft}{%
+ \@rot@twosidefalse
+ \def\rot@LR{0}%
+}
+\DeclareOption{figuresright}{%
+ \@rot@twosidefalse
+ \def\rot@LR{-1}%
+}
+% \end{macrocode}
+%
+% control messages:
+% \begin{macrocode}
+\newif\ifrot@messages
+\DeclareOption{quiet}{%
+ \rot@messagesfalse
+ \let\rot@message\@gobble % pro tem -- should suppress altogether
+}
+\DeclareOption{log}{%
+ \rot@messagestrue
+ \def\rot@message{\PackageInfo{rotating}}%
+}
+\DeclareOption{chatter}{%
+ \rot@messagestrue
+ \def\rot@message{\PackageWarning{rotating}}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\if@rot@twoside}
+% \begin{macro}{\rot@LR}
+% A couple of commands for passing rotation direction around
+% \begin{macrocode}
+\newif\if@rot@twoside
+\if@twoside
+ \@rot@twosidetrue
+\else
+ \@rot@twosidefalse
+\fi
+\def\rot@LR{-1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Pass any unknown options to the \textsf{graphicx} package, and
+% set up defaults and process the options.
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
+\ExecuteOptions{clockwise,quiet}
+\ProcessOptions
+% \end{macrocode}
+%
+% Other initialisation
+% \begin{macrocode}
+\RequirePackage{graphicx}
+\RequirePackage{ifthen}
+% \end{macrocode}
+%
+% \begin{macro}{\rotdriver}
+% The command \cs{rotdriver} allows a user to specify an initialisation file,
+% a sort of non-automatically-loaded driver (in the graphics, hyperref
+% sense).
+% \begin{macrocode}
+\def\rotdriver#1{\makeatletter\input{#1.def}\makeatother}
+% \end{macrocode}
+% \end{macro}
+%
+% The \texttt{r@tfl@t} counter is used when generating `labels' for
+% determining what side of the page the float is on, in twoside mode.
+% \begin{macrocode}
+\newcounter{r@tfl@t}
+\setcounter{r@tfl@t}{0}
+% \end{macrocode}
+%
+% Positioning skips (see above).
+% \begin{macrocode}
+\newskip\rotFPtop \rotFPtop=\@fptop
+\newskip\rotFPbot \rotFPbot=\@fpbot
+% \end{macrocode}
+%
+% \section{Turning and rotation environments}
+% \begin{macro}{sideways}
+% Environment to turn the contents through 90 degrees.
+% \begin{macrocode}
+\def\sideways{%
+ \Grot@setangle{90}%
+ \setbox\z@\color@hbox\ignorespaces}
+\def\endsideways{%
+ \unskip\color@endbox
+ \Grot@x\z@
+ \Grot@y\z@
+ \Grot@box
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{turn}
+% Rotate the contents of the environment, leaving the appropriate space
+% \begin{macrocode}
+\def\turn#1{%
+ \Grot@setangle{#1}%
+ \setbox\z@\color@hbox\ignorespaces}
+\def\endturn{%
+ \unskip\color@endbox
+ \Grot@x\z@
+ \Grot@y\z@
+ \Grot@box
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{rotate}
+% Rotate the contents of the environment, leaving \emph{no space}.
+% \begin{macrocode}
+\def\rotate#1{%
+ \Grot@setangle{#1}%
+ \setbox\z@\color@hbox\ignorespaces}
+\def\endrotate{%
+ \unskip\color@endbox
+ \Grot@x\z@
+ \Grot@y\z@
+ \wd0\z@\dp0\z@\ht0\z@
+ \Grot@box
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\turnbox}
+% A macro version of the `rotate' environment.
+% \begin{macrocode}
+\def\turnbox#1#2{%
+ \Grot@setangle{#1}%
+% \end{macrocode}
+% Note: grouping within the box makes \cs{color@hbox} unnecessary, I think.
+% \begin{macrocode}
+ \setbox\z@\hbox{{#2}}%
+ \Grot@x\z@\Grot@y\z@
+ \wd0\z@\dp0\z@\ht0\z@
+ \Grot@box
+}
+% \end{macrocode}
+% \end{macro}
+% \section{Sideways figures and tables}
+% Now for the macros to provide a complete
+% environment for sideways figures and tables.
+% We define two environments |sidewaysfigure| and
+% |sidewaystable| that
+% fit in with the normal table and figure floats. These are `fixed'
+% environments that just do 90 degree rotation, but it would be easy
+% to parameterize this to do other rotations if needed (the mind
+% boggles\ldots)
+%
+% \begin{macro}{\@rotfloat}
+% \begin{macro}{\@xrotfloat}
+% \begin{macro}{\rot@float@box}
+% First a generalised `rotfloat' environment. We need to intercept
+% \LaTeX's float macros, in order to change the assumed width of a
+% float being |\columnwidth|. We want it to work on a width of
+% |\textheight| so that when we rotate the float, it comes out
+% the right height. This is not actually very satisfactory, since what
+% we \emph{really} want is for rotated floats to occupy the space they
+% actually \emph{use}. The captions are a problem --- since they can
+% precede the figure or table, we cannot set them in a box of the
+% right width (ie the \emph{height} of the forthcoming object), because
+% it has not happened yet. The result of these difficulties is that
+% rotated figures always end up as full page figures.
+% \begin{macrocode}
+\newsavebox\rot@float@box
+\def\@rotfloat#1{%
+ \@ifnextchar[%
+ {\@xrotfloat{#1}}%
+ {\edef\@tempa{\noexpand\@xrotfloat{#1}[\csname fps@#1\endcsname]}\@tempa}%
+}
+\def\@xrotfloat#1[#2]{%
+ \@float{#1}[#2]%
+% \end{macrocode}
+% Set the float contents in
+% a box of width \cs{textheight} instead of \cs{columnwidth}.
+% \begin{macrocode}
+ \begin{lrbox}\rot@float@box
+ \begin{minipage}\textheight
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\end@rotfloat}
+% We call \LaTeX's \cs{end@float} macro having previously rotated
+% the box \cs{@currbox}.
+% The rotation is either clockwise or
+% anti-clockwise, depending on whether the page is odd or even;
+% in oneside mode it is always odd.
+% \begin{macrocode}
+\def\end@rotfloat{%
+% \end{macrocode}
+% If we are going to know whether pages are odd or even,
+% we need to use the a variant \cs{pageref} mechanism and our own
+% specialised labels.
+% \begin{macrocode}
+ \end{minipage}\end{lrbox}%
+ \stepcounter{r@tfl@t}%
+ \rot@label{RF\ther@tfl@t}%
+ \rot@pageref{RF\ther@tfl@t}{\R@@page}%
+ \edef\@tempa{Adding sideways \@captype\space on page \R@@page\space}
+ \rot@mess@toks\expandafter{\@tempa}
+ \wd\rot@float@box\z@
+ \ht\rot@float@box\z@
+ \dp\rot@float@box\z@
+ \vbox to \textheight{%
+% \end{macrocode}
+% We need to know for sure which direction rotation is going to
+% be in, so locally reset the graphics units.
+% \begin{macrocode}
+ \setkeys{Grot}{units=360}%
+ \if@rot@twoside
+ \else
+ \let\R@@page\rot@LR
+ \fi
+ \ifthenelse{\isodd{\R@@page}}{%
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks (right hand page)}%
+ \fi
+ \vfill
+ \@@line{%
+ \hskip\rotFPtop
+ \rotatebox{90}{\box\rot@float@box}%
+ \hskip\rotFPbot
+ }%
+ }{%
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks (left hand page)}%
+ \fi
+ \@@line{%
+ \hskip\rotFPbot
+ \rotatebox{-90}{\box\rot@float@box}%
+ \hskip\rotFPtop
+ }%
+ \vfill
+ }%
+ \rot@message{\the\rot@mess@toks}
+ }%
+ \end@float
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sidewaysfigure}
+% \begin{macro}{\endsidewaysfigure}
+% \begin{macro}{\sidewaystable}
+% \begin{macro}{\endsidewaystable}
+% The following definitions set up two environments,
+% \texttt{sidewaystable} and \texttt{sidewaysfigure}, which uses this
+% type of float. Naturally, users may need to change these to suit
+% their local style. Both contribute to the normal lists of figures
+% and tables.
+% \begin{macrocode}
+\def\sidewaysfigure{\@rotfloat{figure}}
+%
+\let\endsidewaysfigure\end@rotfloat
+%
+\def\sidewaystable{\@rotfloat{table}}
+\let\endsidewaystable\end@rotfloat
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@rotdblfloat}
+% \begin{macro}{\end@rotdblfloat}
+% Handling double column floats
+% \begin{macrocode}
+\def\@rotdblfloat{%
+ \if@twocolumn\expandafter\@rotdbflt\else\expandafter\@rotfloat\fi
+}
+\def\@rotdbflt#1{\@ifnextchar[{\@rotxdblfloat{#1}}{\@rotxdblfloat{#1}[tp]}}
+\def\@rotxdblfloat#1[#2]{%
+ \@float{#1}[#2]%
+ \hsize\textwidth\linewidth\textwidth
+ \begin{lrbox}\rot@float@box
+ \begin{minipage}\textheight
+}
+\def\end@rotdblfloat{%
+% \end{macrocode}
+% If we are going to know whether pages are odd or even,
+% we need to use the \cs{pageref} mechanism, and labels. But
+% Labels won't work \emph{unless} the user has put in a
+% caption. Beware!
+% \begin{macrocode}
+ \end{minipage}\end{lrbox}%
+ \stepcounter{r@tfl@t}%
+ \rot@label{RF\ther@tfl@t}%
+ \rot@pageref{RF\ther@tfl@t}{\R@@page}%
+ \edef\@tempa{Adding sideways \@captype\space on page \R@@page\space}
+ \rot@mess@toks\expandafter{\@tempa}
+ \@tempdima\ht\rot@float@box
+ \advance\@tempdima by \dp\rot@float@box
+% \ifrot@messages
+% \rot@message{BOX wd: \the\wd\rot@float@box,
+% ht: \the\ht\rot@float@box, dp: \the\dp\rot@float@box:
+% so shift by .5 of \the\@tempdima}%
+% \fi
+ \wd\rot@float@box\z@
+ \ht\rot@float@box\z@
+ \dp\rot@float@box\z@
+ \vbox to \textheight{%
+% \end{macrocode}
+% We need to know for sure which direction rotation is going to
+% be in, so locally reset the graphics units.
+% \begin{macrocode}
+ \setkeys{Grot}{units=360}%
+ \if@rot@twoside
+ \else
+ \let\R@@page\rot@LR
+ \fi
+ \ifthenelse{\isodd{\R@@page}}{%
+ \ifrot@messages
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks (right hand page)}%
+ \fi
+ \fi
+ \vfill
+ \@@line{%
+ \hskip\rotFPtop
+ \rotatebox{90}{\box\rot@float@box}%
+ \hskip\rotFPbot
+ }%
+ }{%
+ \ifrot@messages
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks (left hand page)}%
+ \fi
+ \fi%
+ \@@line{%
+ \hskip\rotFPbot
+ \rotatebox{-90}{\box\rot@float@box}%
+ \hskip\rotFPtop
+ }%
+ \vfill
+ }%
+ \rot@message{\the\rot@mess@toks}%
+ }%
+ \end@dblfloat
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{sidewaysfigure*}
+% \begin{environment}{sidewaystable*}
+% \begin{macrocode}
+\newenvironment{sidewaystable*}
+ {\@rotdblfloat{table}}
+ {\end@rotdblfloat}
+\newenvironment{sidewaysfigure*}
+ {\@rotdblfloat{figure}}
+ {\end@rotdblfloat}
+
+% \end{macrocode}
+% \end{environment}
+% \end{environment}
+%
+% \begin{macro}{\rot@label}
+% \begin{macro}{\rot@thepage}
+% \begin{macro}{\rot@pageref}
+% \begin{macro}{\rot@protected@write}
+% \begin{macro}{\if@rot@refundefined}
+% Note that we used \cs{rot@label}, not \cs{label}; this
+% variant writes (just) the \emph{true} page number, not the
+% value of \cs{thepage}; this ``true'' value then needs special
+% treatment in \cs{protected@write}, just as
+% \cs{thepage} already has.
+% \cs{rot@pageref}\marg{generated label name}\marg{cs to set to
+% pageno} then returns the labelled page's number (or 0 if label not
+% yet defined). If label not defined, flags using
+% \cs{rot@refundefinedtrue} for end-document to pick up. (later...)
+% \begin{macrocode}
+\def\rot@thepage{\@arabic\c@page}
+\def\rot@label#1{\@bsphack
+ \rot@protected@write{\@auxout}{}%
+ {\string\newlabel{#1}{\rot@thepage}}%
+ \@esphack}
+\def\rot@pageref#1#2{%
+ \expandafter\ifx\csname r@#1\endcsname\relax
+ \global\@rot@refundefinedtrue
+ \def#2{0}%
+ \else
+ \edef#2{\csname r@#1\endcsname}%
+ \fi
+}
+\long\def\rot@protected@write#1#2#3{%
+ \begingroup
+ \let\rot@thepage\relax
+ #2%
+ \let\protect\@unexpandable@protect
+ \edef\reserved@a{\write#1{#3}}%
+ \reserved@a
+ \endgroup
+ \if@nobreak\ifvmode\nobreak\fi\fi
+}
+\newif\if@rot@refundefined
+\global\@rot@refundefinedfalse
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\rot@mess@toks}
+% A token register to build up debugging messages
+% \begin{macrocode}
+\newtoks\rot@mess@toks
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Rotated captions only}
+%
+% \begin{macro}{\rotcaption}
+% \begin{macro}{\@makerotcaption}
+% Sometimes you may find that the rotation of complete figures does
+% not give quite the right result, since they always take up the whole
+% page. You may prefer to rotate the caption and the float contents
+% separately within a conventional figure. Here we offer a suggestion
+% for a \cs{rotcaption} command, which inserts the caption rotated
+% by 90 degrees. It is essentially a copy of the normal captioning
+% code.
+% Packages which define the \cs{@makecaption} command may also need
+% to define \cs{@makerotcaption}.
+% \begin{macrocode}
+\def\rotcaption{\refstepcounter\@captype\@dblarg{\@rotcaption\@captype}}
+\long\def\@rotcaption#1[#2]#3{%
+ \addcontentsline{\csname ext@#1\endcsname}{#1}{%
+ \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
+ \par
+ \begingroup
+ \@parboxrestore
+ \normalsize
+ \@makerotcaption{\csname fnum@#1\endcsname}{#3}%
+ \endgroup}
+ \long\def\@makerotcaption#1#2{%
+ \setbox\@tempboxa\color@hbox#1: #2\color@endbox
+ \ifdim \wd\@tempboxa > .8\vsize
+ \rotatebox{90}{%
+ \begin{minipage}{.8\textheight}#1: #2\end{minipage}%
+ }%
+ \else%
+ \rotatebox{90}{\box\@tempboxa}%
+ \fi
+ \nobreak
+ \hspace{12pt}%
+}
+%</package>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{Last-minute infrastructure}
+%
+% \begin{macro}{\color@hbox}
+% \begin{macro}{\color@endbox}
+% These macros aren't provided in \LaTeX{}, by default (I seem to have
+% assumed that they were\dots)
+% \begin{macrocode}
+\AtBeginDocument{%
+ \providecommand\color@hbox{\hbox\bgroup}%
+ \providecommand\color@vbox{\vbox\bgroup}%
+ \providecommand\color@endbox{\egroup}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{History}
+%
+% Version 2.0 is a complete re-write, with most of the work now
+% being done by the \LaTeXe\ graphics package.
+%
+% Version 2.1 provides a `clockwise' option to reinstate the behaviour
+% described in the `\LaTeX\ Companion'
+%
+% Version 2.2 just intercepts the standard float macros instead
+% of copying and changing the. The `twoside' option is obeyed.
+%
+% Version 2.5 corrects problems in sideways figures.
+%
+% Version 2.6 is a rewrite of the sideways floats via Frank Mittelbach
+% (to whom many thanks for looking at the mangy code).
+%
+% Version 2.7 is checked for \LaTeX\ of December 94, and adds the option
+% of twoside behaviour independent of the general twoside.
+%
+% Version 2.8 cleans up some mistakes pointed out by Harald Axel
+% Sommerfeldt.
+%
+% Version 2.9 cleans up some (more) mistakes pointed out by Harald
+% Axel Sommerfeldt.
+%
+% Version 2.13a permits positioning of rotated floats in the same way
+% as they are positioned in `normal' floats.
+%
+% Version 2.14 is the first to be published anywhere as the outcome of
+% maintenance by Robin Fairbairns.
+%
+% Version 2.15 deals with page-numbering bug for auto-float-rotation,
+% and tidying of messages; published to ctan
+%
+% Version 2.16 uses colour boxes as necessary; published to ctan.
+% Version 2.16a provides the colour box commands \cs{AtBeginDocument}.
+%
+% \Finale
+\endinput
+%
diff --git a/macros/latex-dev/required/graphics/rotating.pdf b/macros/latex-dev/required/graphics/rotating.pdf
new file mode 100644
index 0000000000..bfaa34d0ab
--- /dev/null
+++ b/macros/latex-dev/required/graphics/rotating.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/rotex.pdf b/macros/latex-dev/required/graphics/rotex.pdf
new file mode 100644
index 0000000000..1564784475
--- /dev/null
+++ b/macros/latex-dev/required/graphics/rotex.pdf
Binary files differ
diff --git a/macros/latex-dev/required/graphics/rotex.tex b/macros/latex-dev/required/graphics/rotex.tex
new file mode 100644
index 0000000000..9dabfd37f7
--- /dev/null
+++ b/macros/latex-dev/required/graphics/rotex.tex
@@ -0,0 +1,500 @@
+\errorcontextlines32
+\documentclass[twoside]{report}
+\usepackage[chatter]{rotating}
+\usepackage{fancyvrb}
+\makeatletter
+\newsavebox{\@display}
+\newcommand\@@Display[1]{%
+ \sbox\@display{%
+ \begin{minipage}[b]{.45\textwidth}%
+ #1\end{minipage}%
+ }\raisebox{\depth}{\usebox{\@display}}%
+}
+
+\newcommand\@@VDisplay[1]{%
+ \sbox\@display{%
+ \begin{minipage}[b]{.45\textwidth}%
+ \BVerbatimInput[fontsize=\small]{#1}%
+ \end{minipage}}%
+ \usebox{\@display}%
+}
+\newcommand\SideBySide[2]{%
+\bgroup\def\baselinestretch{1}%
+ \trivlist\item[]%
+ \leavevmode
+ \makebox[\textwidth][l]{\@@Display{#1}\hspace{1em}%
+ \@@VDisplay{#2}}%
+ \endtrivlist
+ \egroup
+}
+\newcommand\BeginExample{%
+ \nobreak
+ \VerbatimEnvironment
+ \catcode`\<=12
+ \begin{VerbatimOut}{\jobname.ex}%
+}
+\newcommand{\EndExample}{\end{VerbatimOut}}
+
+\newenvironment{example}
+ {\nobreak
+ \VerbatimEnvironment
+ \catcode`\<=12
+ \begin{VerbatimOut}{\jobname.ex}%
+ }
+ {\end{VerbatimOut}
+ \SideBySide {\input{\jobname.ex}}%
+ {\jobname.ex}}
+\makeatother
+%-------------------------------------------------------
+\def\degrees{{\small$^{\mathrm{o}}$}}
+%-------------------------------------------------------
+
+\begin{document}
+
+\title{Test of `rotating' package}
+\author{Sebastian Rahtz and Leonor Barroca\thanks{Now maintained as part of the \LaTeX\ graphics bundle.}}
+\date{November 19th 1994\thanks{Updated for graphics bundle 2016/05/22}}
+\maketitle
+
+`Rotating' provides a generalised rotation environment, where the text
+will be rotated (anti-clockwise) by the number of degrees specified as
+a parameter to the environment, but no special arrangement is made to
+find space for the result.
+
+\begin{example}
+Start here
+\begin{rotate}{-56}
+Save whales
+\end{rotate}
+End here
+\end{example}
+
+A complete example of rotating text without leaving space
+would the `Save the whale' text
+written at 10 degree intervals round the compass. We use
+`rlap' to ensure that all the texts are printed at the same point.
+Just to show that \TeX\ can handle PostScript muckings-about
+properly\ldots
+\begin{example}
+\newcount\wang
+\newsavebox{\wangtext}
+\newdimen\wangspace
+\def\wheel#1{\savebox{\wangtext}{#1}%
+\wangspace\wd\wangtext
+\advance\wangspace by 1cm%
+\centerline{%
+\rule{0pt}{\wangspace}%
+\rule[-\wangspace]{0pt}{\wangspace}%
+\wang=-180\loop\ifnum\wang<180
+\rlap{\begin{rotate}{\the\wang}%
+\rule{1cm}{0pt}#1\end{rotate}}%
+\advance\wang by 10\repeat}}
+\wheel{Save the whale}
+\end{example}
+
+If the user
+desires \LaTeX\ to leave space for the rotated box, then `turn' is used:
+\begin{example}
+ Start here \begin{turn}{56}%
+ Save the whale
+ \end{turn} end here
+\end{example}
+The environment `Sideways' is a special case, setting the rotation to $-90$,
+and leaving the correct space for the rotated box.
+\begin{example}
+Start here
+\begin{sideways}%
+Save the whale
+\end{sideways}
+End here
+\end{example}
+
+If you deal with whole paragraphs of text, you realize that \TeX\
+boxes are not as simple as they sometimes look: they have a height
+{\em and} a depth. So when you rotate, you rotate about the point on
+the left-hand edge of the box that meets the baseline. The results can
+be unexpected, as shown in the full set of paragraph rotations in
+Figures \ref{angles1} and \ref{angles2}. If you really want to turn a
+paragraph so that it appears to rotate about the {\em real} bottom of
+the \TeX\ box,
+you have to adjust the box in the normal \LaTeX\ way:
+\begin{example}
+\newsavebox{\foo}
+\savebox{\foo}{\parbox{1in}{Save
+the whales Save the whale
+Save the whale
+Save the whale}}%
+Start
+\begin{turn}{45}\usebox{\foo}\end{turn}
+End
+\end{example}
+\begin{example}
+\savebox{\foo}{\parbox[b]{1in}{Save
+the whales Save the whale
+Save the whale
+Save the whale}}%
+Start
+\begin{turn}{45}\usebox{\foo}\end{turn}
+End
+\end{example}
+
+\def\testrot#1{%
+\savebox{\foo}{\parbox{1in}{Save
+the whales Save the whale Save the whale Save the whale}}%
+\framebox{---\begin{turn}{#1}\framebox{\usebox{\foo}}\end{turn}---}}%
+
+\begin{figure*}
+\begin{tabular}{|c|c|c|}
+\hline
+\testrot{0} &\testrot{-40}&\testrot{-80}\\
+0\degrees & -40\degrees & -80\degrees \\
+\hline
+\testrot{-120}&\testrot{-160}&\testrot{-200}\\
+120\degrees & -160\degrees & -200\degrees \\
+\hline
+\testrot{-240}&\testrot{-280}&\testrot{-320}\\
+-240\degrees & -280\degrees & -320\degrees \\
+\hline
+\end{tabular}
+\caption{Rotation of paragraphs between 0 and -320 degrees \label{angles1}}
+\end{figure*}
+
+\begin{figure*}
+\begin{tabular}{|c|c|c|}
+\hline
+\testrot{-180} &\testrot{40}&\testrot{80}\\
+-180\degrees & 40\degrees & 80\degrees \\
+\hline
+\testrot{120}&\testrot{160}&\testrot{200}\\
+120\degrees & 160\degrees & 200\degrees \\
+\hline
+\testrot{240}&\testrot{280}&\testrot{320}\\
+240\degrees & 280\degrees & 320\degrees \\
+\hline
+\end{tabular}
+\caption{Rotation of paragraphs between 0 and 320 degrees\label{angles2}}
+\end{figure*}
+
+
+We can set tabular material in this way; at the same time, we
+demonstrate that the rotation can be nested:
+\begin{example}
+\begin{sideways}
+\rule{1in}{0pt}
+\begin{tabular}{|lr|}
+\em Word & \begin{rotate}{90}%
+Occurrences\end{rotate}
+\\
+\hline
+hello & 33\\
+goodbye & 34\\
+\hline
+\end{tabular}
+\end{sideways}
+\end{example}
+
+\begin{example}
+\begin{quote}
+\rule{0pt}{1.5in}\begin{tabular}{rrr}
+\begin{rotate}{45}Column 1\end{rotate}&
+\begin{rotate}{45}Column 2\end{rotate}&
+\begin{rotate}{45}Column 3\end{rotate}\\
+\hline
+1& 2& 3\\
+4& 5& 6\\
+7& 8& 9\\
+\hline
+\end{tabular}
+\end{quote}
+\end{example}
+
+\begin{example}
+\begin{quote}
+\begin{tabular}{rrr}
+\begin{turn}{45}Column 1\end{turn}&
+\begin{turn}{45}Column 2\end{turn}&
+\begin{turn}{45}Column 3\end{turn}\\
+\hline
+1& 2& 3\\
+4& 5& 6\\
+7& 8& 9\\
+\hline
+\end{tabular}
+\end{quote}
+\end{example}
+
+\begin{example}
+\begin{quote}
+\rule{0pt}{1.5in}\begin{tabular}{rrr}
+\begin{rotate}{45}Column 1\end{rotate}
+\rule{.5cm}{0pt}&
+\begin{rotate}{45}Column 2\end{rotate}
+\rule{.5cm}{0pt}&
+\begin{rotate}{45}Column 3\end{rotate}
+\rule{.5cm}{0pt}\\
+\hline
+1& 2& 3\\
+4& 5& 6\\
+7& 8& 9\\
+\hline
+\end{tabular}
+\end{quote}
+\end{example}
+
+\begin{example}
+\begin{sideways}
+\begin{tabular}{|l|c|c|c|c|c|p{1in}|}
+\hline
+&&\multicolumn{4}{c}{NUMBER OF SITES}\vline &ACCEPT or\\
+\cline{3-6} &STUDY AREA&&\multicolumn{3}{c}{%
+IN BOUNDARY ZONE}\vline&REJECT\\
+\cline{4-6}&&&&\multicolumn{2}{c}{EXPECTED}
+\vline&NULL\\
+\cline{5-6}&&TOT&OBS&FROM&TO&HYPOTH\\
+\cline{2-7}
+&FULL SAMPLE&41&31&10.3&27.0&REJECT\\
+&SAMPLE AREA 1&23&16&4.3&16.7&ACCEPT\\
+&SAMPLE AREA 2&18&15&2.8&13.7&REJECT\\
+&RUSHEN&13&9&1.2&10.4&ACCEPT\\
+&ARBORY&10&7&0.6&8.8&ACCEPT\\
+&MAROWN&10&8&0.4&8.6&ACCEPT\\
+\rule{0.5cm}{0pt}
+\begin{rotate}{90}PRIMARY UNITS%
+\end{rotate}\rule{0.5cm}{0pt}
+&SANTON&8&7&0.0&7.3&ACCEPT\\
+\hline
+\end{tabular}
+\end{sideways}
+\end{example}
+
+If you are interested in setting rotated material in tables or
+figures, this presents no problem. Figure \ref{fig1} shows how
+PostScript files which are being incorporated using can be
+rotated at will, while Figure \ref{fig2} shows, in contrast, how
+`includegraphics' itself handles rotation. It is also possible to rotate the
+whole of the figure environment, including caption,
+by using the `sidewaysfigure' ands `sidewaystable' environments
+in place of `figure' and `table'.
+
+Sideways figures and tables always take up the whole page. They can be
+rotated so that the bottom ot the figures is on the left or the right;
+the default is to always turn to the right. If the `twoside' option
+has been given to the main document class, this package then starts
+rotating sideways figures according to the page number (this requires
+two passes through \LaTeX{} at least). If you want the `twoside'
+option, but want the figures always in one direction, use the
+`figuresright' or `riguresleft' options to `rotating'.
+
+The code used to produce figures
+\ref{rotfloat1}--\ref{rotfloat4} is as follows:
+\begin{description}
+
+\item[Figure \ref{rotfloat1}]
+{\small\begin{verbatim}
+\begin{sidewaystable}
+\centering
+\caption{This is a narrow table, which should be centred vertically
+on the final page.\label{rotfloat1}}
+ \begin{tabular}{|ll|}
+\hline
+ a & b \\
+ c & d \\
+ e & f \\
+ g & h \\
+ i & j \\
+\hline
+ \end{tabular}
+\end{sidewaystable}
+\end{verbatim}
+}
+
+\item[Figure \ref{rotfloat2}]
+{\scriptsize\begin{verbatim}
+\begin{sidewaystable}
+\centering
+\begin{tabular}{|llllllllp{1in}lp{1in}|}
+\hline
+Context &Length &Breadth/ &Depth &Profile &Pottery &Flint &Animal &Stone &Other &C14 Dates \\
+ & &Diameter & & & & &
+Bones&&&\\
+\hline
+&&&&&&&&&&\\
+\multicolumn{10}{|l}{\bf Grooved Ware}&\\
+784 &--- &0.9m &0.18m &Sloping U &P1 &$\times$46 & $\times$8 && $\times$2 bone& 2150$\pm$ 100 BC\\
+785 &--- &1.00m &0.12 &Sloping U &P2--4 &$\times$23 & $\times$21 & Hammerstone &---&---\\
+962 &--- &1.37m &0.20m &Sloping U &P5--6 &$\times$48 & $\times$57* & ---& ---&1990 $\pm$ 80 BC (Layer 4) 1870 $\pm$90 BC (Layer 1)\\
+983 &0.83m &0.73m &0.25m &Stepped U &--- &$\times$18 & $\times$8 & ---& Fired clay&---\\
+&&&&&&&&&&\\
+\multicolumn{10}{|l}{\bf Beaker}&\\
+552 &--- &0.68m &0.12m &Saucer &P7--14 &--- & --- & --- &--- &---\\
+790 &--- &0.60m &0.25m &U &P15 &$\times$12 & --- & Quartzite-lump&--- &---\\
+794 &2.89m &0.75m &0.25m &Irreg. &P16 &$\times$3 & --- & --- &--- &---\\
+\hline
+\end{tabular}
+
+\caption[Grooved Ware and Beaker Features, their Finds and
+Radiocarbon Dates]{Grooved Ware and Beaker Features, their
+Finds and Radiocarbon Dates; For a breakdown of the Pottery
+Assemblages see Tables I and III; for
+the Flints see Tables II and IV; for the
+Animal Bones see Table V.}\label{rotfloat2}
+\end{sidewaystable}
+\end{verbatim}
+}
+
+\item[Figure \ref{rotfloat3}]
+{\small\begin{verbatim}
+\begin{table}
+\centering
+\rotcaption{Minimum number of individuals; effect of rotating table
+and caption separately}\label{rotfloat3}%
+\begin{sideways}
+\begin{tabular}[b]{cccccccccp{1cm}}
+\hline
+Phase&Total&Cattle&Sheep&Pig&Red Deer&Horse&Dog&Goat&Other\\
+\hline
+&1121&54&12&32&1&1&1&1&1 polecat\\
+3&8255&58&6&35&1&1&1&1&1 roe deer, 1 hare, 1 cat, 1 otter\\
+4&543&45&6&45&4&1&1&---&---\\
+\hline
+&9919&157&24&112&6&3&3&2&5\\
+\hline
+\end{tabular}
+\end{sideways}
+\end{table}
+\end{verbatim}
+}
+
+\item[Figure \ref{rotfloat4}]
+{\small\begin{verbatim}
+\begin{sidewaysfigure}
+ \centering
+ \includegraphics[width=.8\textheight,height=.4\textwidth]{cat}
+\caption{A pathetically squashed rotated pussycat}\label{rotfloat4}
+\end{sidewaysfigure}
+\end{verbatim}
+}
+\end{description}
+
+\begin{figure}
+\begin{example}
+---\begin{turn}{156}
+\includegraphics[width=1in]{cat}
+\end{turn}---
+\end{example}
+
+\begin{example}
+---\begin{sideways}
+\includegraphics[width=1in]{cat}
+\end{sideways}---
+\end{example}
+
+\begin{example}
+---\includegraphics[width=1in]{cat}---
+\end{example}
+\caption{A normal, and sideways, pictures within a figure\label{fig1}}
+\end{figure}
+
+\begin{figure}
+\begin{example}
+\includegraphics[width=1in,%
+angle=-56]{cat}
+\end{example}
+
+\caption{Figures rotated with `includegraphics'\label{fig2}}
+\end{figure}
+\begin{sidewaystable}
+\centering
+\caption{This is a narrow table, which should be centred vertically
+on the final page.\label{rotfloat1}}
+ \begin{tabular}{|ll|}
+\hline
+ a & b \\
+ c & d \\
+ e & f \\
+ g & h \\
+ i & j \\
+\hline
+ \end{tabular}
+\end{sidewaystable}
+
+
+
+\begin{sidewaystable}
+\centering
+\begin{tabular}{|llllllllp{1in}lp{1in}|}
+\hline
+Context &Length &Breadth/ &Depth &Profile &Pottery &Flint &Animal &Stone &Other &C14 Dates \\
+ & &Diameter & & & & &
+Bones&&&\\
+\hline
+&&&&&&&&&&\\
+\multicolumn{10}{|l}{\bf Grooved Ware}&\\
+784 &--- &0.9m &0.18m &Sloping U &P1 &$\times$46 & $\times$8 && $\times$2 bone& 2150$\pm$ 100 BC\\
+785 &--- &1.00m &0.12 &Sloping U &P2--4 &$\times$23 & $\times$21 & Hammerstone &---&---\\
+962 &--- &1.37m &0.20m &Sloping U &P5--6 &$\times$48 & $\times$57* & ---& ---&1990 $\pm$ 80 BC (Layer 4) 1870 $\pm$90 BC (Layer 1)\\
+983 &0.83m &0.73m &0.25m &Stepped U &--- &$\times$18 & $\times$8 & ---& Fired clay&---\\
+&&&&&&&&&&\\
+\multicolumn{10}{|l}{\bf Beaker}&\\
+552 &--- &0.68m &0.12m &Saucer &P7--14 &--- & --- & --- &--- &---\\
+790 &--- &0.60m &0.25m &U &P15 &$\times$12 & --- & Quartzite-lump&--- &---\\
+794 &2.89m &0.75m &0.25m &Irreg. &P16 &$\times$3 & --- & --- &--- &---\\
+\hline
+\end{tabular}
+
+\caption[Grooved Ware and Beaker Features, their Finds and
+Radiocarbon Dates]{Grooved Ware and Beaker Features, their
+Finds and Radiocarbon Dates; For a breakdown of the Pottery
+Assemblages see Tables I and III; for
+the Flints see Tables II and IV; for the
+Animal Bones see Table V.}\label{rotfloat2}
+\end{sidewaystable}
+
+\begin{table}
+\centering
+\hbox{
+\rotcaption{Minimum number of individuals; effect of rotating table
+and caption separately}\label{rotfloat3}%
+\begin{sideways}
+\begin{tabular}[t]{cccccccccp{1cm}}
+\hline
+Phase&Total&Cattle&Sheep&Pig&Red Deer&Horse&Dog&Goat&Other\\
+\hline
+&1121&54&12&32&1&1&1&1&1 polecat\\
+3&8255&58&6&35&1&1&1&1&1 roe deer, 1 hare, 1 cat, 1 otter\\
+4&543&45&6&45&4&1&1&---&---\\
+\hline
+&9919&157&24&112&6&3&3&2&5\\
+\hline
+\end{tabular}
+\end{sideways}
+}
+\end{table}
+
+
+\begin{sidewaysfigure}
+ \centerline{\includegraphics[width=.8\textheight,height=.4\textwidth]{cat}}
+\caption{A pathetically squashed rotated pussycat (1)}
+\end{sidewaysfigure}
+
+\begin{sidewaysfigure}
+ \centerline{\includegraphics[width=.8\textheight,height=.4\textwidth]{cat}}
+\caption{A pathetically squashed rotated pussycat (2)}
+\end{sidewaysfigure}
+
+\begin{sidewaysfigure}
+ \centerline{\includegraphics[width=.8\textheight,height=.4\textwidth]{cat}}
+\caption{A pathetically squashed rotated pussycat (3)}
+\end{sidewaysfigure}
+
+\begin{sidewaysfigure}
+ \centerline{\includegraphics[width=.8\textheight,height=.4\textwidth]{cat}}
+\caption{A pathetically squashed rotated pussycat (4)}
+\end{sidewaysfigure}
+
+\begin{sidewaysfigure}
+ \centerline{\includegraphics[width=.8\textheight,height=.4\textwidth]{cat}}
+\caption{A pathetically squashed rotated pussycat}\label{rotfloat4}
+\end{sidewaysfigure}
+
+\end{document}
diff --git a/macros/latex-dev/required/graphics/trig.dtx b/macros/latex-dev/required/graphics/trig.dtx
new file mode 100644
index 0000000000..712db13ba2
--- /dev/null
+++ b/macros/latex-dev/required/graphics/trig.dtx
@@ -0,0 +1,329 @@
+% \iffalse
+%% File: trig.dtx Copyright (C) 1993 1994 1995 1996 1997 1999 David Carlisle
+%% Copyright (C) 2000--2015 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%
+%<*dtx>
+ \ProvidesFile{trig.dtx}
+%</dtx>
+%<*!plain>
+%<package&!plain>\NeedsTeXFormat{LaTeX2e}
+%<package&!plain>\ProvidesPackage{trig}
+%<driver> \ProvidesFile{trig.drv}
+% \fi
+% \ProvidesFile{trig.dtx}
+ [2016/01/03 v1.10 sin cos tan (DPC)]
+%
+% \iffalse
+%</!plain>
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{trig}
+\begin{document}
+ \DocInput{trig.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{trig.dtx}
+% \title{The \textsf{trig} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{David Carlisle}
+% \date{\filedate}
+% \MaintainedByLaTeXTeam{graphics}
+% \maketitle
+%
+%
+% \changes{v1.00}{1993/00/00}{Undocumented versions}
+% \changes{v1.05}{1993/10/07}{Documented, added tan}
+% \changes{v1.06}{1994/02/01}{Update for LaTeX2e}
+% \changes{v1.07}{1994/03/15}{Use ltxdoc}
+% \changes{v1.08}{1994/10/16}{Change \cs{@xc} to \cs{nin@ty}}
+%
+% \section{Introduction}
+%
+% These macros implement the trigonometric functions, sin, cos and tan.
+% In each case two commands are defined. For instance the command
+% |\CalculateSin{33}| may be issued at some point, and then anywhere
+% later in the document, the command |\UseSin{33}| will return the
+% decimal expansion of $\sin(33^\circ)$.
+%
+% The arguments to these macros do not have to be whole numbers,
+% although in the case of whole numbers, \LaTeX\ or plain \TeX\ counters
+% may be used. In \TeX{}Book syntax, arguments must be of type:
+% \meta{optional signs}\meta{factor}
+%
+% Some other examples are:\\
+% |\CalculateSin{22.5}|, |\UseTan{\value{mycounter}}|,
+% |\UseCos{\count@}|.
+%
+% Note that unlike the psfig macros, these save all previously
+% computed values. This could easily be changed, but I thought that in
+% many applications one would want many instances of the
+% same value. (eg rotating all the headings of a table by the
+% \emph{same} amount).
+%
+% I don't really like this need to pre-calculate the values, I
+% originally implemented |\UseSin| so that it automatically calculated
+% the value if it was not pre-stored. This worked fine in testing, until
+% I remembered why one needs these values. You want to be able to say
+% |\dimen2=\UseSin{30}\dimen0|. Which means that |\UseSin| must
+% \emph{expand} to a \meta{factor}.
+%
+% \StopEventually{}
+%
+% \section{The Macros}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \begin{macro}{\nin@ty}\begin{macro}{\@clxx}
+% \begin{macro}{\@lxxi}\begin{macro}{\@mmmmlxviii}
+% Some useful constants for converting between degrees and radians.
+% $$\frac{\pi}{180}\simeq\frac{355}{113\times180}=\frac{71}{4068}$$
+% \begin{macrocode}
+\chardef\nin@ty=90
+\chardef\@clxx=180
+\chardef\@lxxi=71
+\mathchardef\@mmmmlxviii=4068
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% The approximation to $\sin$. I experimented with various
+% approximations based on Tchebicheff polynomials, and also some
+% approximations from a SIAM handbook `Computer Approximations' However
+% the standard Taylor series seems sufficiently accurate, and used by
+% far the fewest \TeX\ tokens, as the coefficients are all rational.
+% \begin{eqnarray*}
+% \sin(x)& \simeq& x - (1/3!)x^3 + (1/5!)x^5 - (1/7!)x^7 + (1/9!)x^9\\
+% &\simeq&\frac{((((7!/9!x^2-7!/7!)x^2+7!/5!)x^2 +7!/3!)x^2+7!/1!)x}
+% {7!}\\
+% &=&\frac{((((1/72x^2-1)x^2+42)x^2 +840)x^2+5040)x}
+% {5040}
+% \end{eqnarray*}
+% The nested form used above reduces the number of operations required.
+% In order to further reduce the number of operations, and more
+% importantly reduce the number of tokens used, we can precompute the
+% coefficients. Note that we can not use $9!$ as the denominator as
+% this would cause overflow of \TeX's arithmetic.
+% \begin{macro}{\@coeffz}\begin{macro}{\@coeffa}\begin{macro}{\@coeffb}
+% \begin{macro}{\@coeffc}\begin{macro}{\@coeffd}
+% Save the coefficients as |\|(|math|)|char|s.
+% \begin{macrocode}
+\chardef\@coeffz=72
+%\chardef\@coefa=1
+\chardef\@coefb=42
+\mathchardef\@coefc=840
+\mathchardef\@coefd=5040
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\TG@rem@pt}
+% The standard trick of getting a real number out of a \meta{dimen}.
+% This gives a maximum accuracy of approx.\ 5 decimal places, which
+% should be sufficient. It puts a space after the number, perhaps it
+% shouldn't.
+% \begin{macrocode}
+{\catcode`t=12\catcode`p=12\gdef\noPT#1pt{#1}}
+\def\TG@rem@pt#1{\expandafter\noPT\the#1\space}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@term}
+% Compute one term of the above nested series. Multiply the previous sum
+% by $x^2$ (stored in |\@tempb|, then add the next coefficient, |#1|.
+% \begin{macrocode}
+\def\TG@term#1{%
+ \dimen@\@tempb\dimen@
+ \advance\dimen@ #1\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@series}
+% Compute the above series. the value in degrees will be in |\dimen@|
+% before this is called.
+% \begin{macrocode}
+\def\TG@series{%
+ \dimen@\@lxxi\dimen@
+ \divide \dimen@ \@mmmmlxviii
+% \end{macrocode}
+% |\dimen@| now contains the angle in radians, as a \meta{dimen}. We
+% need to remove the units, so store the same value as a \meta{factor}
+% in |\@tempa|.
+% \begin{macrocode}
+ \edef\@tempa{\TG@rem@pt\dimen@}%
+% \end{macrocode}
+% Now put $x^2$ in |\dimen@| and |\@tempb|.
+% \begin{macrocode}
+ \dimen@\@tempa\dimen@
+ \edef\@tempb{\TG@rem@pt\dimen@}%
+% \end{macrocode}
+% The first coefficient is $1/72$.
+% \begin{macrocode}
+ \divide\dimen@\@coeffz
+ \advance\dimen@\m@ne\p@
+ \TG@term\@coefb
+ \TG@term{-\@coefc}%
+ \TG@term\@coefd
+% \end{macrocode}
+% Now the cubic in $x^2$ is completed, so we need to multiply by $x$ and
+% divide by $7!$.
+% \begin{macrocode}
+ \dimen@\@tempa\dimen@
+ \divide\dimen@ \@coefd}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CalculateSin}
+% If this angle has already been computed, do nothing, else store the
+% angle, and call |\TG@@sin|.
+% \begin{macrocode}
+\def\CalculateSin#1{{%
+ \expandafter\ifx\csname sin(\number#1)\endcsname\relax
+ \dimen@=#1\p@\TG@@sin
+ \expandafter\xdef\csname sin(\number#1)\endcsname
+ {\TG@rem@pt\dimen@}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CalculateCos}
+% As above, but use the relation $\cos(x) = \sin(90-x)$.
+% \begin{macrocode}
+\def\CalculateCos#1{{%
+ \expandafter\ifx\csname cos(\number#1)\endcsname\relax
+ \dimen@=\nin@ty\p@
+ \advance\dimen@-#1\p@
+ \TG@@sin
+ \expandafter\xdef\csname cos(\number#1)\endcsname
+ {\TG@rem@pt\dimen@}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@reduce}
+% Repeatedly use one of the the relations
+% $\sin(x)=\sin(180-x)=\sin(-180-x)$ to get $x$ in the range $-90 \leq
+% x\leq 90$. Then call |\TG@series|.
+% \begin{macrocode}
+\def\TG@reduce#1#2{%
+\dimen@#1#2\nin@ty\p@
+ \advance\dimen@#2-\@clxx\p@
+ \dimen@-\dimen@
+ \TG@@sin}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@@sin}
+% Slightly cryptic, but it seems to work\ldots
+% \begin{macrocode}
+\def\TG@@sin{%
+ \ifdim\TG@reduce>+%
+ \else\ifdim\TG@reduce<-%
+ \else\TG@series\fi\fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\UseSin}
+% \begin{macro}{\UseCos}
+% Use a pre-computed value.
+% \begin{macrocode}
+\def\UseSin#1{\csname sin(\number#1)\endcsname}
+\def\UseCos#1{\csname cos(\number#1)\endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% A few shortcuts to save space.
+% \changes{v1.10}{2016/01/03}{make these expand to digits so safe to use in ctm}
+% \begin{macrocode}
+\def\z@num{0 }
+\def\@tempa{1 }
+\def\@tempb{-1 }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\expandafter\let\csname sin(0)\endcsname\z@num
+\expandafter\let\csname cos(0)\endcsname\@tempa
+\expandafter\let\csname sin(90)\endcsname\@tempa
+\expandafter\let\csname cos(90)\endcsname\z@num
+\expandafter\let\csname sin(-90)\endcsname\@tempb
+\expandafter\let\csname cos(-90)\endcsname\z@num
+\expandafter\let\csname sin(180)\endcsname\z@num
+\expandafter\let\csname cos(180)\endcsname\@tempb
+% \end{macrocode}
+%
+% A few more added in 1.10 (previously in pdftex.def)
+% \begin{macrocode}
+\expandafter\let\csname sin(270)\endcsname\@tempb
+\expandafter\let\csname cos(270)\endcsname\z@num
+\expandafter\let\csname sin(360)\endcsname\z@num
+\expandafter\let\csname cos(360)\endcsname\@tempa
+\expandafter\let\csname sin(-180)\endcsname\z@num
+\expandafter\let\csname cos(-180)\endcsname\@tempb
+\expandafter\let\csname sin(-270)\endcsname\@tempa
+\expandafter\let\csname cos(-270)\endcsname\z@num
+\expandafter\let\csname sin(-360)\endcsname\z@num
+\expandafter\let\csname cos(-360)\endcsname\@tempa
+% \end{macrocode}
+%
+% \begin{macro}{\CalculateTan}
+% Originally I coded the Taylor series for tan, but it seems to be
+% more accurate to just take the ratio of the sine and cosine.
+% This is accurate to 4 decimal places for angles up to
+% $50^\circ$, after that the accuracy tails off, giving
+% 57.47894 instead of 57.2900 for $89^\circ$.
+% \begin{macrocode}
+\def\CalculateTan#1{{%
+ \expandafter\ifx\csname tan(\number#1)\endcsname\relax
+ \CalculateSin{#1}%
+ \CalculateCos{#1}%
+ \@tempdima\UseCos{#1}\p@
+ \divide\@tempdima\@iv
+ \@tempdimb\UseSin{#1}\p@
+ \@tempdimb\two@fourteen\@tempdimb
+ \divide\@tempdimb\@tempdima
+ \expandafter\xdef\csname tan(\number#1)\endcsname
+ {\TG@rem@pt\@tempdimb}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\UseTan}
+% Just like |\UseSin|.
+% \begin{macrocode}
+\def\UseTan#1{\csname tan(\number#1)\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\two@fourteen}
+% \begin{macro}{\@iv}
+% two constants needed to keep the division within \TeX's range.
+% \begin{macrocode}
+\mathchardef\two@fourteen=16384
+\chardef\@iv=4
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Predefine $\tan(\pm90)$ to be an error.
+% \begin{macrocode}
+\expandafter\def\csname tan(90)\endcsname{\errmessage{Infinite tan !}}
+\expandafter\let\csname tan(-90)\expandafter\endcsname
+ \csname tan(90)\endcsname
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
+\endinput
diff --git a/macros/latex-dev/required/graphics/trig.pdf b/macros/latex-dev/required/graphics/trig.pdf
new file mode 100644
index 0000000000..2ad8cb7b53
--- /dev/null
+++ b/macros/latex-dev/required/graphics/trig.pdf
Binary files differ