I am trying to change the font of the label in the caption, but it seems not work. The font is changed in the text of the cation but not in the label This is my preamble:

\usepackage{setspace} % This is used in the title page
\captionsetup{font={small}, textfont={sf}, labelfont={bf,sf}}
\usepackage[T1]{fontenc} %font choice
\usepackage{tgtermes} %font

    bookmarks=true,         % show bookmarks bar?
    pdftitle={},    % title
    pdfauthor={},     % author
    pdfsubject={},   % subject of the document
    pdfcreator={},   % creator of the document
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=black,          % color of internal links
    citecolor=black,        % color of links to bibliography
    filecolor=magenta,      % color of file links
    urlcolor=cyan           % color of external links

and this what I get back

I would like to have everything in sf.

Any help?



| improve this question | | | | |
  • (1) Make a minimal example, (2) make an example, you only post preamble, you are much more likely to get help if you post something that can be copied and used without having to add to it. – daleif Jul 2 '14 at 14:09

Here is a much simpler minimal example


this example shows that when tgtermes is loaded, there is no bold sans serif. Which is quite odd.

The main problem seems to be that tgtermes sets \bfdefault to b. For sans serif tgtermes falls back to CMSS (computer modern sans serif) but that does not use the b default, but rather the bx.

You can see this from the .log file, I get this when I compile the example above

LaTeX Font Warning: Font shape `T1/cmss/b/n' undefined
(Font)              using `T1/cmss/m/n' instead on input line 12.

Might be an idea to find a find a more suitable sans serif font and load that package after tgtermes, see http://www.tug.dk/FontCatalogue/sansseriffonts.html

| improve this answer | | | | |
  • If I load (even at the beginning) helvet or lmodern, it's OK. You can try TeX-Gyre Heros, a replacement for Helvetica. – Bernard Jul 2 '14 at 14:51
  • Hi, it works fine with the minimal example.. the problem is I cannot find why it doesn't work in my preamble. I tried to add packages like float in my minimal example (my test.tex) and none of them seem to bother the formatting. – user1463152 Jul 2 '14 at 15:45

For unknown reasons, tgtermes redefines \bfdefault to b, which is a very disputable choice.

You can simply revert to the standard bx and all will be well, because the font definition files for TeX Gyre Termes do contain a font substitution rule from bx to b.


\captionsetup{font={small}, textfont={sf}, labelfont={bf,sf}}


Test \textbf{test in bold face} test


\caption{Protein expression}


enter image description here

| improve this answer | | | | |

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.