4

I have to change the font type of my figure captions to sans serif because this is a requirement for a IEEE paper I have to hand in.

I do not know how to do this.

I have searched around for an answer, but all I was able to find was examples where the font was changed to bold or/and italic.
I have to change it to sans serif.
This is what I have:

\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}
    \begin{figure} [H]
       \centering
       \captionsetup{justification=centering}
       \includegraphics[width = 8 cm]{Figures/figure.PNG}
       \caption{blah blah blah}
       \label{fig:label}
    \end{figure}
\end{document}

Is there a command/package I can use where I can just define the font for any single figure or simply define the font type for all figures in the preamble?

3
  • 2
    Don't the IEEE classes already do that? If you have to hand in a IEEE paper you should use them. If you are using a different class, then please provide a full minimal working example starting with \documentclass{...} and ending with \end{document}.
    – campa
    Commented Jun 10, 2021 at 13:28
  • \captionsetup{font=sf}
    – Bernard
    Commented Jun 10, 2021 at 13:30
  • I am using the IEEEtran class. I does not seem to make figure captions sf, but I have gotten the answer I was looking for. Thanks for the interest :)
    – BatS00p
    Commented Jun 11, 2021 at 9:15

1 Answer 1

3

Welcome to Tex.SE!

\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}
\begin{figure}[h]
   \centering
   \captionsetup{justification=centering,font=sf}
   \includegraphics[width = 8 cm]{Figures/figure.PNG}
   \caption{blah blah blah}
   \label{fig:label}
\end{figure}
\end{document} 

This is what you're looking for! ;D

2
  • Awesome man, this was exactly what I wanted. Thank you very much! Would like to up vote, but don't have enough rep :(
    – BatS00p
    Commented Jun 11, 2021 at 9:13
  • No worries, what matters is that you understand why this is why and how this code works! :D Commented Jun 11, 2021 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .