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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

are offered. \bothIfFirst tests if <strong>the</strong> first argument exists (means: is not empty),<br />

\bothIfSecond tests if <strong>the</strong> second argument exists. If yes, both arguments get typeset,<br />

o<strong>the</strong>rwise none of <strong>the</strong>m.<br />

For example <strong>the</strong> standard label format simple is not <strong>de</strong>fined as<br />

\DeclareCaptionLabelFormat{simple}{#1 #2} ,<br />

because this could cause an extra space if #1 is empty. Instead simple is <strong>de</strong>fined as<br />

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

,<br />

causing <strong>the</strong> space to appear only if <strong>the</strong> label name is present.<br />

\DeclareCaptionLabelSeparatorYou<br />

can <strong>de</strong>fine your own <strong>caption</strong> label separators <strong>with</strong><br />

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

Again an easy example taken from <strong>the</strong> <strong>caption</strong> <strong>package</strong> itself:<br />

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

\DeclareCaptionJustificationYou<br />

can <strong>de</strong>fine your own <strong>caption</strong> justifications <strong>with</strong><br />

\DeclareCaptionFont<br />

New <strong>de</strong>scription<br />

v3.0h<br />

\DeclareCaptionJustification{〈name〉}{〈co<strong>de</strong>〉} .<br />

The 〈co<strong>de</strong>〉 simply gets typeset just before <strong>the</strong> <strong>caption</strong>. E.g. using <strong>the</strong> justification<br />

raggedright, which is <strong>de</strong>fined as<br />

\DeclareCaptionJustification{raggedright}{\raggedright}<br />

,<br />

lets <strong><strong>caption</strong>s</strong> <strong>with</strong> all lines moved to <strong>the</strong> left margin.<br />

You can <strong>de</strong>fine your own <strong>caption</strong> fonts <strong>with</strong><br />

\DeclareCaptionFont{〈name〉}{〈co<strong>de</strong>〉} .<br />

For example this <strong>package</strong> <strong>de</strong>fines <strong>the</strong> options small and bf as<br />

\DeclareCaptionFont{small}{\small} and<br />

\DeclareCaptionFont{bf}{\bfseries} .<br />

The line spacing could be customized using <strong>the</strong> setspace <strong>package</strong>, for example:<br />

\use<strong>package</strong>{setspace}<br />

\<strong><strong>caption</strong>s</strong>etup{font={onehalfspacing,small},labelfont=bf}<br />

16

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

Saved successfully!

Ooh no, something went wrong!