为什么有些引用有效而有些则无效?

为什么有些引用有效而有些则无效?

我很难理解为什么有些引用有效而其他的无效?

\documentclass[12pt]{article}
    \usepackage[margin=1in]{geometry} 
    \usepackage{amsmath,amsthm,amssymb}
     \usepackage{graphicx}
     \usepackage{verbatim}
     \usepackage{setspace}
    %\usepackage[square,sort,comma,numbers]{natbib}
    \usepackage{natbib}
    \usepackage{comment}
    \def\bibfont{\small}%
    \def\bibsep{\smallskipamount}%
    \def\bibhang{24pt}%
    \def\newblock{\ }%
    \def\BIBand{and}%


    \begin{document}

    I would like to cite \citep{Laroche2001} and \citep{Thogersen2002} and \citep{Young2010}

    \bibliographystyle{apalike} 

\bibliography{LiteratureSust} 

    \end{document}

这些是引用,其中第 1 和第 3 条有效,但第 2 条无效):

@InCollection{Thogersen2002,
    author = {Thogersen, J.},
    title = {Promoting "green'' consumer behavior with eco- labels},
    booktitle = {New tools for environmental protection: Education, information, and voluntary measures},
    pages = {83-104},
    publisher = {Washington DC: National Academy Press},
    editor = {In T. Dietz \& P. Stern (Eds.)},
    year = {2002},
}
@ARTICLE{Laroche2001,
  AUTHOR =       "Laroche, M. and Bergeron, J. and Barbaro-Forleo, G.",
  TITLE =        "Targeting consumers who are willing to pay more for environmentally friendly products",
  JOURNAL =      "Journal of Consumer Marketing,",
  YEAR =         "2001",
  volume =       "18",
  number =       "6",
  pages =        "503-520",
}



@ARTICLE{Young2010,
  AUTHOR =       " Young, W. and Hwang, K and  McDonald, S. and  Oates, C. J.",
  TITLE =        "Sustainable consumption: Green consumer behaviour when purchasing products",
  JOURNAL =      "Sustainable Development,",
  YEAR =         "2010",
  volume =       "18",
  number =       "1",
  pages =        " 20-31",
}

在关注了其中一条评论后,我现在得到的是:

在此处输入图片描述

在此处输入图片描述

    This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./Sustainability_Compreh_Paper.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2015/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amscls/amsthm.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/local/texlive/2015/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/verbatim.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/setspace/setspace.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/natbib/natbib.sty)
(/usr/local/texlive/2015/texmf-dist/tex/latex/comment/comment.sty
Excluding comment 'comment') (./Sustainability_Compreh_Paper.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(/usr/local/texlive/2015/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsb.fd)

LaTeX Warning: No \author given.


Package natbib Warning: Citation `EPA2016' on page 1 undefined on input line 54
.


Package natbib Warning: Citation `Boyle2009' on page 1 undefined on input line 
56.


Package natbib Warning: Citation `EPA2016' on page 1 undefined on input line 57
.


Package natbib Warning: Citation `Linton2007' on page 1 undefined on input line
 57.


Package natbib Warning: Citation `CocaCola2015' on page 1 undefined on input li
ne 57.


Package natbib Warning: Citation `Knickle2011' on page 1 undefined on input lin
e 57.


Package natbib Warning: Citation `Nestle2015' on page 1 undefined on input line
 57.


Package natbib Warning: Citation `Kraft2015' on page 1 undefined on input line 
57.


Package natbib Warning: Citation `Canada2009' on page 1 undefined on input line
 57.

[1{/usr/local/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]

Package natbib Warning: Citation `UN2005' on page 2 undefined on input line 64.



Package natbib Warning: Citation `Gleim2013' on page 2 undefined on input line 
64.


Package natbib Warning: Citation `CR2007' on page 2 undefined on input line 64.



Package natbib Warning: Citation `luchs2010' on page 2 undefined on input line 
64.


Package natbib Warning: Citation `Balakrishnan2014' on page 2 undefined on inpu
t line 70.

[2]

Package natbib Warning: Citation `Johnsson1998' on page 3 undefined on input li
ne 74.

[3] [4] [5] <7.jpg, id=23, 2081.7775pt x 1513.655pt> <use 7.jpg> [6 <./7.jpg>]
[7] [8] [9] Excluding 'comment' comment. [10] [11]
<3.jpg, id=45, 2081.7775pt x 1513.655pt> <use 3.jpg>
Underfull \hbox (badness 10000) in paragraph at lines 242--243


Overfull \hbox (25.84772pt too wide) in paragraph at lines 291--294
\OT1/cmr/m/n/12 bil-ity func-tion, such that in-creas-ing $\OML/cmm/m/it/12 x$ 
\OT1/cmr/m/n/12 by 1 im-plies chang-ing fail-ure prob-a-bil-ity from $[][\OMS/c
msy/m/n/12 ^^@ []\OT1/cmr/m/n/12 (\OML/cmm/m/it/12 ^^L[] \OT1/cmr/m/n/12 +
[12 <./3.jpg>] Excluding 'comment' comment. [13] Excluding 'comment' comment.
Excluding 'comment' comment. Excluding 'comment' comment.

Package natbib Warning: Citation `Young2010' on page 14 undefined on input line
 427.


Package natbib Warning: Citation `Laroche2001' on page 14 undefined on input li
ne 429.


Package natbib Warning: Citation `Bronnenberg2008' on page 14 undefined on inpu
t line 430.

(./Sustainability_Compreh_Paper.bbl)

Package natbib Warning: There were undefined citations.

[14] (./Sustainability_Compreh_Paper.aux) )
(\end occurred inside a group at level 1)

