28.03.2013 Views

Typesetting captions with the caption package - Departamento de ...

Typesetting captions with the caption package - Departamento de ...

Typesetting captions with the caption package - Departamento de ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

\<strong>caption</strong>@setlabelformat \<strong>caption</strong>@setlabelformat{〈name〉}<br />

Selecting a <strong>caption</strong> label format simply means saving <strong>the</strong> co<strong>de</strong> (in \<strong>caption</strong>@lfmt).<br />

246 \newcommand*\<strong>caption</strong>@setlabelformat[1]{%<br />

247 \@ifun<strong>de</strong>fined{<strong>caption</strong>@lfmt@#1}%<br />

248 {\<strong>caption</strong>@Error{Un<strong>de</strong>fined <strong>caption</strong> label format ‘#1’}}%<br />

249 {\expandafter\let\expandafter\<strong>caption</strong>@lfmt\csname <strong>caption</strong>@lfmt@#1\endcsname}}<br />

There are three pre-<strong>de</strong>fined label formats, called ‘empty’, ‘simple’, and ‘parens’.<br />

250 \DeclareCaptionLabelFormat{empty}{}<br />

251 \DeclareCaptionLabelFormat{simple}{\bothIfFirst{#1}{\nobreakspace}#2}<br />

252 \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{\nobreakspace}(#2)}<br />

‘<strong>de</strong>fault’ usually maps to ‘simple’.<br />

253 \<strong>de</strong>f\<strong>caption</strong>@lfmt@<strong>de</strong>fault{\<strong>caption</strong>@lfmt@simple}<br />

Label separators<br />

clareCaptionLabelSeparator \DeclareCaptionLabelSeparator{〈name〉}{〈co<strong>de</strong>〉}<br />

\DeclareCaptionLabelSeparator*{〈name〉}{〈co<strong>de</strong>〉}<br />

The starred form causes <strong>the</strong> label separator to be typeset <strong>with</strong>out using \<strong>caption</strong>labelfont.<br />

254 \newcommand\DeclareCaptionLabelSeparator{%<br />

255 \@ifstar{\<strong>caption</strong>@<strong>de</strong>clarelabelseparator\@gobble}%<br />

256 {\<strong>caption</strong>@<strong>de</strong>clarelabelseparator\@firstofone}}<br />

257 \newcommand\<strong>caption</strong>@<strong>de</strong>clarelabelseparator[3]{%<br />

258 \global\expandafter\let\csname <strong>caption</strong>@iflf@#2\endcsname#1%<br />

259 \global\long\@name<strong>de</strong>f{<strong>caption</strong>@lsep@#2}{#3}}<br />

260 \@onlypreamble\DeclareCaptionLabelSeparator<br />

261 \@onlypreamble\<strong>caption</strong>@<strong>de</strong>clarelabelseparator<br />

262 \DeclareCaptionOption{labelsep}{\<strong>caption</strong>@setlabelseparator{#1}}<br />

263 \DeclareCaptionOption{labelseparator}{\<strong>caption</strong>@setlabelseparator{#1}}<br />

\<strong>caption</strong>@setlabelseparator \<strong>caption</strong>@setlabelseparator{〈name〉}<br />

Selecting a <strong>caption</strong> label separator simply means saving <strong>the</strong> co<strong>de</strong> (in \<strong>caption</strong>@lsep).<br />

264 \newcommand*\<strong>caption</strong>@setlabelseparator[1]{%<br />

265 \@ifun<strong>de</strong>fined{<strong>caption</strong>@lsep@#1}%<br />

266 {\<strong>caption</strong>@Error{Un<strong>de</strong>fined <strong>caption</strong> label separator ‘#1’}}%<br />

267 {\expandafter\let\expandafter\<strong>caption</strong>@iflf\csname <strong>caption</strong>@iflf@#1\endcsname<br />

268 \expandafter\let\expandafter\<strong>caption</strong>@lsep\csname <strong>caption</strong>@lsep@#1\endcsname}}<br />

There are seven pre-<strong>de</strong>fined label separators, called ‘none’, ‘colon’, ‘period’, ‘space’,<br />

‘quad’, ‘newline’, and ‘endash’.<br />

269 \DeclareCaptionLabelSeparator{none}{}<br />

270 \DeclareCaptionLabelSeparator{colon}{: }<br />

271 \DeclareCaptionLabelSeparator{period}{. }<br />

272 \DeclareCaptionLabelSeparator{space}{ }<br />

273 \DeclareCaptionLabelSeparator*{quad}{\quad}<br />

274 \DeclareCaptionLabelSeparator*{newline}{\\}<br />

275 \DeclareCaptionLabelSeparator*{endash}{\space\textendash\space}<br />

36

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!