BibTeX 和 IEEEtran 的多个参考书目:标题内的引用错误

BibTeX 和 IEEEtran 的多个参考书目:标题内的引用错误

我正在撰写我的博士论文,并使用改编版的 memoir-class + IEEEtran.bst 作为参考书目样式。

这个想法是创建一个专门包含博士候选人论文的特定出版物清单。该出版物清单分为两部分:“pub”表示同行评审的论文,“pubOther”表示其他出版物。在文档中,命令 \selfcite{} 用于引用上述出版物清单中的内容。

如果我在标题中使用 \selfcite{} ,会出现错误,但如果在其他地方使用它,一切就正常。

在这里我复制了我得到的错误:

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

在这里我复制了描述出版物列表的代码片段和命令 \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'           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newcites{pub}{Peer-reviewed}
\newcites{pubOther}{Other}
\newcommand\biblabelprefix{}
\newdimen\b@belwidth
\newdimen\b@b@lwidth
\newcommand\setbabelwidth[1]{{%
    \newbox\tmp
    \setbox\tmp=\hbox{#1}%
    \global\b@belwidth=\wd\tmp
}}
\renewcommand\@biblabel[1]{{%
    \newbox\tmp
    \setbox\tmp=\hbox{#1}%
    \@tempdima=\wd\tmp%
    \@tempdimb=\m@ne\@tempdima
    \advance\@tempdimb by \b@belwidth
    \rule{\@tempdimb}{0pt}[\biblabelprefix#1]%
}}
\def\@bibitem#1{%
    \item\if@filesw
        \immediate\write\@auxout{\string\bibcite{#1}{\biblabelprefix\the\value{\@listctr}}}%
    \fi\ignorespaces}
\renewcommand{\@fnsymbol}[1]{%
    \ensuremath{%
        \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 ... 
    \xdef\@thefnmark{\null}
    \@footnotetext{%
    \hspace{-1.8em}
    #1
    }
}
\@ifundefined{@mb@citenamelist}{\def\@mb@citenamelist{cite,citep,citet,citealp,citealt}}{\relax}
\def\selfcite#1{\setcitestyle{open={[\initials}}\citepub{#1}\setcitestyle{open={[}}}

\newcommand\listofpublications{{%
    \small
    \setbabelwidth{10}
    \microtypesetup{protrusion=false}%  
    \renewcommand{\bibsection}{%no chapter but simply section
        \section{\bibname}
        \prebibhook
    }   
    \renewcommand{\biblabelprefix}{\initials}% Add prefix to biblabel for publications
    \continuouslabelstrue
    \bibliographystylepub{IEEEtran2}%
    \bibliographystylepubOther{IEEEtran2}%
    \chapter{List of publications}
    \scriptsize 
    \bibliographypub{IEEEabrv,\bibfile}
    \bibliographypubOther{IEEEabrv,\bibfile}%   
    \microtypesetup{protrusion=true}%
}}
\makeatother

你能帮我找出问题吗?谢谢!

答案1

在某些情况下,我们必须在 LaTeX 中保护某些命令的内容(这些命令稍后会被扩展等等)。

\caption在很多情况下就是其中之一。

因此,在命令前添加一个\protect命令,\selfcite例如:

\caption{Your text here\ldots (Source: \protect\selfcite{JS2009})}

相关内容