natbib 包与 IEEE CSM(控制系统杂志)模板不兼容?

natbib 包与 IEEE CSM(控制系统杂志)模板不兼容?

我的代码如下。我收到的警告包括“命令 \NAT@parse 已定义。}”,以及“未知的文档类(或包),(标题)将使用标准默认值。”,以及“第 1 页上的引用‘XX’未定义”,以及“没有文件 CSM_1.bbl。”,以及“存在未定义的引用。”

\documentclass[letterpaper,12pt,peerreviewca,draftcls]{IEEEtran}
\usepackage{csm16}
\usepackage[margin=1in]{geometry}
\usepackage[nolists,nomarkers,tablesfirst]{endfloat} % put figures at end
\usepackage{amsmath} % for \eqref
\usepackage[numbers]{natbib}


% added for CSMAG only
\usepackage{url}
\usepackage{graphicx,xcolor}
\usepackage{verbatim}% http://ctan.org/pkg/verbatim
\makeatletter
\newcommand{\verbatimfont}[1]{\def\verbatim@font{#1}}%
\makeatother
\verbatimfont{\ttfamily\small}
\newcommand{\XX}[1]{{\bf XX #1 XX}}
\newcommand{\bi}{\begin{itemize}}\newcommand{\ei}{\end{itemize}}
\newcommand{\be}{\begin{equation}}\newcommand{\ee}{\end{equation}}
\newcommand{\bee}{\begin{enumerate}}\newcommand{\eee}{\end{enumerate}}
\newcommand{\bea}{\begin{eqnarray}}\newcommand{\eea}{\end{eqnarray}}
\newcommand{\beas}{\begin{eqnarray*}}\newcommand{\eeas}{\end{eqnarray*}}
\newcommand{\bc}{\begin{center}}\newcommand{\ec}{\end{center}}
%
\usepackage[left,pagewise]{lineno} 
\usepackage[english]{babel} 
\usepackage{blindtext}
% added for CSMAG only

\title{A paper}
\author{John\ Smith\\
    [email protected]\\ \today }

\newif\ifPDF \ifx\pdfoutput\undefined\PDFfalse \else\ifnum\pdfoutput > 0\PDFtrue \else\PDFfalse \fi \fi
\ifPDF 
\usepackage[pdftex, plainpages = false, colorlinks=true, linkcolor=black, citecolor = green!50!blue, urlcolor = blue, filecolor=black, pagebackref=false, hypertexnames=false,  pdfpagelabels ]{hyperref}
\fi

\begin{document}
\maketitle
\CSMsetup
\linenumbers \modulolinenumbers[2] % added for CSMAG only


\section{Introduction}
Here we cite \cite{kalman1960new}.

\bibliographystyle{IEEEtranN}
\bibliography{references}

\end{document}

答案1

放在后面\documentclass{...

\makeatletter
\let\NAT@parse\undefined
\makeatother

评论IEEEtran 准备使用该包cite进行引用。在这种情况下,不需要添加此代码。\bibliographystyle{IEEEtran}您将获得相同的输出。

b

\documentclass[letterpaper,12pt,peerreviewca,draftcls]{IEEEtran}

%************************ added <<<<<<<<<<<<< (only for natbib)
\makeatletter
\let\NAT@parse\undefined
\makeatother
%************************

\usepackage{csm16}
\usepackage[margin=1in]{geometry}
\usepackage[nolists,nomarkers,tablesfirst]{endfloat} % put figures at end
\usepackage{amsmath} % for \eqref
\usepackage[numbers]{natbib}
%\usepackage{cite} % alternative for IEEEtran <<<<<

% added for CSMAG only
\usepackage{url}
\usepackage{graphicx,xcolor}
\usepackage{verbatim}% http://ctan.org/pkg/verbatim
\makeatletter
\newcommand{\verbatimfont}[1]{\def\verbatim@font{#1}}%
\makeatother
\verbatimfont{\ttfamily\small}
\newcommand{\XX}[1]{{\bf XX #1 XX}}
\newcommand{\bi}{\begin{itemize}}\newcommand{\ei}{\end{itemize}}
\newcommand{\be}{\begin{equation}}\newcommand{\ee}{\end{equation}}
\newcommand{\bee}{\begin{enumerate}}\newcommand{\eee}{\end{enumerate}}
\newcommand{\bea}{\begin{eqnarray}}\newcommand{\eea}{\end{eqnarray}}
\newcommand{\beas}{\begin{eqnarray*}}\newcommand{\eeas}{\end{eqnarray*}}
\newcommand{\bc}{\begin{center}}\newcommand{\ec}{\end{center}}
%
\usepackage[left,pagewise]{lineno} 
\usepackage[english]{babel} 
\usepackage{blindtext}
% added for CSMAG only

\title{A paper}
\author{John\ Smith\\
    [email protected]\\ \today }

\newif\ifPDF \ifx\pdfoutput\undefined\PDFfalse \else\ifnum\pdfoutput > 0\PDFtrue \else\PDFfalse \fi \fi
\ifPDF 
\usepackage[pdftex, plainpages = false, colorlinks=true, linkcolor=black, citecolor = green!50!blue, urlcolor = blue, filecolor=black, pagebackref=false, hypertexnames=false,  pdfpagelabels ]{hyperref}
\fi

\begin{document}
    \maketitle
    \CSMsetup
    \linenumbers \modulolinenumbers[2] % added for CSMAG only   
    
    \section{Introduction}
    Here we cite \cite{kalman1960new}.
    
    \bibliographystyle{IEEEtranN}
    \bibliography{references}
    
\end{document}

references.bib

@article{kalman1960new,
    title={Contributions to the theory of optimal control},
    author={Kalman, Rudolf Emil and others},
    journal={Bol. soc. mat. mexicana},
    volume={5},
    number={2},
    pages={102--119},
    year={1960}
}

相关内容