引用未定义错误

引用未定义错误

我是 Latex 的新手。这是我的代码的一个简短示例:

\documentclass{article}
\usepackage[left=1.85cm, right=2.25cm,top=2.5cm,bottom=3cm]{geometry}
\usepackage{graphicx}
\usepackage[affil-it]{authblk}
\usepackage[greek,english]{babel}
\usepackage{natbib}
\usepackage{float}
\usepackage[resetlabels]{multibib}
\usepackage{amsmath}
\usepackage{placeins}
\usepackage{xcolor}
\usepackage{color}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{amsfonts}
\usepackage{longtable}
\usepackage{subfig}
\usepackage{soul}
\usepackage{amssymb}
\graphicspath{{Figures/}}

\title{...}
\sethlcolor{yellow}

\makeatletter
\def\SOUL@hlpreamble{%
    \setul{}{3.5ex}% increased by 1ex
    \let\SOUL@stcolor\SOUL@hlcolor
    \dimen@\SOUL@ulthickness
    \dimen@i=-.75ex % increased by -0.25ex
    \advance\[email protected]\dimen@
    \edef\SOUL@uldepth{\the\dimen@i}%
    \let\SOUL@ulcolor\SOUL@stcolor
    \SOUL@ulpreamble
}
\makeatother
\usepackage{etoolbox}

\usepackage[colorlinks]{hyperref}

\makeatletter
\newcommand{\sectionbiblio}{%
    \patchcmd{\std@thebibliography}{\chapter*}{\section*}{}{}
}


% define \citepos just like \cite
\DeclareRobustCommand\citepos
{\begingroup
    \let\NAT@nmfmt\NAT@posfmt% ...except with a different name format
    \NAT@swafalse\let\NAT@ctype\z@\NAT@partrue
    \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}

\makeatother

\makeatletter
% make numeric styles use name format
\patchcmd{\NAT@test}{\else \NAT@nm}{\else \NAT@nmfmt{\NAT@nm}}{}{}

\let\NAT@orig@nmfmt\NAT@nmfmt
\def\NAT@posfmt#1{\NAT@orig@nmfmt{#1's}}

\makeatother
\newcommand{\Y}[1]{{\color{green}#1}}
\newcommand{\N}[1]{{\color{red}#1}}
\renewcommand{\baselinestretch}{1.9}


\newcommand{\highlight}[1]{{\ttfamily\hyphenchar\font=45\relax\hl{#1}}}

\begin{document}

The classical \cite{Markowitz, 1952} asset allocation algorithm is the stronghold of portfolio construction since its first appearance in 1952, however it is known to output concentrated portfolios with unstable weights achieving poor out-of-sample performances. \cite{Michaud, 1989} demonstrates its tendency to maximize the errors within the input assumptions. 
\bibliographystyle{unsrt}

\newpage
\bibliography{graph_bibliography1}
\end{document}

bibtex 文件是:

@article{Markowitz, 1952,
    author = {Markowitz, Harry},
    doi = {10.2307/2975974},
    journal = {The Journal of Finance},
    language = {English},
    month = mar,
    number = 1,
    pages = {77-91},
    title = {Portfolio Selection},
    url = {https://www.jstor.org/stable/2975974},
    volume = 7,
    year = 1952
}

@article{Michaud, 1989,
    author = {Richard O. Michaud},
    title = {The Markowitz Optimization Enigma: Is ‘Optimized’ Optimal?},
    journal = {Financial Analysts Journal},
    volume = {45},
    number = {1},
    pages = {31-42},
    year  = {1989},
    publisher = {Routledge},
    doi = {10.2469/faj.v45.n1.31},
    URL = { https://doi.org/10.2469/faj.v45.n1.31}
}

我收到错误:Citation `Markowitz' on page 2 undefined。其他所有引文也同样如此。

在打印的 PDF 中,我得到了“?”。此外,编译 bibtex 文件时,我得到了以下错误:

I can't write on file `paper.pdf'.

知道如何修复这个问题吗?

答案1

用作您的.bib文件

@article{Markowitz1952,
    author = {Markowitz, Harry},
    doi = {10.2307/2975974},
    journal = {The Journal of Finance},
    language = {English},
    month = 3,
    number = 1,
    pages = {77-91},
    title = {{Portfolio Selection}},
    url = {https://www.jstor.org/stable/2975974},
    volume = 7,
    year = 1952
}

@article{Michaud1989,
    author =  {Michaud, Richard O.},
    title = {{The Markowitz Optimization Enigma: Is ‘Optimized’ Optimal?}},
    journal = {Financial Analysts Journal},
    volume = 45,
    number = 1,
    pages = {31-42},
    year  = 1989,
    publisher = {Routledge},
    doi = {10.2469/faj.v45.n1.31},
    URL =  {https://doi.org/10.2469/faj.v45.n1.31}
}

并使用

The classical \cite{Markowitz1952} asset allocation algorithm is the stronghold of portfolio construction since its first appearance in 1952, however it is known to output concentrated portfolios with unstable weights achieving poor out-of-sample performances. \cite{Michaud1989} demonstrates its tendency to maximize the errors within the input assumptions. 

要得到

b

相关内容