Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Problem Statement

I adjusted the caption format for my figures and tables using the caption package, such that the words "Figure" and "Table" are typeset using small caps. Now I want to obtain correct letterspacing for these words using the microtype package and the command \textls, but adding labelfont = ls in the caption setup doesn't work.

Minimal working example

\documentclass{scrartcl}
\pagestyle{empty}
\usepackage{tikz}
\usepackage{microtype}
\usepackage{caption}
\captionsetup{
    format = plain,
    font = footnotesize,
    labelfont = sc
}
\begin{document}
\begin{figure}[!htb]
    \centering
    \begin{tikzpicture}
        \draw (0,0) circle[radius=1];
    \end{tikzpicture}
    \caption{A circle.}
    \label{fig:sine}
\end{figure}
\end{document}

Sample output

caption

Note the non-letterspaced small caps here.

share|improve this question
2  
Add \DeclareCaptionFont{ls}{\lsstyle} and then labelfont={sc,ls} should give you spaced small caps. –  egreg May 29 '13 at 9:13
    
Thank you very much. Please post it as an answer, that I can accept it. –  Henri Menke May 29 '13 at 9:15

2 Answers 2

up vote 5 down vote accepted

The KOMA-script classes have their own method for changing basic aspects of the caption typesetting. On the other hand, the caption package allows greater flexibility and many more customization options.

Since the package can't know each and every font combination, it also provide an interface for defining new options.

In your case you can do

\usepackage{microtype}
\usepackage{caption}
\DeclareCaptionFont{ls}{\lsstyle} % define a new option

\captionsetup{
  format = plain,
  font = footnotesize,
  labelfont = {sc,ls},
}

See Section 4 “Own enhancements” in the documentation of caption.

share|improve this answer

As you're using scrartcl, there's no reason to use the caption package if all you do with it is set the caption's text style. This can be done out of the box with the komascript classes (and, differently, with others too).

\documentclass{scrartcl}
\usepackage{microtype}
\setkomafont{caption}{\normalfont\footnotesize}
\setkomafont{captionlabel}{\usekomafont{caption}\scshape\lsstyle}
\begin{document}
\begin{figure}
\caption{...}
...
\end{figure}
\end{document}
share|improve this answer
    
This is a good answer, but unfortunately limited to the KOMA documentclasses. –  Henri Menke May 29 '13 at 9:18
    
well, the KOMA classes is what you're using :) Plus, if a package (or a class) can change LaTeX's defaults, there's no reason why you couldn't do it too. I like to keep the Nr. of packages loaded small, so if I were using a class other than scr*, and if all wanted was to change the caption style, I'd just look up how caption or scr* does it and build my own mechanism based on that. –  Nils L May 29 '13 at 9:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.