I am writing my PhD thesis and I am using an adapted version of the memoir-class + IEEEtran.bst for the bibliography style.

The idea is to create a specific List of Publications exclusively with the papers of the PhD canditate. This List of Publications is divided in two sections:'pub' denoting peer-reviewed papers, and 'pubOther' for other publications. Inside the document, the command \selfcite{} is used for citations in aforementioned List of Publications.

I get errors if I use \selfcite{} INSIDE a caption, while everything works fine if it is used elsewhere.

Here I copy the error I get:

! Undefined control sequence.
<argument> ...@tempc }\fi \fi \def \@tempa {\@nil
}\ifx \@tempa \@nnil \else...
l.96 ...ncies. (Source: \selfcite{JS2009})}

While here I copy the piece of code describing the List of Publications and the command \selfcite

\RequirePackage[resetlabels]{multibib}  % Used for multiple bibliographies, as this class enables the use of a separate List of Publications    

% We define two 'sections' in our own List of Publications, but it can be     %
% expanded as desired. Here, 'pub' denotes peer-reviewed papers (journals,    %
% conferences), and 'pubOther' denote other publications (popular article,    %
% invited talk, workshop, ...). Use \selfcite{<key>} to cite these            %
% These two lists need to be separately compiled: 'bibtex pub'                %
%                                                 'bibtex pubOther'           %
    \advance\@tempdimb by \b@belwidth
        \ifcase#1\or \dagger\or \ddagger\or
        \mathsection\or \|\or \mathparagraph\or **\or \dagger\dagger
        \or \ddagger\ddagger \else\@ctrerr\fi
\newcommand\blfootnote[1]{% Enable a footnote at begin of chapter to say e.g. parts of this chapter were published in ... 

    \renewcommand{\bibsection}{%no chapter but simply section
    \renewcommand{\biblabelprefix}{\initials}% Add prefix to biblabel for publications
    \chapter{List of publications}

Can you please help me to find the problem? Thanks!

  • Welcome to TeX.SE! Sometimes inside a caption you have to add the command with \protect before it. – koleygr Oct 20 '18 at 11:14
  • Welcome @clidrevandijk... I made it an answer since it works for you, but possibly it is a duplicate too. – koleygr Oct 20 '18 at 11:33
  • Also, next time try to give a MWE (tex.meta.stackexchange.com/q/228/120578) because it is easier to get an answer that works for you... and you have much more possibilities to get help. – koleygr Oct 20 '18 at 11:38

There are some commands that we have to protect their content in LaTeX in several cases (of a command that will be expanded later etc).

\caption is one of them in many cases.

So, add a \protect command before your \selfcite command like:

\caption{Your text here\ldots (Source: \protect\selfcite{JS2009})}
| improve this answer | |

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