2

I'm trying to put a \cite within a figure caption, but when the list of references is being built, it places all \cites inside figure captions first, and only then it starts placing all the other references in the document.

I know that this question has already been asked multiple times and i found several answers around the Web, but nobody of them seems to solve my problem.

I've tried:

  • To use \protect\cite
  • To use package notoccite
  • To use \caption[text without cite command]{text with \cite}

Here's my minimal program:

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}      
\usepackage[utf8]{inputenc}   
\usepackage[english, italian]{babel}   
\usepackage{lipsum}           
\usepackage{url}              
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage[autostyle,italian=guillemets]{csquotes}
\usepackage{hyperref}
\usepackage[bibstyle=numeric, backend=biber, hyperref]{biblatex}
\addbibresource{Bibliografia.bib}
\usepackage{sectsty}
\allsectionsfont{\centering}
\usepackage{graphicx}
\usepackage{notoccite}


\begin{document}
\author{Me}
\title{Title}
\maketitle

%...
\section{}
\lipsum[1]\cite{focardi}



\appendix
\section{Viscosità attesa teoricamente}
\label{app:appA}

\begin{figure}
    \centering
    \includegraphics[width=0.9\textwidth]{tabviscos.png}
    \caption[Caption]{Viscosità di soluzioni acquose di glicerina ($cP$) \protect\cite{glic}}
    \label{fig:tabvisc}
\end{figure}

\lipsum[1]


\printbibliography[heading=bibintoc]

\end{document}

I'm working with Overleaf

4
  • Welcome to TeX.SE.
    – Mico
    Jun 9, 2019 at 19:41
  • Yes @Mico, that was the point. I've edited my post
    – Trigger1
    Jun 9, 2019 at 19:44
  • 1
    With the method you employ in the code example, you'll need to re-run LaTeX at least twice to see the expected output in (a) the List of Figures and (b) the numbering of the bibliographic items. Did you re-run LaTeX twice after adding the optional, citation-free argument to \caption?
    – Mico
    Jun 9, 2019 at 19:53
  • Yes, i've run it multiple times both with Overleaf and TeXStudio
    – Trigger1
    Jun 9, 2019 at 20:19

1 Answer 1

1

Adding the sorting=none option to biblatex seems to resolve your issue:

enter image description here

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}      
\usepackage[utf8]{inputenc}   
\usepackage[english, italian]{babel}   
\usepackage{lipsum}           
\usepackage{url}              
\usepackage{amsmath}
\usepackage{siunitx}
\usepackage[autostyle,italian=guillemets]{csquotes}
\usepackage{hyperref}
\usepackage[bibstyle=numeric, backend=biber, hyperref,sorting=none]{biblatex}

\usepackage{sectsty}
\allsectionsfont{\centering}
\usepackage[draft]{graphicx}
\usepackage{notoccite}

\addbibresource{\jobname.bib}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{focardi,
  author = {Citation, Text},
  year = {2001},
  title = {Title},
  publisher = {Publisher},
}
@book{glic,
  author = {Citation, Caption},
  year = {2001},
  title = {Title},
  publisher = {Publisher},
}
\end{filecontents}


\begin{document}
\author{Me}
\title{Title}
\maketitle

%...
\section{}
\lipsum[1]\cite{focardi}



\appendix
\section{Viscosità attesa teoricamente}
\label{app:appA}

\begin{figure}
    \centering
    \includegraphics[width=0.9\textwidth]{tabviscos.png}
    \caption[Caption]{Viscosità di soluzioni acquose di glicerina ($cP$) \cite{glic}}
    \label{fig:tabvisc}
\end{figure}

\lipsum[1]


\printbibliography[heading=bibintoc]

\end{document}
1
  • 1
    This solved perfectly, very thanks!
    – Trigger1
    Jun 9, 2019 at 23:29

You must log in to answer this question.

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