[PDF] The graphicx package



Previous PDF Next PDF







Strategies for including graphics in LATEX documents

follow later In the case of using \includegraphics without options the image is included at its natural size, as shown above When using the graphicx style, you can scale your image by a factor: \includegraphics[scale=0 5]{sample} \includegraphics[scale=1 2]{sample} 5



Graphics in LaTeX - Auburn University

The includegraphics Command Graphics can be included with the command \includegraphics[key=value]{filename} where the options for key are widthresize image to the width given heightresize image to the height given totalheightresize image to totalheight keepaspectratioif both width and height are defined, then scale the image to fit the



Including Graphics in LATEX Marko Boon 14th March 2005

2 The includegraphics command \includegraphics[options]{filename} When including EPS or PDF files, use the file name without extension LATEX will take the EPS, PDFLATEX will take the PDF Supported options are: scale=number magnifies the figure by number over its natural size width=length specifies the width to which the figure should be scaled



How to Use the graphicx Package

\includegraphics{demo} (note that none of the keys is used) Figure 2 shows the same figure scaled by a factor of three and rotated by 60 degrees anticlockwise and using the command \includegraphics[scale = 3, angle = 60]{demo} 2If the width is not given, it too is scaled by the same amount



Graphics and Colour with LaTeX - LORIA

\includegraphics[height=2cm,angle=30]{clock eps} For compatibility with the graphics package, there also exists an \includegraphics* version that clips the imported gure; this is equivalent to including the key clip With the graphicx package, the \rotatebox command is similarly rede ned to accept the optional key origin





