; TeX output 1996.03.06:1231soODtGGcmr17The7tGGcmss17sub gurepacqkage!", cmsy10XQ cmr12StevrenDouglasCoSchranfВDigitalMappingLabSoratoryV,ScrhoolofComputerScience}aCarnegie-MellonUnivrersityV,5000ForbSesAvrenueyPittsburgh,PVA15213{3891,USA/߆T cmtt12sdc+@cs.cmu.eduZ37 1995/03/06.!Kt : cmbx9Abstractэbo cmr9This̓articledoAcumen9tstheL5Aacmr6A TuAEXpack|rage`!ow cmss9sub gure',cwhichprovidessup- bpAort-fortheinclusionofsmall,8c`sub', gures-andtables.Itsimpli esthebpAositioning,.captioningandlabelingofsuc9hobjectswithinasingle gurebortableen9vironment.9Inaddition,!thispac9k|rageallowssuchsub-captionstobbAewrittentoaList-of-FiguresorList-of-T:ablesifdesired.׌The`sub gure'bpac9k|ragealsocoAoperateswiththe`caption'pack|ragebyH.A.Sommerfeldt[1]band.shouldbAecompatiblewithallotherpac9k|ragesthatmodifyorextendtheb oatTen9vironment.!čI#Nff cmbx121aLIntros3ductionIK`y cmr10ThispackqageprovidessuppGortforthemanipulationandreferenceofsmallor`sub' I guresiandtableswithinasingle gureortableenvironment.^ٓRcmr71AItiisconvenientitoIuseQ^thispackqagewhenyoursub guresaretobGeseparatelycaptioned,R)referenced,IorUUwhosecaptionsaretobGeincludedintheList-of-Figures.XIf;yousimplywanttocenteryour gure,(sthenuse$ "5-:1LAdditionalX oatenÎvironmentsXmaybIffbEfdͤ ff*fdOption ffҏ^Description] ffffbE͟ fffdnormaltd+ ffzʑProvidesUU`normal'captions,thisisthedefault.bş ffffbE͟fffdhangtd+ffzʑCausesH+thelabGeltobeahangingindentationtothe zʑcaptionUUparagraph.bşffffbE͟fffdcentertd+ffzʑCauses1eachlineoftheparagraphtobGeseparately zʑcentered.bşffffbE͟ fffdcenterlasttd+ ffzʑCausesUUthelastlineonlytobGecentered.bş ffffbE͟$fffdnoonelinetd+$ffzʑIfV)acaption tsononelineitwill,^bydefault,bGe zʑcentered.gThisu5optionleft-justi estheonelinecap-zʑtion.bş$ffffbE͟ fffdscriptsize,UU...,Largetd+ ffzʑSetsUUthefontsizeofthecaptions.bş ffffbE͟fffdup,?it,sl,sc,md, bf, rm,?sfortttd+ffzʑSetsUUthefontattributesofthecaptionlabGels.bşffffbEIWithinܗafigureortableenvironment,>gyouܗcanusethefollowingmacrosto Icreateګasub gureorsubtable\bGox"withanoptionalcaptionunderafigure.IThe*figureiscenteredwith\subfigtopskipofverticalspaceaddedabGove.TFIfIthereuisacaption,}then\subfigcapskipverticalspaceisaddedbGelowthefigureIfolloweddqbythecaption.Finally*,h7\subfigbottomskipofverticalspaceaddedatItheUUbGottom.b\subfigure[hc}'aptionci'b]{h gur}'e[i lg}b\subtable[hc}'aptionci'b]{h gur}'e[i lg}XThe{resulting\bGox"ismadesuchthatitsbaselineisatthebGottomoftheIfigure pGortion. Therefore,nomatterhowtallthe guresand/orlongthecap-Itions,UUadjacentsub guresarealignedatthebGottomoftheirrespective gures.XIfacaptionisgiven(includingthenullcaption`[g]')thenthesub gureisIlabGeledwithacounterformattedbythemacro`\thesubfigure'whichreturns,FbyIdefault,`(a)',`(b)',etc.JIf߇desired,thismacromaybGerede ned.JThecounterusedIforlabGelingthesub guresissubfigureandisincrementedforeachsub gureIregardlessofwhetheracaptionwasprinted.JTheinternalsofthe\subtableImacroUUaresymmetrictothoseofthe\subfiguremacro,describGedabove.2 soXIfyouwishtoreferenceaspGeci csub gureorsubtable,youcanincludea I\labelʲinsidethebGodyofeitherargumenttothemacro,gwiththefigureargu-ImentXbGeingthepreferred.{VIfsupplied,YQthe'- cmcsc10captionisa\movingargument"and,Itherefore,UUany\fragile"commandscontainedwithinitmustbGe\protect'ed.XOne՜ nalnote,thesemacrosareactuallyidenticalanditistheenvironmentIthat1de neswhetherasubtableorsubfigurewillbGegeneratedandnotwhichImacrovisused.*Attheuserlevel,~thechoiceofnamesispurelycosmetic(andIhistorical).!čI3aLExamplesIThe`3easiestway`3toexplaintheuseofthispackqageistogivesomeexamples.bTheI rst?example,D-showninFigure2,spGeci es\centeringanduses\\tocontroltheIplacementT+ofthesub gures.qdNotethatthealignmentofthetoptwosub guresisIalongUUthebGottomofthe gureportionofeach.{Bz\`ffG@ff\;*ոff8ϟ))ffff8)ffffff8ώF*(a)XFirstff8ϟffff8ffffff8ώ:(b)Second :FigureR fff8ϟffff8ffffff8ώp*(c)XThird3ǍEFigureUU2:qThreesub gures.FigureUU2containstwotop`sub gures'andFigure2(c).ztffffffG@zፑW,\newcommand{\goodgap}{% `\hspace{\subfigtopskip}%`\hspace{\subfigbottomskip}}W,...W,\begin{figure}%`\centering`\subfigure[First]{...}\goodgap`\subfigure[SecondFigure]{...}\\`\subfigure[Third]{\label{3figs-c}...}%`\caption{Threesubfigures.}`\label{3figs}W,\end{figure}W,...W,Figure~\ref{3figs}containstwotop`subfigures'andW,Figure~\ref{3figs-c}.3soIA.second\example,3showninFigure3,istochangethewaythatthesub gures Iare|olabGeledandtohave|othesub gurecaptionsprintedinthelist-of- gures.HereIthenalignmentofthe guresisaccomplishedbysurroundingtheminacenterIenvironment.Jזz\`ffG@ĝĝff&8R]ոff;3))ffff:g)ffffff;3C3.1: Firstոff;3))ffff:g)ffffff;3x3.2: Second1ǍI$PFigureUU3:qTwosub gures.SeeUUsub gures3.1and3.2.ztĝffffffG@LW,\renewcommand{\thesubfigure}{\thefigure.\arabic{subfigure}} W,\makeatletter`\renewcommand{\@thesubfigure}{\thesubfigure:\space}`\renewcommand{\p@subfigure}{}W,\makeatotherW,...W,\setcounter{lofdepth}{2}W,\listoffiguresW,...W,\begin{figure}%`\begin{center}%j\subfigure[First]{%sF\label{fig:first}%sF...}%j\goodgapj\subfigure[Second]{%sF\label{fig:second}%sF...}%`\end{center}`\caption{Twosubfigures.}W,\end{figure}W,...W,Seesubfigures~\ref{fig:first}and\ref{fig:second}. cI4aLCustomizationIThenfollowingsectionsdescribGetheinternalparametersusedbythe(m#R cmss10sub gurepack- Iage4tode nethelayout4ofthesub- guresortables,:aswellasthelabGelsandcap-Itionsxtheaccompanythem.Inaddition,adjustmentstotheentriesona\list-of"IpageUUandtheadditionofnew oatenvironmentsUUisdescribGed.PlI)N cmbx124.1gChangingthelayoutuTIThedlayoutofthesubfigureorsubtableisde nedbyseveralinternalvqaluesIwhichҖmaybGechangedtocustomizeappGearanceoftheob8ject.Thefollowing4"soIillustrationUUshowstherelationshipofthesevqalues.LW{fZffE7 z3Lz3LfffZu cmex10x?y;\subfigtopskip4ffffE7 ,34,34ffffٍ|5figureUUortUTable4&(Baseline)Dj>,34ffffffE7 x?y;\subfigcapskip_+ ̈́LD433! 0\subfigcapmargin\"ffff%3434ffffǍ2&{captionXI34ffffff%_+ 0ϟ̈́LD433! @\subfigcapmarginx?y;\subfigbottomskipDj>z3LffffffE7 RPፍI4.2gAdjustingthelab`elandcaptionuTITheMlabGelofthesub gurehastwoMforms.oMThe rstistheonethatappearsinthe Itextwwhenyouusethe\refmacroandthesecondistheonethatappGearsunderItheUUsub gureaspartofthecaption.XThe<\refcommandyieldsastringcompGosedbyconcatenatingthevqalueofI\p@subfigure+to\thesubfigure.7dBydefaultthesearede nedby:2\\thefigure"Iand\(\alph{subfigure}),"respGectively*,whichproGducesareferenceoftheI gurenumbGerfollowedbythesub gureletterinparentheses.MThelabGelIunderCthesub gureisgeneratedby\@thesubfigure.BydefaultthisisI\{\subcaplabelfont\thesubfigure}\space}." -Note]the\subcaplabelfontIvqalue.GThisstartsoutasanullvalueorifoneofthefontattributeoptionsareIgiven޽itissettothatvqalue.IfyouupGdatethe\@subfiguremacro,youshouldIincludeUUthe\subcaplabelfont.XFinally*,thetextofbGoththelabelandcaptionarepre xedby\subcapsize,Iwhichdefaultsto\footnotesizeandmaybGechangedusingthesixfontsizeIoptions.XOne]sotherway]sofchangingthelayoutofthelapGelandcaptionisbyreplacingItheD\@makesubfigurecaptionmacrowhichbGothappliesthefontsizeoptionandItheUU vecaptionshapGeoptions.qEachsub oattypGemaybGede nedindividually*.XThe2[subtablelabGelandcaptionaresymmetrictothatofthesub gurede nedIabGove.I4.3gMo`difyingthe\List-Of:"pageinformationIT*o generatea\list-of"pagefora oatenvironment,}you needtoaddaI\listoffiguresor\listoftablescommandwhereyouwantthelisttoappGear.IThiscommandalsocausestheappropriatecaptionsandsubGcaptionstobewrittenItoeTa lewiththeextensionsloforlotrespGectively*.Ifyouwantthesub-captionItextItoappGearinthe\list-of"page,LyouneedtochangethevqalueofthecountersIlofdepth orlotdepthcountersfromtheirdefaultof`1'.F*orexample,8etohaveItheʓsubfiguresub-captionstoappGearonthe\list-of- gures,"addthefollowingItoUUthepreambleofyourpapGer:mb\setcounter{hsub gur}'e[i.z}{h2[i>}XIfLyouwanttochangehowthesub-captionappGearsonthe\list-of"pagesyou Icanchangeitsformatbyrede ningthe\l@subfiguremacro.Usuallyyouwill5*נsoIwant5tousethe\@dottedxxxlinemacro(section5.7,page14)tohelpwiththe Iformatting.qF*orUUinstancethedefaultvqalueof\l@subfigureis:W,\newcommand{\l@subfigure}{% `\@dottedxxxline{\ext@subfigure}{2}{3.9em}{2.3em}}IT*oURchangetheamountofspacereservedforthelabGel(if,USforinstance,youhaveaIlotUUof gures)youcouldwidenthe2.3emspaceforthelabGelto3.1em:W,\newcommand{\l@subfigure}{%`\@dottedxxxline{\ext@subfigure}{2}{3.9em}{3.1em}}XTheUUargumentsofthe\@dottedxxxlinemacroare:k81.xT*ypGexfex排x._Heretheseare,)bydefault,loforlot._Theinternalvqaluesx\ext@subfigure8and\ext@subtablestandfortheseextensions.k82.xLevelxfeN;N=. ByNdefaultthisis`2'forthesubfigureandsubtable.xIf!thelevelisgreaterthan\c@typGedepth(wheretypGefeW7isthe rstxargumentUUvqalue),thennolineproGduced.k83.xIndentxfeUXUZ.qT*otalUUindentationfromtheleftmargin.k84.xNumwidthxfe+\x\z.IfwewantedtoIhave osub-maps,7thenwecouldde nethefollowing(ontheassumptionthattheIde nitionUUof\ext@mapis\lom"):W,\makeatletter `\newcounter{submap}[map]`\newcommand{\thesubfigure}{(\alph{submap})}`\newcommand{\@thesubmap}{{\subcaplabelfont\thesubmap}\space}`\newcommand{\p@submap}{\themap}`\newcommand{\ext@submap}{\ext@map}`\newcommand{\l@submap}{\@dottedxxxline{\ext@submap}{2}{3.9em}{2.3em}}`\newcounter{lomdepth}`\setcounter{lomdepth}{1}`\newcommand{\submap}{\subfigure}`\newcommand{\@makesubmapcaption}{\@makesubfigurecaption}W,\makeatother69=soI4.5gInteractionwithotherpartsofLAl#*2@cmbx8A~/TESXuTIIn{thefollowingsections,)stheinteractionofthesub gurepackqagewithotherparts Iof[L5ffA͉TU>'ExXisdoGcumented. These\otherparts"maybGeeitherpartofthetheL5ffA͉TU>'ExXIbaseUUorcontributedpackqagesorclasses.6I+"V cmbx104.5.1l#T<8E3sX'sT\mouth"IThexHmostimpGortantthingtoremembGerwhenlayingoutyour gureswithinaI oatenvironmentisthatspacestakeroGom.IfyouhaveanextraspacebGetweenItwo"1 gures,,lthentheywillbGeseparatedbyalittlebit.`IfyoubGeginalinewithanIextraUUspace,thenyour guresmaynotbGecenteredcorrectly*.XTU>'ExX'sl>statevqariesasitreadsalineoftextfroma le.ItignoressomespacesIand{carrage-returnsandconverts{othersto\space'sor\par's.)?Y*oucanusea`%'toIinsurethatyouonlyhaverealspaceswhereyouwantthem.TT*ounderstandwhichIspacesaresigni cant,youshouldreadchapter8oftheTU>'ExXbGook[2].CHowever,theImainsourceofunexpGectedextraspacingiscarrage-returnswhichareturnedintoI\space's.T*ake}aloGokattheexamplesinsection3foranexample.AsageneralIrule:]0if,'indoubt,4cthenadda`%'immediatelyafterthelastsigni cantcharacterofItheUUline.6I4.5.2l#TheT oaten9vironmentsIAlthoughthesub gurepackqagewasdesignedtoworkwithina oatenvironmentI(e.g.qfigure),UUitcanbGeusedoutsidewiththefollowingtwocaveats:U81.bY*ou;2needtode ne\@captype.iThisisusuallyeither\figure"or\table."bF*orUUexample:y\makeatletter \def\@captype{figure}y\makeatotherU82.bIf"youwanttode nereferencesusing\label,,thenyouneedtorede nethe bL5ffA͉TU>'ExXUUinternal\@currentlabel.qF*orexample:y\makeatletter\edef\@currentlabel{\p@subfigure\thesubfigure}y\makeatother6I4.5.3l#TheTcaptionpac9k\rageuTITheJonlypackqagethatinteractswiththesub gurepackqageisthecaptionpackqage Iby9byH.A.Sommerfeldt[1].h[Ifyouloadthesub gurepackqagebQeforethecaptionIpackqage,thenitwilldetectthatfactandwillchangethe\subcapsizewhentheIoptionsqscriptsize,x...,largeqɲarespGeci ed(overridingqsuchoptionsusedwhenIloadingthesub gurepackqage). @|Inaddition,V itrede nes\@thesubfigureandI\@thesubtableUUtouse\captionlabelfontratherthan\subcaplabelfont.XIfwyoudon'twantthisbGehavior,"thenyoumustloadthesub gurepackqageIafterUUthecaptionpackqage.7ERsoI4.5.4l#CreatingTasub gureen9vironmentuTISome8pGeoplehave8wantedtousetheverbatimenvironnmentwithinthe\subfigure Imacro(andrunintotherestrictionthattheverbatimenvironmentcannotbGeInested.,T*oincludeverbatimtextinasub gure,youcande neanewenvironment,IinUUwhichverbatimtextmaybGeenclosed,andwhichcallsthe\subfiguremacro.*W,\newbox\subfigbox W,\makeatletter`\newenvironment{subfloat}j{\def\caption##1{\gdef\subcapsave{\relax##1}}%n̰\let\subcapsave\@emptyn̰\setbox\subfigbox\hboxx?\bgroup}sF{\egroupn̰\subfigure[\subcapsave]{\box\subfigbox}}W,\makeatother *IThisenvironmentmaybGeusedsomethinglikethefollowing(butnotethatyou IwillUUneedtosupplythewidthoftheverbatimsectionusingaminipage).=b\begin{figure}l\begin{center}%v\begin{subfloat}%\begin{minipage}{2.1in}\begin{verbatim}qThis?text shouldbebverbatim.?Andnotg?messed?withinanyway !\end{verbatim}\end{minipage}%\caption{First?subcaption.}%v\end{subfloat}%v\goodgapv\begin{subfloat}%\begin{minipage}{2.1in}\begin{verbatim}lThis?text(also)shouldbebverbatim.?Andnotg?messed?withinanyway !\end{verbatim}\end{minipage}%\caption{Second?subcaption.}%v\end{subfloat}l\end{center}l\caption{This?isanexampleofverbatimtextinasubfigure.}b\end{figure} ӍI5aLTheffcos3deI5.1gIdenti cation8 RsoLs1S\ifx\if@compatibility\undefined\else Ls2]\NeedsTeXFormat{LaTeX2e}Ls3]\ProvidesPackage{subfigure}[1995/03/06v2.0subfigurepackage]Ls4]\typeout{Package:subfigure1995/03/06v2.0}Ls5S\fi6I5.2gInitializationandSharedconstantsuT 6\if@subcaphang \if@subcapcenter Ʋ\if@subcapcenterlast H\if@subcapnoonelineITheseJfour agscontrolhowthestyleinwhichthesub oatlabGelandcaptionare Iprinted.Ls6S\newif\ifsubcaphangLs7S\newif\ifsubcapcenterLs8S\newif\ifsubcapcenterlastLs9S\newif\ifsubcapnoonelineIThe/followingtablegivestheinitial(default)vqaluesoftheinternalsthatareusedItoUUcontroltheplacementandprintingofthesub oats.^2w _ILΉffbLfdͤ ff'$fdMacro ff~Default~ ffDescription7 ffffbLͤ$ff ͟fd\subfigtopskipġ$fffԲ10pt!sԟ$ff˿Length'fromthetopofthesub-˿ oat'LbGoxtothebeginingofthe˿figure.b$ffffbLͤ$ff ͟fd\subfigbottomskip$fffԲ10pt!sԟ$ff˿LengthfromthebGottomofthe˿captiontothebGottomofthe˿sub oat.b$ffffbLͤ$ff ͟fd\subfigcapskipġ$fffԲ10pt!sԟ$ff˿LengthfromthebGottomofthe˿figureftothebGeginingofthe˿caption.b$ffffbLͤ$ff ͟fd\subfigcapmarginLʡ$fffԲ10pt!sԟ$ff˿Indentation5ofthecaptionfrom˿thesidesofthesub oatbGox˿(ThisshouldalwaysbGepositive).b$ffffbLͤff ͟fd\subcapsize(fft\footnotesize ͟ff˿SizeforthetextpGortioncaption˿font.bffffbLͤff ͟fd\subcaplabelfontLʡffLsff˿F*ontforthelabGelportionofthe˿caption.bffffbLvYI10S\newcommand{\subfigtopskip}{10pt}I11S\newcommand{\subfigbottomskip}{10pt}I12S\newcommand{\subfigcapskip}{10pt}I13S\newcommand{\subfigcapmargin}{10pt}I14S\newcommand{\subcapsize}{}I15S\newcommand{\subcaplabelfont}{}6I5.3gSub gureconstantsuTb\c@subfigureISub gureUUcounter.I16S\newcounter{subfigure}[figure]\thesubfigure 6\@thesubfigureb\p@subfigureIThese8de netheformthatthesub-captionpre xisgenerated.The\thesubfigureImacro de nesthebasiclabGelfortextreferences(pre xedby\p@subfigure),whileIfffr J= "5-:2LTheX,Cscmtt8\subcapsizevalueisinitializedinsection5.5.1alongwiththecaption ags.9 YɠsoIthe\@thesubfiguremacrode neswhatappGearsunderthesub gure. Inthe Icaseofacon ictbGetweenthispackqageandaprioroneoverthede nitionofI\thesubfigure,UUthispackqagewillwin.I17S\def\thesubfigure{(\alph{subfigure})} I18S\newcommand{\@thesubfigure}{{\subcaplabelfont\thesubfigure}\space}I19S\let\p@subfigure\thefigure 6\ext@subfigure b\l@subfigure L\c@lofdepthIThesede nehowandifthesub gurecaptionwillappGearinalist-of- gures le. I\ext@subfigureͲde nesthedefaultsub gure leextension(whichisthesameasI\ext@figure ɲ|thelist-of- gures le).Y\l@subfigureshowshowtoprintanlofIsub gure[lineandde nesthatlineatleveltwo.\c@lofdepthisanextensionofItheERtable-of-contentsdepthvqalueandcontrolsthedepthtowhichcaptionsintheI leUUareprintedtotheactualpage.qBydefault,thesub-captionsarenotprinted.I20S\let\ext@subfigure\ext@figureI21S\newcommand{\l@subfigure}{% I22]\@dottedxxxline{\ext@subfigure}{2}{3.9em}{2.3em}}I23S\newcounter{lofdepth}I24S\setcounter{lofdepth}{1}6I5.4gSubtableconstantsuT L\c@subtableISubtableUUcounter.I25S\newcounter{subtable}[table]b\thesubtable \@thesubtable L\p@subtableIThesede netheformthatthesub-captionpre xisgenerated.2=The\thesubtable Imacro}de nesthebasiclabGelfortextreferences(pre xedby\p@subtable), whileIther\@thesubtablemacrode neswhatappGearsunderthesubtable. ʭIntheIcaseofacon ictbGetweenthispackqageandaprioroneoverthede nitionofI\thesubtable,UUthispackqagewillwin.I26S\def\thesubtable{(\alph{subtable})} I27S\newcommand{\@thesubtable}{{\subcaplabelfont\thesubtable}\space}I28S\let\p@subtable\thetable\ext@subtable L\l@subtable L\c@lotdepthIThese Cde nehowandifthesubtablecaptionwillappGearinalist-of-tables le. I\ext@subtableFde nesthedefaultsubtable leextension(whichisthesameasI\ext@table"z|thelist-of-tables le).6\l@subtableshowshowtoprintanlotIsubtable'ExX2.09(thenwejust IsetUUthedefaultsandleaveUUittotheusertosetanyoptionsinthepreamble.퍍I34S\ifx\if@compatibility\undefined I35]\subcaphangfalseI36]\subcapcenterfalseI37]\subcapcenterlastfalseI38]\def\subcapsize{\footnotesize}I39S\else퍑IThe?followingoptionsallowcompatibilitywiththecaptionpackqagebyH.A.Som-Imerfeldtз[1].EThereare vedi erentsub-captionoptionssuppGorted:/xnormal,>hangI(orisu),center,centerlast(oranne)andnooneline.ۭThehangsub-captionImaybGecombinedwiththecenterorcenterlastoptions.JpThenoonelinemayIbGe|2combinedwithanyoftheotheroptions(butit'se ectisnegatedbyeitherofIcenterUUorcenterlastunlessthehangoptionisalsoused).퍍I40]\DeclareOption{normal}{%I41f\subcaphangfalseI42f\subcapcenterfalseI43f\subcapcenterlastfalseI44f\subcapnoonelinefalse}I45]\DeclareOption{hang}{\subcaphangtrue}I46]\DeclareOption{center}{\subcapcentertrue}I47]\DeclareOption{centerlast}{\subcapcenterlasttrue}I48]\DeclareOption{nooneline}{\subcapnoonelinetrue}I49]\DeclareOption{isu}{\ExecuteOption{hang}}I50]\DeclareOption{anne}{\ExecuteOption{centerlast}}퍑IThereUUareoptionsforsixdi erentfontsizesavqailable.I51]\DeclareOption{scriptsize}{\renewcommand{\subcapsize}{\scriptsize}}I52]\DeclareOption{footnotesize}{\renewcommand{\subcapsize}{\footnotesize}}I53]\DeclareOption{small}{\renewcommand{\subcapsize}{\small}}I54]\DeclareOption{normalsize}{\renewcommand{\subcapsize}{\normalsize}}I55]\DeclareOption{large}{\renewcommand{\subcapsize}{\large}}I56]\DeclareOption{Large}{\renewcommand{\subcapsize}{\Large}}퍑IThereIarenineoptionsavqailabletosetthefontattributesofthesub-captionlabGels.I57]\DeclareOption{up}{\renewcommand{\subcaplabelfont}{\upshape}}I58]\DeclareOption{it}{\renewcommand{\subcaplabelfont}{\itshape}}I59]\DeclareOption{sl}{\renewcommand{\subcaplabelfont}{\slshape}}I60]\DeclareOption{sc}{\renewcommand{\subcaplabelfont}{\scshape}}I61]\DeclareOption{md}{\renewcommand{\subcaplabelfont}{\mdseries}}I62]\DeclareOption{bf}{\renewcommand{\subcaplabelfont}{\bfseries}}I63]\DeclareOption{rm}{\renewcommand{\subcaplabelfont}{\rmfamily}}I64]\DeclareOption{sf}{\renewcommand{\subcaplabelfont}{\sffamily}}I65]\DeclareOption{tt}{\renewcommand{\subcaplabelfont}{\ttfamily}}I5.5.1l#ExecutionTofoptionsuTIThenormaltypGeofsub-captionispreselectedandthestandardsub-captionsize IisUUsetto\footnotesize. I66]\ExecuteOptions{normal,footnotesize}11 sesoI67]\ProcessOptions I68S\fi6I5.6gThesub gure/subtableb`odyuT\subfigure $\subtableIThese,macrosactascover,functionsforthe\@subfloatmacro.d/Theyinsurethat ItheMRpropGercounterisusedandhasthecorrectvqalue.oSincethecaptionisusuallyIgeneratedmlater,wemustloGcallyanticipatethefuturevqalueofitscounterbyaddingIone toitwithinaloGcalgroup.? Uponleavingthe\subfigureor\subtablemacro,ItheUUoldvqalueisrestored.I69S\newcommand{\subfigure}{%I70]\bgroupI71f\advance\csnamec@\@captype\endcsname\@neI72f\refstepcounter{sub\@captype}%I73f\leavevmodeI74f\@ifnextchar[%I75p2{\@subfloat{sub\@captype}}%I76p2{\@subfloat{sub\@captype}[\@empty]}}I77S\let\subtable\subfigure\@subfloatIThis.isthecommoncoGdeforsettingupthesub oatboxanddrawingthesub- Icaption5Runderit.gIt rstdetermineswidthofthe gureortablebyplacingitinaIbGox.lThisFboxFiscombinedwiththetopmargin(\subfigtopskip)andplacedasItheaheightpGortionoftheoutput\vbox."ThedepthofthisboxisdeterminedbyItheՃexistenceofasub-caption.G,Ifoneexists,thenthedepthismadeupofthesub-Icaption]spacing(\subfigcapskip),^theheight+depthofthesub-captionandtheIbGottommargin(\subfigbottomskip).U;Ifnosub-captionexists,thenthedepthofItheUUoutput\vbox"isjustthebGottommargin(seetheillustrationinsection4.1).XThed rstargumentisthetypGeofob8jectbeinggenerated:IOthatis,asubfigureIorYasubtable.ThesecondandthirdarethecaptionandfigureargumentsIfromUUthecalling\subfigureor\subtablecommand.I78S\def\@subfloat#1[#2]#3{%I79f\setbox\@tempboxa\hbox{#3}%I80f\@tempdima=\wd\@tempboxaI81f\vtop{%I82p2\vbox{I83yw^\vskip\subfigtopskipI84yw^\box\@tempboxa}%I85p2\ifx\@empty#2\relax\elseI86yw^\vskip\subfigcapskipI87yw^\@subcaption{#1}{#2}%I88p2\fiI89p2\vskip\subfigbottomskip}%I90]\egroup}H\@subfigcaptionlistb\@subcaptionIThekfollowingseriesofmacroscontrolexactlyhowthesub-captionistypGeset.DTheI\@subcaption macroaddsthesub-captiontothecurrentlistofsub-captionstobGeIaddedo\@tempdimbE113~0\subfig@caption{#1}{#2}%E114p2\else\ifsubcapnoonelineE115~0\subfig@caption{#1}{#2}%E116p2\elseE117yw^\box\@tempboxaE118p2\fi\fiE119p2\hfil}}E120S\let\@makesubtablecaption\@makesubfigurecaptionf\subfig@caption 9\subfig@captionparIThese macrosarecalledtotypGesetamultiple-linesub-caption(orasingle Ilinewhensubcapnoonelineistrue). TDepGendingonthesubcapcenterandIsubcapcenterlast8 ags,qthetextwillbGejusti ed(bothfalse),qcentered(subcapcenterItrue),-Sor#Rjusti edwiththelastlinecentered(onlythe agsubcapcenterlastsetItrue).E121S\newcommand{\subfig@caption}[2]{% E122]\ifsubcaphangE123f\sbox{\@tempboxa}{%13soE124p2\subcapsize E125p2\ignorespaces#1}%E126f\addtolength{\@tempdimb}{-\wd\@tempboxa}%E127f\usebox{\@tempboxa}%E128f\subfig@captionpar{\@tempdimb}{#2}%E129]\elseE130f\subfig@captionpar{\@tempdimb}{#1#2}%E131]\fi}0E132S\newcommand{\subfig@captionpar}[2]{%E133]\parbox[t]{#1}{%E134f\strutE135f\ifsubcapcenterE136p2\setlength{\leftskip}{\@flushglue}%E137p2\setlength{\rightskip}{\@flushglue}%E138p2\setlength{\parfillskip}{\z@skip}%E139f\else\ifsubcapcenterlastE140p2\addtolength{\leftskip}{0ptplus1fil}%E141p2\addtolength{\rightskip}{0ptplus-1fil}%E142p2\setlength{\parfillskip}{0ptplus2fil}%E143f\fi\fiE144f\subcapsizeE145f\ignorespaces#2%E146f\par}}6I5.7gPatchestothestandardenvironmentuTIThe]followingadjustthestandardenvironmentforthe\subfigureand\subtable Imacros.TheyaredesignedaswrappGerstothecurrentde nitionofthestandardIcommandsUUtominimizeanychanceofcon ictwithotherpackqages.Hۍf\@dottedxxxlineIThisisageneralizedwrappGerforthe\@dottedtoclinemacro.-9ItchecksfortheIlevel7basedontheoutput le( rstargument)andnotusingonly\@tocdepth.I(SeeUUsection4.3foradescriptionofthearguments.)E147S\newcommand{\@dottedxxxline}[6]{% E148]\ifnum#2>\@nameuse{c@#1depth}\elseE149f\@dottedtocline{0}{#3}{#4}{#5}{#6}E150]\fi}Hۍ9\subfig@oldcaption $\@captionINext,JEweGrede nethecurrent\@captionmacrotodumpanysub-captionssaved. IFirstthe`old'captionmacroiscalledtoaddthelinetothelist-of leandthenIthelistofsub-captions,\@subfigcaptionlistiswrittentothesame le.ZLastly*,ItheUU\@subfigcaptionlistisreinitialized.E151S\let\subfig@oldcaption\@captionE152S\long\def\@caption#1[#2]#3{% E153]\subfig@oldcaption{#1}[{#2}]{#3}%E154]\@for\@tempa:=\@subfigcaptionlist\do{%E155f\ifx\@empty\@tempa\relax\elseE156p2\addcontentslineE157yw^{\@nameuse{ext@sub#1}}%E158yw^{sub#1}%E159yw^{\@tempa}%E160f\fi}%E161]\gdef\@subfigcaptionlist{}}14asoIReferencesI[1]X;HaraldUUAxelSommerfeldt,Thecaptionp}'ackage,UU1995/01/30.I[2]X;Donald+ErvinKnuth, gThe@TKß'E-Xb}'ook,Addison-W*esley,Reading,Massachusetts, X;1986.15;,Cscmtt8+"V cmbx10*2@cmbx8)N cmbx12(m#R cmss10'- cmcsc10&': cmti10%ߤN cmtt9$