Example: dental hygienist

The caption package - CTEX

Thecaptionpackage Harald Axel provides many ways to customise the captions infloating environments suchfigureandtable. The\rotcaptioncommandand thesidewaysfigureandsidewaystableenviron ments provided by therotatingpackage from S. Rahtz and L. Barroca are also supported. Thecaptionpackage also cooperates with thefloatpackage written by A. Lingnauand thesubfigurepackage written by The user interfaceTo use this package just type\usepackage[ options ]{ caption }in the preamble of your document, where the following options are supported:normalprovides normal captions, this is the de-faulthangorisuprovides captions with hanging indentioncenterprovides captions where each line is centeredcenterlastprovides captions where the last line of theparagraph is centerednoonelineif a caption fits ononeline on the page,it will be centered.

Figure 1: This is an example caption with a small font and a sans serif label. The hang option was used. There is a left and right margin of 20pt. 3 The code 3.1 Identification 1 \NeedsTeXFormat{LaTeX2e}[1994/06/01] 2 \ProvidesPackage{caption}[1995/04/05 v1.4b caption package (HS)] 3 \typeout{Package: caption v1.4b <1995/04/05> (Harald ...

Tags:

  Caption

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of The caption package - CTEX

1 Thecaptionpackage Harald Axel provides many ways to customise the captions infloating environments suchfigureandtable. The\rotcaptioncommandand thesidewaysfigureandsidewaystableenviron ments provided by therotatingpackage from S. Rahtz and L. Barroca are also supported. Thecaptionpackage also cooperates with thefloatpackage written by A. Lingnauand thesubfigurepackage written by The user interfaceTo use this package just type\usepackage[ options ]{ caption }in the preamble of your document, where the following options are supported:normalprovides normal captions, this is the de-faulthangorisuprovides captions with hanging indentioncenterprovides captions where each line is centeredcenterlastprovides captions where the last line of theparagraph is centerednoonelineif a caption fits ononeline on the page,it will be centered.

2 If you don t like thisbehaviour, just select this , .. ,Largesets the font size of the captionsup,it,sl,sc,md,bf,rm,sf, orttsets the font attribute of the caption ruled floats of thefloatpackage, seesection for detailsTo setup the font size and attributes of the captions, this package also provides\captionfont\captionlabelfont This package has version number , last revised 1995/04 commands\captionfontand\captionlabelfont to allow a more flexibleway to customize the captions than the above options could do.\captionfontiscalled before each caption ,\captionlabelfontis called just before the label ofthe caption , so the whole caption will be created as{\captionfont{\captionlabelfont label : } caption }.Note that these commands are used by the options, the optionssmallandsfare identical to\renewcommand{\captionfont}{\small}and \renewcommand{\captionlabelfont}{\sffami ly}.

3 Furthermore there is a new length\captionmarginto setup an extra left and\captionmarginright margin for the captions, the command\setlength{\captionmargin}{10pt}s ets this margin to lengths\abovecaptionskipand\belowcaption skipcontain the amount of\abovecaptionskip\belowcaptionskipwhit e space to leave above and below the caption .\abovecaptionskipis preset(in thearticle,reportandbookdocument class) to 10pt,\ Therotating,floatandsubfigurepackageIf you want to use this package together with therotating[1],float[2] and/or thesubfigurepackage, you have to input this packageafterthe other ones, like\usepackage{float,rotating,subfigure }\usepackage[centerlast,small,sc]{captio n}Thecaptionpackage now redefines thesidewaysfigureandsidewaystableenvi-ro nments and the\rotcaptioncommand provided by therotatingpackage fromS.

4 Rahtz and L. Barroca. Note that the\captionmargindoes not affect the\ also redefines the captions of theplainandboxedstyled floats provided by thefloatpackage from A. are not supported by default, but youcan change this via setting the optionruled. Note that the\captionmarginisnot supported in ruled thesubfigurepackage from Cochran is detected, the optionsscriptsize,.. ,largewill redefine\subcapsizein an adequate way. If you redefine\captionfontby yourself and use thesubfigurepackage, you also have to re-define\subcapsizeby yourself. Also the commands\@thesubfigureand\@thesubtablewi ll be redefined to use the\captionlabelfontcommand, pleasetake this into consideration if you redefine\@ a adequate version of the second example :\renewcommand{\thesubfigure}{\thefigure .}

5 \arabic{subfigure}}2\makeatletter\renewc ommand{\@ package cooperates with the version (1995/04/02) of therotatingpackage,version (1995/03/29) of thefloatpackage and version (1993/05/13) of thesubfigurepackage, but will hopefully work with future versions, ExampleHere s an example figure which was produced with the following code in the pream-ble of this document:\usepackage[hang,small,bf]{capt ion}\setlength{\captionmargin}{20pt}EXAM PLE FIGUREF igure 1:This is an example caption with a small font and a sans serif hang option was used. There is a left and right margin of The Identification1\NeedsTeXFormat{LaTeX2e}[ 1994/06/01]2\ProvidesPackage{ caption }[19 95/04/05 caption package (HS)]3\typeout{ package : caption <1995/04/05> (Harald Sommerfeldt)} Initial code\captionfont\captionlabelfont\captio nmargin\captionsizeis defined for backward compatibility with of this \newcommand{\captionsize}{}5\newcommand{ \captionfont}{\captionsize}6\newcommand{ \captionlabelfont}{}7\newlength{\ caption margin}Here are the different basic types of captions implemented:\as@normalcaptionThe normal caption8\newcommand{\as@normalcaption}[2 ]{%9#1 #2\par}\as@isucaptionThe iso or hang caption .

6 This code was taken from The LATEX Companion[3,p155] and modified10\newcommand{\as@isucaption}[2] {%11\sbox{\as@captionbox}{#1\space}%312\ addtolength{\as@captionwidth}{-\wd\as@ca ptionbox}%13\usebox{\as@captionbox}\parb ox[t]{\as@captionwidth}{\leavevmode#2}}\ as@centercaptionThe center caption14\newcommand{\as@centercaption}[ 2]{%15\parbox[t]{\as@captionwidth}{{\cen tering#1 #2\par}}}\as@annecaptionThe centerlast caption ; the idea how to do this was taken from Br uggemann-Klein[4], it is also mentioned in Kopka[5, p227]16\newcommand{\as@annecaption}[2]{% 17\addtolength{\leftskip}{0pt plus 1fil}%18\addtolength{\rightskip}{0pt plus -1fil}%19\setlength{\parfillskip}{0pt plus 2fil}%20#1 #2\par}\as@shortcaptionShort captions are centered by default21\let\as@ Detection of thesubfigurepackage\as@subcapsize\@thesu bfigure\@thesubtableIf thesubfigurepackage is loaded, a little message will be typeout and\as@subcapsize which sets the size of the subcaptions will be defined.

7 Also\@thesubfigureand\@thesubtablewill be redefined here to support the\captionlabelfontin subcaptions, too (thanks to Kevin Ruland for this idea!). If you don t likethis behaviour, just load thecaptionpackageafterthesubfigurepackag e (andeventually redefine the\subcapsizeby yourself) or redefine\@thesubfigureand\@thesubtableaf ter loading thecaptionpackage as shown in the documentationof \ifx\thesubfigure\undefined23\newcommand {\as@subcapsize}[1]{}24\else%25\typeout{ \space\space\space\space\space\space\spa ce\space\space26 subfigure package detected}27\let\as@subcapsize\subcapsize 28\renewcommand{\@ Declaration of optionsThere are four different types of captions supported:normal,isu, exactly the same \DeclareOption{normal}{\let\as@ caption \a s@normalcaption}32\DeclareOption{isu}{\l et\as@ caption \as@isucaption}33\DeclareOp tion{hang}{\ExecuteOptions{isu}}34\Decla reOption{center}{\let\as@ caption \as@cent ercaption}35\DeclareOption{anne}{\let\as @ caption \as@annecaption}36\DeclareOption {centerlast}{\ExecuteOptions{anne}}If optionnoonelineis set, only-one-line captions will behave like normal \DeclareOption{nooneline}{\AtBeginDocume nt{\let\as@shortcaption\as@ caption }}4 There are options for six different font sizes available, they also redefine the\subcapsizeprovided by thesubfigurepackage (if detected).}

8 38\DeclareOption{scriptsize}{%39\renewco mmand{\captionsize}{\scriptsize}40\as@su bcapsize{\scriptsize}}41\DeclareOption{f ootnotesize}{%42\renewcommand{\captionsi ze}{\footnotesize}43\as@subcapsize{\scri ptsize}}44\DeclareOption{small}{%45\rene wcommand{\captionsize}{\small}46\as@subc apsize{\footnotesize}}47\DeclareOption{n ormalsize}{%48\renewcommand{\captionsize }{\normalsize}49\as@subcapsize{\footnote size}}50\DeclareOption{large}{%51\renewc ommand{\captionsize}{\large}52\as@subcap size{\normalsize}}53\DeclareOption{Large }{%54\renewcommand{\captionsize}{\Large} 55\as@subcapsize{\large}}There are nine options available to set the font attributes of the caption \DeclareOption{up}{\renewcommand{\captio nlabelfont}{\upshape}}57\DeclareOption{i t}{\renewcommand{\captionlabelfont}{\its hape}}58\DeclareOption{sl}{\renewcommand {\captionlabelfont}{\slshape}}59\Declare Option{sc}{\renewcommand{\captionlabelfo nt}{\scshape}}60\DeclareOption{md}{\rene wcommand{\captionlabelfont}{\mdseries}}6 1\DeclareOption{bf}{\renewcommand{\capti onlabelfont}{\bfseries}}62\DeclareOption {rm}{\renewcommand{\captionlabelfont}{\r mfamily}}63\DeclareOption{sf}{\renewcomm and{\captionlabelfont}{\sffamily}}64\Dec lareOption{tt}{\renewcommand{\captionlab elfont}{\ttfamily}}If the optionruledis set.

9 The captions of ruled floats provided by thefloatpackagewill also be Execution of optionsThe normal type of caption is \ExecuteOptions{normal}67\ Main code\as@captionbox\as@captionwidth\as@ma kecaption\@makecaptionAnd now .. it s .. the new\@makecaptioncode!68\newsavebox{\as@c aptionbox}69\newlength{\as@captionwidth} 70\newcommand{\as@makecaption}[2]{%71\se tlength{\leftskip}{\captionmargin}%72\se tlength{\rightskip}{\captionmargin}%73\a ddtolength{\as@captionwidth}{-2\captionm argin}%74\captionfont%75\sbox{\as@captio nbox}{{\captionlabelfont #1:} #2}%576\ifdim \wd\as@captionbox >\as@captionwidth77\as@ caption {{\ caption labelfont #1:}}{#2}%78\else%79\as@shortcaption{{\c aptionlabelfont #1:}}{#2}%80\fi}81\renewcommand{\@makeca ption}[2]{%82\vskip\abovecaptionskip%83\ setlength{\as@ Support of therotatingpackage\@makercaption\@makero tcaptionIf therotatingpackage is loaded, the command\@makerotcaption(for supportof\rotcaption) will be redefined here.}}

10 The code was taken from therotatingpackage [1] itself and \ifx\@makerotcaption\undefined87\else88\ typeout{\space\space\space\space\space\s pace\space\space\space89 rotating package detected}90% \let\@makercaption\undefined91\renewcomm and{\@makerotcaption}[2]{%92\captionfont %93\sbox{\as@captionbox}{{\captionlabelf ont #1:} #2}%94\ifdim \wd\as@captionbox > @captionwidth}%98\as@ caption {{\captionla belfont Support of thefloatpackage\floatc@plain\floatc@rule dIf thefloatpackage is loaded, the command\floatc@plain(and the command\floatc@ruledif the optionruledis given) will be redefined \ifx\floatc@plain\undefined106\else107\t ypeout{\space\space\space\space\space\sp ace\space\space\space108 float package detected}109\renewcommand\floatc@plain[2 ]{%110\setlength{\as@captionwidth}{\line width}%111\as@makecaption{#1}{#2}}112\if x\as@ruled\undefined113\else114\renewcom mand\floatc@ruled[2]{%115\setlength{\as@ captionwidth}{\linewidth}%116\captionfon t%117\as@ caption {{\captionlabelfont #1.}}}}}


Related search queries