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.

How to renew \caption command to make all title in bold? I do this:

\usepackage[labelfont=bf,labelsep=space]{caption}

and I get

Figure 1 caption

I need

Figure 1 caption

My try

\renewcommand{\caption}[1]{\caption{\textbf{#1}}}

doesn't work.

share|improve this question
6  
Add font=bf to the options. Or, better, change labelfont to font –  egreg May 19 '12 at 18:06
1  
BTW: The caption package does offer a documentation. –  Axel Sommerfeldt May 20 '12 at 6:51

2 Answers 2

up vote 4 down vote accepted

As egreg pointed out in his comment, since you are already loading the caption package, you don't need to redefine \caption; all you have to do is to use the option font=bf instead of just labelfont=bf (the latter affects the whole caption whilst the former only affects the caption label and separator); a little example:

\documentclass{article}
\usepackage[font=bf,labelsep=space]{caption}

\begin{document}

\begin{figure}
\centering
\rule{1cm}{1cm}% placeholder for `\includegraphics`
\caption{A test figure}
\label{fig:test}
\end{figure}

\end{document}

enter image description here

Another (but not so economic) option would have been to load caption on the following way

\usepackage[labelfont=bf,textfont=bf,labelsep=space]{caption}
share|improve this answer

Perhaps less flexible, you can modify \@makecaption to always print the caption in \bfseries:

enter image description here

\documentclass{article}
\makeatletter
% Taken from article.cls, although common to book.cls and report.cls
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\bfseries#1: #2}%
  \ifdim \wd\@tempboxa >\hsize
    \bfseries#1: #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\makeatother
\begin{document}
\begin{figure}[ht]\caption{This is a figure caption}\end{figure}
\begin{table}[ht]\caption{This is a table caption}\end{table}
\end{document}
share|improve this answer

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.