3

I'd like to change font face of all figure captions. I'm currently using the fontspec package to set main font of the document. I'm also using DeclareCaptionFormat to set font size.

I fail to see any way to set font face of captions. Is there some combination of fontspec and caption packages that allows to do that?

  • Package caption offer a simple way for definition font shapes, sizes etc. See documentation of package. – Zarko Jun 6 '14 at 1:34
4

Here's one way of doing it - specifying a caption format and then associating it with the figure float:

enter image description here

\documentclass{article}
\usepackage{fontspec,lipsum,caption,graphicx}
\setmainfont{Source Sans Pro}% Main document font
\newfontfamily\figcapfont{TeX Gyre Pagella}% Some other font
\DeclareCaptionFormat{figcapfont}{\figcapfont \textbf{#1#2}#3}
\captionsetup[figure]{format=figcapfont}
\begin{document}
\begin{figure}[ht]
  \centering
  \includegraphics[width=.3\linewidth]{example-image}
  \caption{This is a caption for a figure.}
\end{figure}
\lipsum[1]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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