This is my first question to any StackExchange ever so please bear with me! I am writing my thesis using two fonts, a serif font for the main text and a sans-serif font for the captions for tables and figures. Some of these captions contain in-line citations that have an `et al.' in them – however, instead of following the sans-serif font of the caption, they retain the serif font. A minimum example is shown below (and the code to generate it).
\documentclass{article}
%Temporary Bibliography
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{alberts_2008,
place={New York},
title={Molecular Biology of the Cell},
publisher={Garland Science},
author={Alberts, Bruce and others},
year={2008}
}
\end{filecontents}
\immediate\write18{bibtex \jobname}
%Load packages
\usepackage{booktabs}
\usepackage{fontspec}
\usepackage[colon, authoryear]{natbib}
%Set fonts
\setromanfont{Times New Roman}
\setsansfont{Helvetica}
%Define Caption Options
\usepackage[labelfont={bf,sf,singlespacing},
textfont={sf,singlespacing},
justification={justified,RaggedRight},
singlelinecheck=false,
margin=0pt]{caption}
\begin{document}
The quick brown fox jumps over the lazy dog \citep{alberts_2008}.
\begin{table}
\caption{Sample data}
\centering
\begin{tabular}{ccc}
Sample & A & B \\
One & 7.5 & 5.5 \\
Two & 3.45 & 3.4
\end{tabular}
\caption*{
From \citep{alberts_2008}}
\end{table}
%Print Bibliography
\bibliographystyle{cell}
\bibliography{\jobname}
\end{document}
I am open to any type of solution! Also, thanks to the advice of some posters, I have cleaned up this example quite a bit.
Best Answer
In case you are not bound to use
bibtex
, you could circumvent the problem by usingbiblatex
: