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.

I need to change the font size from \caption* to 10pt.However, using \captionsetup the \caption font size changes as well. How can I solve that?

share|improve this question

migrated from stackoverflow.com Aug 21 '12 at 14:30

This question came from our site for professional and enthusiast programmers.

    
Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  percusse Aug 21 '12 at 14:34

1 Answer 1

The following minimal example changes the starred \caption of all floats to be different from that of \caption using etoolbox to patch \caption@@@make:

enter image description here

\documentclass[12pt]{article}
\usepackage[paperheight=4in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{caption}% http://ctan.org/pkg/caption
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\captionsetup{font=small}
\makeatletter
\patchcmd{\caption@@@make}% <cmd>
  {\ifcaption@star}% <search>
    {\ifcaption@star\footnotesize}% <replace>
    {}{}% <success><failure>
\makeatother
\begin{document}
\makeatletter
\begin{figure}\caption{A regular figure caption: \f@size{}pt}\end{figure}
\begin{figure}\caption*{A starred figure caption: \f@size{}pt}\end{figure}
\makeatother
\end{document}

\captionsetup sets the caption font to \small in a 12pt base font, which is equivalent to 10.95pt (for \caption). The patch turns \caption*'s font size into \footnotesize, which is equivalent to 10pt.

geometry was used just for this example to reduce the paper size and may not be needed in your application.

share|improve this answer

Your Answer

 
discard

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