Packages in the `graphics bundle - ConcertPasscom

The following driver options are declared in the packages The matching def-inition les (driver def) are now also maintained by the LATEX project, but distributed separately, in the CTAN graphics-def collection dvi pdf mx, dvips, dvisvgm, luatex, pdf tex, xetex The following two options are also supported, they do not correspond to separate



The adjustbox Package - The CTAN archive

the macro \includegraphics[hoptionsi]{hfile namei}which can be used to in-clude graphic files Several options can be used to scale, resize, rotate, trim and/or



The pdfpages Package - The CTAN archive

\includegraphics, or other low-level commands ) However, there’s a glimmer of hope Some links may be extracted and later reinserted by a package called pax which can be downloaded from CTAN [3] Have a look at it 2 Usage 2 1 Package Options \usepackage[ options ]{ pdf pages} option { final: Inserts pages This is the default



The asymptote package

2 1 Package loading and options The package may take two options at load time: inline or attach These options can also be set at any time with the \asysetup{hoptionsi} command, or speci ed individually in the optional argument to each asy environment or asyinclude command The inline option uses Asymptote’s ‘inline’ mode whereby included

[PDF] figure cote a cote latex

[PDF] légende image latex

[PDF] apprendre 20 pages en 1 jour

[PDF] apprendre 40 pages en 1 jour

[PDF] apprendre 100 pages en 2 jours

[PDF] comment apprendre par coeur rapidement

[PDF] apprendre 60 pages en 2 jours

[PDF] apprendre 50 pages en un jour

[PDF] méthodologie de recherche définition

[PDF] définition de la méthodologie

[PDF] proverbe qui cherche trouve

[PDF] citation trouver

[PDF] qui cherche trouve citation

[PDF] on ne trouve que ce que l'on cherche

[PDF] cherche des proverbes

Thegraphicxpackage∗

D. P. Carlisle S. P. Q. Rahtz

2021/09/16This ifile is maintained by the L

ATEX Project team.

Bug reports can be opened (categorygraphics) at

https://latex-project.org/bugs.html.1 Introduction This package provides an alternative interface to the L

ATEX2ε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 diffferent. Noteonlythe 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.

2 Key=Value Interface

When the decision to produce L

ATEX2ε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'. Speciifically this meant that new commands would obey the same basic syntax rules for arguments as the existing commands.

Standard L

ATEX optional arguments arepositional. 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 ifirst 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 L

ATEX 2.09) have

recognised this, and used 'named arguments' in various forms. Perhaps the two most noticeable arepsfigandpstricks. 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 L

ATEX Project do appreciate the importance of this kind of syntax, but felt that rather than extending the syntax of L

ATEX in an uncoordinated

way, it would be better to keep with 'standard arguments' in L

ATEX2ε, which is∗

This ifile has version number v1.2d, last revised 2021/09/16. 1 intended as a 'consolidation of existing L

ATEX variants'. The long term planning

for an eventual L ATEX3 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 thisgraphicxpackage, which uses the named argument mechanism from thekeyvalpackage should be considered 'non standard' although it is supported by the same mechanism, and same authors as the 'standard'graphicspackage.

3 The User Interface

*[⟨key-val list⟩]{⟨ifile⟩}\includegraphics

Include a graphics ifile.

The star form is just for compatibility with the standard interface, and es- sentially just addsclipto the keys speciified. Similarly the second, two-optional argument form is for increased compatibility with the standard package. The two optional argument form is not needed in thekeyvalinterface.

Various 'keys' or named arguments are supported.

bbSet the bounding box. The argument should be four dimensions, separated by spaces. bbllx,bblly,bburx,bburySet the bounding box. Mainly for compatibility with older packages.bbllx=a,bblly=b,bburx=c,bbury=dis equivalent to bb = a b c d. natwidth,natheightAgain an alternative tobb.natheight=h,natwidth=wis equivalent tobb = 0 0 h w. viewportModify the bounding box speciified in the ifile. The four values specify a bounding boxrelativeto thellx,llycoordinate of the original box. trimModify the bounding box speciified in the ifile. The four values specify the amounts to remove from the left, bottom, right and top of the original box. hiresbbBoolean valued key. Defaults totrue. Causes TEX to look for %%HiResBoundingBoxcomments rather than the standard%%BoundingBox. May be set tofalseto override a default setting of true speciified by the hiresbbpackage option. angleRotation angle. originRotation origin (see\rotatebox, below). widthRequired width, a dimension (default unitsbp). The graphic will be scaled to make the width the speciified dimension. heightRequired height. a dimension (default unitsbp). totalheightRequired totalheight (i.e., height + depth). a dimension (default unitsbp). Most useful after a rotation (when the height might be zero). 2 keepaspectratioBoolean valued key (likeclip). If it is set to true, modify the meaning of thewidthandheight(andtotalheight) keys such that if both are speciified then rather than distort the ifigure the ifigure is scaled such that neither dimensionexceedsthe stated dimensions. scaleScale factor. clipEither 'true' or 'false' (or no value, which is equivalent to 'true'). Clip the graphic to the bounding box (or viewport if one is speciified). drafta boolean valued key, like 'clip'. locally switches to draft mode, ie. do not include the graphic, but leave the correct space, and print the ifilename. typeSpecify the ifile type. (Normally determined from the ifile extension.) extSpecify the ifile extension.Onlyfor use withtype. readSpecify the 'read ifile' which is used for determining the size of the graphic.

Onlyfor use withtype.

commandSpecify the ifile command.Onlyfor use withtype. quietTurns offf writing information about graphics to the.log. pageThe page of a multi-page PDF graphic to be used. interpolateEnables interpolation of bitmap images by viewers. pageboxSpeciifies which PDF box should be used for the natural image size, one of mediabox, cropbox, bleedbox, trimbox, artbox. The default is driver- speciific. The arguments are interpreted left to right.clip,draft,bb,, andbbllxetc. have the same efffect wherever they appear. but the scaling and rotation keys interact. Any scaling that is speciifiedbeforerotation, is handled by the internal graphics inclusion function. Rotation, or any later scaling is handled by implicitly calling \rotateboxor\scalebox. So[height=1in,angle=90]scales the graphic to 1in, then rotates it, so it is one inch wide.[angle=90,height=1in]ifirst 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 ifirst form should work as there the scaling is handled by\Ginclude@graphics. [⟨key-val list⟩]{⟨angle⟩}{⟨text⟩}\rotatebox

Rotatetext.

The keys supported by\rotateboxare:

originSpecify the centre of rotation.origin=⟨label⟩, where the labels are up to two oflrctbB(Bdenotes the baseline, as for PSTricks). x,yAn alternative toorigin.x=⟨dimen⟩,y=⟨dimen⟩Thex,ycoordinate of the centre of rotation. As usual\heightetc may be used. unitsSpecify the units used in the main argument. egunits=-360would mean that the argument referred to degreesclockwiseinstead of the default anti- clockwise rotation. 3 As an example\rotatebox[origin=c]{180}{text}will rotate "text" around its centre, thus creating a ifinal 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 mainlybelowthe baseline.

4 Implementation

1⟨∗package⟩

One new option is handled by keyval. It suppresses the error normally gener- ated if an unknow keyval key is used. (This helps porting between drivers that use extended interfaces.)

2\DeclareOption{unknownkeysallowed}

All other options are handled by thegraphicspackage.

5\ProcessOptions

This package requires these two building blocks.

6\RequirePackage{keyval,graphics}

4.1 Graphics Inclusion

First we declare the 'bounding box' keys. These all use\Gin@defaultbpso that the⟨value⟩can be given as a length in the usual TEX units such ascmor as an integer, taken asbp. \KV@Gin@bb

7\define@key{Gin}{bb}

8{\Gin@bboxtrue\Gread@parse@bb#1 \\}

\KV@Gin@bbllx \KV@Gin@bblly \KV@Gin@bburx \KV@Gin@bbury9\define@key{Gin}{bbllx}

11\define@key{Gin}{bblly}

13\define@key{Gin}{bburx}

15\define@key{Gin}{bbury}

\KV@Gin@hiresbbIf 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.

17\define@key{Gin}{hiresbb}[true]{%

18\edef\Gread@BBox{%

19\@percentchar\@percentchar

20\csname if#1\endcsname HiRes\fi

21BoundingBox}}

\KV@Gin@natheight \KV@Gin@natheight

22\let\KV@Gin@natwidth\KV@Gin@bburx

23\let\KV@Gin@natheight\KV@Gin@bbury

4 \KV@Gin@viewport \KV@Gin@trimA 'viewport' is a user-speciified area of the graphic to be included. It should not be confused with the 'Bounding Box' of a PS ifile. In fact, the origin for a viewport speciification is the (llx,lly) lower left coordinate of the bounding box. If a viewport is speciified, and clipping is turned on, clipping is based on the viewport, not on the boundingbox. Both 'viewport' and 'trim' were suggested (and originally, but diffferently, im- plemented) by Arthur Ogawa.

24\define@key{Gin}{viewport}

25{\let\Gin@viewport@code\Gin@viewport\Gread@parse@vp#1 \\}

26\define@key{Gin}{trim}

27{\let\Gin@viewport@code\Gin@trim\Gread@parse@vp#1 \\}

\Gread@parse@vpGrabs four bounding box values like\Gread@parse@bpbut saves them in alterna- tive macros that are used in the viewport and trim cases to modify the bounding box read from the ifile.

28\def\Gread@parse@vp#1 #2 #3 #4 #5\\{%

29\Gin@defaultbp\Gin@vllx{#1}%

30\Gin@defaultbp\Gin@vlly{#2}%

31\Gin@defaultbp\Gin@vurx{#3}%

32\Gin@defaultbp\Gin@vury{#4}}%

\KV@Gin@angleSpecify a rotation. This is just handled by wrapping the\includegraphicscom- mand in a call to the internal version of\rotatebox. Normally this is the 'stan- dard' version but if anoriginkey is used in\includegraphicsthen thekeyval version of origin is used, and theoriginkey is passed on.

33\define@key{Gin}{angle}

34{\Gin@esetsize

35\@tempswatrue

37\@tempa}

\KV@Gin@originPass the origin key value on to\rotatebox.\Gin@erotateis initialised to \Grot@box@stdlater in the ifile, after the latter has been deifined.

38\define@key{Gin}{origin}[c]{%

\KV@Gin@width \KV@Gin@heightSave the required height and width. The actual scaling is done later. \KV@Gin@totalheightThe same asheightkey, but locally changes\Gin@eresizeto\totalheight from its default value of\height.

42\define@key{Gin}{totalheight}{%

\KV@Gin@keepaspectratioBoolean valued key (likeclip). If it is set to true, modify the meaning of thewidth

andheight(andtotalheight) keys such that if both are speciified then rather than distort the ifigure the ifigure is scaled such that neither dimensionexceedsthe stated dimensions.

45\lowercase{\Gin@boolkey{#1}}{iso}}

5 \KV@Gin@scaleIf the scaling is being handled externally, wrap\includegraphicsin the inter- nal form of\scalebox, otherwise locally deifine\Gin@req@sizesto calculate the required sizes based on scale factor.

46\define@key{Gin}{scale}{%

47\if@tempswa

49\@tempa

50\else

51\def\Gin@req@sizes{%

55\fi

56\@tempswatrue}

\KV@Gin@draftLocally set the draft switch to true. This is used by the code ingraphicspackage to suppress the ifile inclusion.

57\define@key{Gin}{draft}[true]{%

58\lowercase{\Gin@boolkey{#1}}{draft}}

\KV@Gin@clipLocally set the clip switch to true. This is used by the code ingraphicspackage to suppress the printing of anything outside the bounding box speciified.

59\define@key{Gin}{clip}[true]{%

60\lowercase{\Gin@boolkey{#1}}{clip}}

\KV@Gin@typeIf you use 'type' you must use no extension in the main argument and you must use 'ext'. You can also use 'read' and 'command'.

61\define@key{Gin}{type}{%

62\def\Ginclude@graphics##1{%

63\begingroup

64\def\Gin@base{##1}%

66\expandafter\Gin@setfile\@tempa

67\endgroup}}

\KV@Gin@extSpecify an extension, for use with the 'type' key.

69\let\Gin@eext\@empty

\KV@Gin@readSpecify a read ifile, for use with the 'type' key. You may want to globally set this to*using\setkeys.*means read the graphic ifile for size info, as in \DeclareGraphicsRule.

70\define@key{Gin}{read}{%

71\def\Gin@eread{#1}%

73\let\Gin@eread\@empty

\KV@Gin@commandSpecify a command, for use with the 'type' key.

75\let\Gin@ecom\@firstofone

6 \KV@Gin@decodearrayFor manipulating bitmap images.

76\define@key{Gin}{decodearray}{%

77\def\Gin@decode{#1}%

78}
\KV@Gin@quietSkip writing to the log.

79\define@key{Gin}{quiet}[]{%

80\let\Gin@log\@gobble

81}
\KV@Gin@pagePage of a multi-page (PDF) graphic.

82\define@key{Gin}{page}{%

83\def\Gin@page{#1}%

84\ifx\Gin@page\@empty

85\else

86\edef\Gin@page{\number\Gin@page}%

87\fi
88}
\KV@Gin@interpolateEnable/disable interpolation of bitmap images by the viewer.

89\define@key{Gin}{interpolate}[true]{%

\KV@Gin@pageboxSpecify which PDF box to use for the natural image size in PDF inclusions.

91\define@key{Gin}{pagebox}{%

93\csname Gin@pagebox@#1\endcsname

94\ifx\Gin@pagebox\relax

95\let\Gin@pagebox\Gin@pagebox@cropbox

96\@warning{%

97Unknown value '#1' for 'pagebox'.\MessageBreak

98Supported values:\MessageBreak

99mediabox, cropbox, bleedbox, trimbox, artbox%

100}%

101\fi

102}

103\def\Gin@pagebox@mediabox{mediabox}%

104\def\Gin@pagebox@cropbox{cropbox}%

105\def\Gin@pagebox@bleedbox{bleedbox}%

106\def\Gin@pagebox@trimbox{trimbox}%

107\def\Gin@pagebox@artbox{artbox}%

\KV@Gin@altBy default thealtkey does nothing but may be used for alternative text for accessibility uses in extensions.

108\define@key{Gin}{alt}{}

\Gin@boolkeyHelper function for deifining boolean valued functions. The order of arguments allows\lowercaseto only act on the user-supplied argument.

109\def\Gin@boolkey#1#2{%

110\csname Gin@#2\ifx\relax#1\relax true\else#1\fi\endcsname}

\Gin@esetsizeArrange for the ifinal size to be set, either by wrapping the include graphics call in\scalebox, or by redeifining\Gin@req@sizesappropriately. 7

111\def\Gin@eresize{\height}

112\def\Gin@esetsize{%

113\let\@tempa\Gin@exclamation

114\if@tempswa

External. Wrap the\includegraphicscommand in a call to the internal form of \scaleboxto handle the rotation.

115\edef\@tempa{\toks@{\noexpand

116\Gscale@@box\noexpand\Gin@eresize

118\@tempa

119\else

Internal. Handle scaling with the\includegraphicscommand directly rather than calling\scalebox.

120\ifx\Gin@ewidth\@tempa

121\ifx\Gin@eheight\@tempa

No resizing.

122\else

Just height speciified.

123\let\Gin@@eheight\Gin@eheight

124\def\Gin@req@sizes{%

126\let\Gin@scalex\Gin@exclamation

129\fi

130\else

131\ifx\Gin@eheight\@tempa

Just width speciified.

132\let\Gin@@ewidth\Gin@ewidth

133\def\Gin@req@sizes{%

135\let\Gin@scaley\Gin@exclamation

136\setlength\Gin@req@width\Gin@@ewidth

138\else

Both height and width speciified.

139\let\Gin@@ewidth\Gin@ewidth

140\let\Gin@@eheight\Gin@eheight

At this point can locally redeifine\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 ofheightandwidthunless the natural size was known as otherwise L ATEX can not calculate the scale factor. However many drivers (especially for bitmap formats) can work this out themselves, so as long as both heightandwidthare given, so LATEX knows the size to leave, accept this. This assumes the code in the driver ifile will use the 'required height' information, not the scale factors, which will be set to 1!.quotesdbs_dbs13.pdfusesText_19