### semi simple group (level 1) entered at line 51 (\begingroup)
### bottom level
(see the transcript file for additional information)</usr/local/texlive/2015/te
xmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/local/texlive/2015/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/local/texlive/2015/texm
f-dist/fonts/type1/public/amsfonts/cm/cmbxti10.pfb></usr/local/texlive/2015/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmcsc10.pfb></usr/local/texlive/2015/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmmi12.pfb></usr/local/texlive/2015/texm
f-dist/fonts/type1/public/amsfonts/cm/cmmi8.pfb></usr/local/texlive/2015/texmf-
dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2015/texmf-di
st/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/local/texlive/2015/texmf-dist
/fonts/type1/public/amsfonts/cm/cmr6.pfb></usr/local/texlive/2015/texmf-dist/fo
nts/type1/public/amsfonts/cm/cmr8.pfb></usr/local/texlive/2015/texmf-dist/fonts
/type1/public/amsfonts/cm/cmsy10.pfb></usr/local/texlive/2015/texmf-dist/fonts/
type1/public/amsfonts/cm/cmsy8.pfb></usr/local/texlive/2015/texmf-dist/fonts/ty
pe1/public/amsfonts/cm/cmti12.pfb>
Output written on Sustainability_Compreh_Paper.pdf (14 pages, 685179 bytes).
SyncTeX written on Sustainability_Compreh_Paper.synctex.gz.
Transcript written on Sustainability_Compreh_Paper.log.

编辑2:我确实有这些代码,但仍然收到错误。

在此处输入图片描述

最后更新:

我在文档中找到了问号的原因。在 LaTeX 编码中,我没有包含“\usepackage{url}”。我不知道 url 引用需要该代码(在原始文件中,我有很多这样的代码)。一旦我将其包含进去,一切都正常了。

答案1

这个答案解决了问题的原始版本,并反映了发布的代码和参考书目条目的问题。

在文件中输入作者字段的正确方法.bib是:

Surname1, FirstName and Surname2, FirstName2 and Surname3, FirstName3

您需要用逗号分隔每个名字,并用逗号分隔姓氏和名字(或首字母)。所有名字的and顺序必须始终一致。Surname, FirstName

尽管其他一些格式也能起作用(例如,FirstName LastName能被正确处理但处理两个名字的姓氏时会失败),但使用的方法Surname, FirstName 是养成习惯的最佳实践。

.bib您发布的特定条目还存在其他问题:

  • 某些字段中的逗号,例如期刊名称后的逗号
  • 编辑器字段中的格式;此字段应仅包含姓名,以与常规作者姓名相同的方式输入
  • 页码用连字符 ( -) 代替短划线 ( --);这并不总是必要的,但也是一个很好的习惯

但是这些问题都不会导致您在编辑的问题中描述的问题,因为您发布的是来自不同文档的错误。您发布的文档加上.bib您发布的确切条目将生成可编译的文档。虽然参考书目的格式不正确,但文档不会产生任何错误。

相关内容